mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-05-04 09:13:40 +00:00
qemu_deviceadd : convert to qmp
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
This commit is contained in:
parent
5a77d8c105
commit
d695b5b725
@ -2620,13 +2620,11 @@ sub vm_deviceunplug {
|
|||||||
sub qemu_deviceadd {
|
sub qemu_deviceadd {
|
||||||
my ($vmid, $devicefull) = @_;
|
my ($vmid, $devicefull) = @_;
|
||||||
|
|
||||||
my $ret = vm_human_monitor_command($vmid, "device_add $devicefull");
|
$devicefull = "driver=".$devicefull;
|
||||||
$ret =~ s/^\s+//;
|
my %options = split(/[=,]/, $devicefull);
|
||||||
# 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;
|
|
||||||
|
|
||||||
|
vm_mon_cmd($vmid, "device_add" , %options);
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub qemu_devicedel {
|
sub qemu_devicedel {
|
||||||
|
Loading…
Reference in New Issue
Block a user