[pve-devel] [PATCH qemu-server 3/5] qmp: use 'id' parameter instead of 'device'
Stefan Reiter
s.reiter at proxmox.com
Thu Feb 6 10:53:53 CET 2020
'device' is deprecated since 2.8 in favor of 'id' [0], but since we
always consistently set the id on our drives anyway we can substitute it
easily.
[0] see files qapi/block.json and qapi/block-core.json in QEMU source
code, the online documentation doesn't mention it AFAICT
Signed-off-by: Stefan Reiter <s.reiter at proxmox.com>
---
PVE/QemuServer.pm | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index ff2e3ee..0c1bd6d 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -5131,7 +5131,7 @@ sub vmconfig_update_disk {
} else { # cdrom
if ($drive->{file} eq 'none') {
- mon_cmd($vmid, "eject", force => JSON::true, device => "drive-$opt");
+ mon_cmd($vmid, "eject", force => JSON::true, id => "$opt");
if (drive_is_cloudinit($old_drive)) {
vmconfig_register_unused_drive($storecfg, $vmid, $conf, $old_drive);
}
@@ -5139,11 +5139,11 @@ sub vmconfig_update_disk {
my $path = get_iso_path($storecfg, $vmid, $drive->{file});
# force eject if locked
- mon_cmd($vmid, "eject", force => JSON::true, device => "drive-$opt");
+ mon_cmd($vmid, "eject", force => JSON::true, id => "$opt");
if ($path) {
mon_cmd($vmid, "blockdev-change-medium",
- device => "drive-$opt", filename => "$path");
+ id => "$opt", filename => "$path");
}
}
--
2.20.1
More information about the pve-devel
mailing list