ioemu: Disable format auto-probing in monitor command change
authorKeir Fraser <keir.fraser@citrix.com>
Wed, 18 Jun 2008 08:39:14 +0000 (09:39 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Wed, 18 Jun 2008 08:39:14 +0000 (09:39 +0100)
Format auto-probing of writable images is a security hole.  The last
known remaining instance is monitor command change.  Disable probing
there and use raw.  This breaks change for images in all other
formats.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
tools/ioemu/monitor.c

index f15a0dd376d1291a73cc03eb0320a16924da4111..50ff243e5dc29f0a338e6beb325a93ae8661cb8e 100644 (file)
@@ -387,7 +387,7 @@ static void do_change_block(const char *device, const char *filename)
     }
     if (eject_device(bs, 0) < 0)
         return;
-    bdrv_open(bs, filename, 0);
+    bdrv_open2(bs, filename, 0, &bdrv_raw);
     if (bdrv_is_encrypted(bs)) {
         term_printf("%s is encrypted.\n", device);
         for(i = 0; i < 3; i++) {