]> git.proxmox.com Git - qemu.git/commit - vl.c
Added readonly flag to -drive command
authorNaphtali Sprei <nsprei@redhat.com>
Mon, 26 Oct 2009 14:25:16 +0000 (16:25 +0200)
committerAnthony Liguori <aliguori@us.ibm.com>
Mon, 9 Nov 2009 14:43:01 +0000 (08:43 -0600)
commit59f2689d9082f2f631253c810f73cd22290144a9
treefeff1eaf42f55486ef2a9fb6573191dbc5001c83
parentd191d12d5f479422e16ed1d12b0222547b29036a
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>
block.c
block.h
qemu-config.c
vl.c