5
0
mirror of git://git.proxmox.com/git/qemu-server.git synced 2025-01-08 21:18:03 +03:00

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 <s.reiter@proxmox.com>
This commit is contained in:
Stefan Reiter 2020-02-06 10:53:53 +01:00 committed by Thomas Lamprecht
parent ce9fce7985
commit 922869f223

View File

@ -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");
}
}