summaryrefslogtreecommitdiff
path: root/block.h
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 /block.h
parentd191d12d5f479422e16ed1d12b0222547b29036a (diff)
downloadqemu-59f2689d9082f2f631253c810f73cd22290144a9.tar.gz
qemu-59f2689d9082f2f631253c810f73cd22290144a9.tar.bz2
qemu-59f2689d9082f2f631253c810f73cd22290144a9.zip
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 'block.h')
-rw-r--r--block.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/block.h b/block.h
index a966afb090..302010d953 100644
--- a/block.h
+++ b/block.h
@@ -136,6 +136,7 @@ int bdrv_get_type_hint(BlockDriverState *bs);
int bdrv_get_translation_hint(BlockDriverState *bs);
int bdrv_is_removable(BlockDriverState *bs);
int bdrv_is_read_only(BlockDriverState *bs);
+int bdrv_set_read_only(BlockDriverState *bs, int read_only);
int bdrv_is_sg(BlockDriverState *bs);
int bdrv_enable_write_cache(BlockDriverState *bs);
int bdrv_is_inserted(BlockDriverState *bs);