]> Git Repo - qemu.git/blobdiff - block/bochs.c
Merge remote-tracking branch 'remotes/dgilbert/tags/pull-migration-20180926a' into...
[qemu.git] / block / bochs.c
index 516da56c3b1acf50e6cbe073e417a1bff927a008..50c630047ba158c034ae854095e8613e768f975d 100644 (file)
@@ -28,6 +28,7 @@
 #include "block/block_int.h"
 #include "qemu/module.h"
 #include "qemu/bswap.h"
+#include "qemu/error-report.h"
 
 /**************************************************************/
 
@@ -110,7 +111,16 @@ static int bochs_open(BlockDriverState *bs, QDict *options, int flags,
         return -EINVAL;
     }
 
-    bs->read_only = true; /* no write support yet */
+    if (!bdrv_is_read_only(bs)) {
+        error_report("Opening bochs 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); /* no write support yet */
+        if (ret < 0) {
+            return ret;
+        }
+    }
 
     ret = bdrv_pread(bs->file, 0, &bochs, sizeof(bochs));
     if (ret < 0) {
This page took 0.022374 seconds and 4 git commands to generate.