]> git.proxmox.com Git - qemu-server.git/commitdiff
qmp: use 'id' parameter instead of 'device'
authorStefan Reiter <s.reiter@proxmox.com>
Thu, 6 Feb 2020 09:53:53 +0000 (10:53 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 6 Feb 2020 12:50:33 +0000 (13:50 +0100)
'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>
PVE/QemuServer.pm

index 12e63980e137baf9d27ad8206d128bf29cc28d3c..e1698d00b178550963863ed6da8550de780934bf 100644 (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");
                    }
                }