diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index 434afe3b..fb672eb3 100644 --- a/PVE/QemuServer.pm +++ b/PVE/QemuServer.pm @@ -166,8 +166,8 @@ my $confdesc = { hotplug => { optional => 1, type => 'boolean', - description => "Activate hotplug for disk and network device", - default => 0, + description => "Allow hotplug for disk and network device", + default => 1, }, reboot => { optional => 1, @@ -2519,7 +2519,7 @@ sub vm_deviceplug { return 1; } - return 1 if !$conf->{hotplug}; + return 1 if defined($conf->{hotplug}) && !$conf->{hotplug}; my $devices_list = vm_devices_list($vmid); return 1 if defined($devices_list->{$deviceid}); @@ -2586,7 +2586,7 @@ sub vm_deviceunplug { return 1; } - return 1 if!$conf->{hotplug}; + return 1 if defined($conf->{hotplug}) && !$conf->{hotplug}; my $devices_list = vm_devices_list($vmid); return 1 if !defined($devices_list->{$deviceid});