aboutsummaryrefslogtreecommitdiff
path: root/qemu-img.c
diff options
context:
space:
mode:
authorNaphtali Sprei <nsprei@redhat.com>2010-01-21 14:40:39 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2010-01-26 15:42:01 -0600
commit058fc8c768f81f9140db511171185dc8e0676163 (patch)
tree2638db9a159c0b89d15882bfa43606fc1f6e75cc /qemu-img.c
parent37226ad946597126f5bce36f75f818b12fe4b5b8 (diff)
downloadqemu-058fc8c768f81f9140db511171185dc8e0676163.zip
qemu-058fc8c768f81f9140db511171185dc8e0676163.tar.gz
qemu-058fc8c768f81f9140db511171185dc8e0676163.tar.bz2
Ask for read-write permissions when opening files
Found some places that seems needs this explicitly, now that read-write is not the default. Signed-off-by: Naphtali Sprei <nsprei@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'qemu-img.c')
-rw-r--r--qemu-img.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/qemu-img.c b/qemu-img.c
index 3cea8ce..cbba4fc 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -1116,7 +1116,7 @@ static int img_rebase(int argc, char **argv)
if (!bs)
error("Not enough memory");
- flags = BRDV_O_FLAGS | (unsafe ? BDRV_O_NO_BACKING : 0);
+ flags = BRDV_O_FLAGS | BDRV_O_RDWR | (unsafe ? BDRV_O_NO_BACKING : 0);
if (bdrv_open2(bs, filename, flags, NULL) < 0) {
error("Could not open '%s'", filename);
}
@@ -1157,7 +1157,7 @@ static int img_rebase(int argc, char **argv)
}
bs_new_backing = bdrv_new("new_backing");
- if (bdrv_open2(bs_new_backing, out_baseimg, BRDV_O_FLAGS,
+ if (bdrv_open2(bs_new_backing, out_baseimg, BRDV_O_FLAGS | BDRV_O_RDWR,
new_backing_drv))
{
error("Could not open new backing file '%s'", backing_name);