[pve-devel] [PATCH 14/14] convert eject cdrom monitor command to qmp

Alexandre Derumier aderumier at odiso.com
Tue Jun 26 06:34:23 CEST 2012


Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
 PVE/API2/Qemu.pm |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm
index 497c334..380dec4 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;
 	    }
 	}
 
-- 
1.7.2.5




More information about the pve-devel mailing list