[pve-devel] [PATCH qemu-server] fix #2114: set correct link status on hotplug

Dominik Csapak d.csapak at proxmox.com
Wed Feb 27 14:40:21 CET 2019


we also need to set the link status if the whole device changed,
otherwise a change of macaddress allows a network connection even
if link_down is set to 1

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 PVE/QemuServer.pm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 6e56eda..3f190a3 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -4995,6 +4995,7 @@ sub vmconfig_update_net {
 
     if ($hotplug) {
 	vm_deviceplug($storecfg, $conf, $vmid, $opt, $newnet, $arch, $machine_type);
+	qemu_set_link_status($vmid, $opt, !$newnet->{link_down});
     } else {
 	die "skip\n";
     }
-- 
2.11.0




More information about the pve-devel mailing list