]> git.proxmox.com Git - qemu.git/commitdiff
qemu-img rebase: Open new backing file read-only
authorKevin Wolf <kwolf@redhat.com>
Tue, 17 Aug 2010 16:58:55 +0000 (18:58 +0200)
committerKevin Wolf <kwolf@redhat.com>
Mon, 30 Aug 2010 16:29:22 +0000 (18:29 +0200)
We never write to a backing file, so opening rw is useless. It just means that
you can't rebase on top of a file for which you don't have write permissions.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
qemu-img.c

index e300f911cb5b05b7e68323ad47d80129f4caf8cc..d2a978b9126bb5d406d1184742b6b9336d5c281c 100644 (file)
@@ -1286,7 +1286,7 @@ static int img_rebase(int argc, char **argv)
         }
 
         bs_new_backing = bdrv_new("new_backing");
-        ret = bdrv_open(bs_new_backing, out_baseimg, BDRV_O_FLAGS | BDRV_O_RDWR,
+        ret = bdrv_open(bs_new_backing, out_baseimg, BDRV_O_FLAGS,
                         new_backing_drv);
         if (ret) {
             error("Could not open new backing file '%s'", out_baseimg);