From 922869f22310b35b1a7bf8ead1558ab30f0c93a1 Mon Sep 17 00:00:00 2001 From: Stefan Reiter Date: Thu, 6 Feb 2020 10:53:53 +0100 Subject: [PATCH] qmp: use 'id' parameter instead of 'device' '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 --- PVE/QemuServer.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index 12e63980..e1698d00 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.39.5