[pve-devel] [PATCH 4/7] vmconfig_hotplug_pending : add tablet hotplug
Alexandre Derumier
aderumier at odiso.com
Tue Nov 18 13:39:49 CET 2014
Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
PVE/QemuServer.pm | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 61e53a7..387bbac 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -3503,8 +3503,22 @@ sub vmconfig_hotplug_pending {
#hotplug
foreach my $opt (keys %{$conf->{pending}}) {
+
if ($opt =~ m/^net(\d+)$/) {
vmconfig_update_net($storecfg, $conf, $vmid, $opt);
+ }elsif ($opt eq 'tablet'){
+
+ if($conf->{pending}->{$opt} == 1){
+ if(PVE::QemuServer::vm_deviceplug(undef, $conf, $vmid, $opt, $conf->{pending}->{$opt})){
+ $conf->{$opt} = $conf->{pending}->{$opt};
+ delete $conf->{pending}->{$opt};
+ }
+ } elsif($conf->{pending}->{$opt} == 0){
+ if(PVE::QemuServer::vm_deviceunplug($vmid, $conf, $opt)){
+ $conf->{$opt} = $conf->{pending}->{$opt};
+ delete $conf->{pending}->{$opt};
+ }
+ }
}
}
--
1.7.10.4
More information about the pve-devel
mailing list