summaryrefslogtreecommitdiffstats
path: root/hmp-commands.hx
diff options
context:
space:
mode:
authorDenis V. Lunev2022-04-13 00:18:46 +0200
committerHanna Reitz2022-04-25 12:02:36 +0200
commit80dd5aff1b3273e0ee5bec379df62647c0b39c1c (patch)
tree984391b0ca2dbeb1ec858ad0348227ac6312268b /hmp-commands.hx
parentMerge tag 'pull-target-arm-20220422-1' of https://git.linaro.org/people/pmayd... (diff)
downloadqemu-80dd5aff1b3273e0ee5bec379df62647c0b39c1c.tar.gz
qemu-80dd5aff1b3273e0ee5bec379df62647c0b39c1c.tar.xz
qemu-80dd5aff1b3273e0ee5bec379df62647c0b39c1c.zip
block: add 'force' parameter to 'blockdev-change-medium' command
'blockdev-change-medium' is a convinient wrapper for the following sequence of commands: * blockdev-open-tray * blockdev-remove-medium * blockdev-insert-medium * blockdev-close-tray and should be used f.e. to change ISO image inside the CD-ROM tray. Though the guest could lock the tray and some linux guests like CentOS 8.5 actually does that. In this case the execution if this command results in the error like the following: Device 'scsi0-0-1-0' is locked and force was not specified, wait for tray to open and try again. This situation is could be resolved 'blockdev-open-tray' by passing flag 'force' inside. Thus is seems reasonable to add the same capability for 'blockdev-change-medium' too. Signed-off-by: Denis V. Lunev <den@openvz.org> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@openvz.org> Acked-by: "Dr. David Alan Gilbert" <dgilbert@redhat.com> CC: Kevin Wolf <kwolf@redhat.com> CC: Hanna Reitz <hreitz@redhat.com> CC: Eric Blake <eblake@redhat.com> CC: Markus Armbruster <armbru@redhat.com> Message-Id: <20220412221846.280723-1-den@openvz.org> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Hanna Reitz <hreitz@redhat.com>
Diffstat (limited to 'hmp-commands.hx')
-rw-r--r--hmp-commands.hx11
1 files changed, 7 insertions, 4 deletions
diff --git a/hmp-commands.hx b/hmp-commands.hx
index dd4006d355..34947d6d20 100644
--- a/hmp-commands.hx
+++ b/hmp-commands.hx
@@ -202,9 +202,9 @@ ERST
{
.name = "change",
- .args_type = "device:B,target:F,arg:s?,read-only-mode:s?",
- .params = "device filename [format [read-only-mode]]",
- .help = "change a removable medium, optional format",
+ .args_type = "device:B,force:-f,target:F,arg:s?,read-only-mode:s?",
+ .params = "device [-f] filename [format [read-only-mode]]",
+ .help = "change a removable medium, optional format, use -f to force the operation",
.cmd = hmp_change,
},
@@ -212,11 +212,14 @@ SRST
``change`` *device* *setting*
Change the configuration of a device.
- ``change`` *diskdevice* *filename* [*format* [*read-only-mode*]]
+ ``change`` *diskdevice* [-f] *filename* [*format* [*read-only-mode*]]
Change the medium for a removable disk device to point to *filename*. eg::
(qemu) change ide1-cd0 /path/to/some.iso
+ ``-f``
+ forces the operation even if the guest has locked the tray.
+
*format* is optional.
*read-only-mode* may be used to change the read-only status of the device.