]> git.proxmox.com Git - qemu-server.git/commitdiff
qemu_deviceadd : convert to qmp
authorAlexandre Derumier <aderumier@odiso.com>
Tue, 19 Feb 2013 09:22:07 +0000 (10:22 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Tue, 19 Feb 2013 09:31:43 +0000 (10:31 +0100)
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
PVE/QemuServer.pm

index 6b0ccfc224749efed1cbf0dc8a7c7c56591a46cb..4bdca11caaff6b5d9e6b59edeaa4dea35247a432 100644 (file)
@@ -2620,13 +2620,11 @@ sub vm_deviceunplug {
 sub qemu_deviceadd {
     my ($vmid, $devicefull) = @_;
 
-    my $ret = vm_human_monitor_command($vmid, "device_add $devicefull");
-    $ret =~ s/^\s+//;
-    # Otherwise, if the command succeeds, no output is sent. So any non-empty string shows an error
-    return 1 if $ret eq "";
-    syslog("err", "error on hotplug device : $ret");
-    return undef;
+    $devicefull = "driver=".$devicefull;
+    my %options =  split(/[=,]/, $devicefull);
 
+    vm_mon_cmd($vmid, "device_add" , %options);
+    return 1;
 }
 
 sub qemu_devicedel {