From ce156282e68b077d1a9568e92b6fcc9610b22fbb Mon Sep 17 00:00:00 2001 From: Alexandre Derumier Date: Mon, 25 Jun 2012 10:02:58 +0200 Subject: [PATCH] convert eject cdrom monitor command to qmp Signed-off-by: Alexandre Derumier --- PVE/API2/Qemu.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm index 497c3343..380dec44 100644 --- a/PVE/API2/Qemu.pm +++ b/PVE/API2/Qemu.pm @@ -687,11 +687,11 @@ my $vmconfig_update_disk = sub { if (PVE::QemuServer::check_running($vmid)) { if ($drive->{file} eq 'none') { - PVE::QemuServer::vm_monitor_command($vmid, "eject -f drive-$opt", 0); + PVE::QemuServer::vm_mon_cmd($vmid, "eject",force => JSON::true,device => "drive-$opt"); } else { my $path = PVE::QemuServer::get_iso_path($storecfg, $vmid, $drive->{file}); - PVE::QemuServer::vm_monitor_command($vmid, "eject -f drive-$opt", 0); #force eject if locked - PVE::QemuServer::vm_monitor_command($vmid, "change drive-$opt \"$path\"", 0) if $path; + PVE::QemuServer::vm_mon_cmd($vmid, "eject",force => JSON::true,device => "drive-$opt"); #force eject if locked + PVE::QemuServer::vm_mon_cmd($vmid, "change",device => "drive-$opt",target => "$path") if $path; } }