From 39ff43d9e1f42b1d829a955e546cddab87ac0626 Mon Sep 17 00:00:00 2001 From: Max Reitz Date: Wed, 11 Nov 2015 04:49:44 +0100 Subject: 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 Signed-off-by: Kevin Wolf --- qapi/block-core.json | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'qapi/block-core.json') diff --git a/qapi/block-core.json b/qapi/block-core.json index e9fa6493be..fa08ba946a 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -1958,6 +1958,24 @@ 'node-name': 'str'} } +## +# @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: # @@ -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' } } ## -- cgit v1.2.1