aboutsummaryrefslogtreecommitdiff
path: root/qemu-config.c
diff options
context:
space:
mode:
authorNaphtali Sprei <nsprei@redhat.com>2009-10-26 16:25:16 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-11-09 08:43:01 -0600
commit59f2689d9082f2f631253c810f73cd22290144a9 (patch)
treefeff1eaf42f55486ef2a9fb6573191dbc5001c83 /qemu-config.c
parentd191d12d5f479422e16ed1d12b0222547b29036a (diff)
Added readonly flag to -drive command
This is a slightly revised patch for adding readonly flag to the -drive command. Even though this patch is "stand-alone", it assumes a previous related patch (in Anthony staging tree), that passes the readonly attribute of the drive to the guest OS, applied first. This enables sharing same image between guests, with readonly access. Implementaion mark the drive as read_only and changes the flags when actually opening the file. The readonly attribute of a qcow also passed to it's base file. For ide that cannot pass the readonly attribute to the guest OS, disallow the readonly flag. Also, return error code from bdrv_truncate for readonly drive. Signed-off-by: Naphtali Sprei <nsprei@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'qemu-config.c')
-rw-r--r--qemu-config.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/qemu-config.c b/qemu-config.c
index fc73beaef6..d83d2a697c 100644
--- a/qemu-config.c
+++ b/qemu-config.c
@@ -71,6 +71,9 @@ QemuOptsList qemu_drive_opts = {
.name = "addr",
.type = QEMU_OPT_STRING,
.help = "pci address (virtio only)",
+ },{
+ .name = "readonly",
+ .type = QEMU_OPT_BOOL,
},
{ /* end if list */ }
},