]> Git Repo - qemu.git/blobdiff - block/dmg.c
block: Deprecate bdrv_set_read_only() and users
[qemu.git] / block / dmg.c
index 6c0711f5636a40758107043a0b4cb9f728c70dd9..c9b3c519c4d93c89ba9298e2dabd7f5a52567c14 100644 (file)
@@ -419,9 +419,15 @@ static int dmg_open(BlockDriverState *bs, QDict *options, int flags,
         return -EINVAL;
     }
 
-    ret = bdrv_set_read_only(bs, true, errp);
-    if (ret < 0) {
-        return ret;
+    if (!bdrv_is_read_only(bs)) {
+        error_report("Opening dmg images without an explicit read-only=on "
+                     "option is deprecated. Future versions will refuse to "
+                     "open the image instead of automatically marking the "
+                     "image read-only.");
+        ret = bdrv_set_read_only(bs, true, errp);
+        if (ret < 0) {
+            return ret;
+        }
     }
 
     block_module_load_one("dmg-bz2");
This page took 0.024098 seconds and 4 git commands to generate.