summaryrefslogtreecommitdiffstats
path: root/qapi
diff options
context:
space:
mode:
authorMax Reitz <mreitz@redhat.com>2015-11-11 04:49:44 +0100
committerKevin Wolf <kwolf@redhat.com>2015-11-11 16:23:34 +0100
commit39ff43d9e1f42b1d829a955e546cddab87ac0626 (patch)
tree40a4f937d8fe47ab085bf7950253c348a941e3d2 /qapi
parent1068674927a08cb9f535946abe2f91529b13160c (diff)
downloadhqemu-39ff43d9e1f42b1d829a955e546cddab87ac0626.zip
hqemu-39ff43d9e1f42b1d829a955e546cddab87ac0626.tar.gz
blockdev: read-only-mode for blockdev-change-medium
Add an option to qmp_blockdev_change_medium() which allows changing the read-only status of the block device whose medium is changed. Some drives do not have a inherently fixed read-only status; for instance, floppy disks can be set read-only or writable independently of the drive. Some users may find it useful to be able to therefore change the read-only status of a block device when changing the medium. Signed-off-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'qapi')
-rw-r--r--qapi/block-core.json24
1 files changed, 23 insertions, 1 deletions
diff --git a/qapi/block-core.json b/qapi/block-core.json
index e9fa649..fa08ba9 100644
--- a/qapi/block-core.json
+++ b/qapi/block-core.json
@@ -1959,6 +1959,24 @@
##
+# @BlockdevChangeReadOnlyMode:
+#
+# Specifies the new read-only mode of a block device subject to the
+# @blockdev-change-medium command.
+#
+# @retain: Retains the current read-only mode
+#
+# @read-only: Makes the device read-only
+#
+# @read-write: Makes the device writable
+#
+# Since: 2.3
+##
+{ 'enum': 'BlockdevChangeReadOnlyMode',
+ 'data': ['retain', 'read-only', 'read-write'] }
+
+
+##
# @blockdev-change-medium:
#
# Changes the medium inserted into a block device by ejecting the current medium
@@ -1973,12 +1991,16 @@
# @format: #optional, format to open the new image with (defaults to
# the probed format)
#
+# @read-only-mode: #optional, change the read-only mode of the device; defaults
+# to 'retain'
+#
# Since: 2.5
##
{ 'command': 'blockdev-change-medium',
'data': { 'device': 'str',
'filename': 'str',
- '*format': 'str' } }
+ '*format': 'str',
+ '*read-only-mode': 'BlockdevChangeReadOnlyMode' } }
##
OpenPOWER on IntegriCloud