5
0
mirror of git://git.proxmox.com/git/qemu-server.git synced 2025-03-12 20:58:26 +03:00

fix #2114: set correct link status on hotplug

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@proxmox.com>
This commit is contained in:
Dominik Csapak 2019-02-28 09:15:59 +01:00 committed by Thomas Lamprecht
parent bd772c2e87
commit 79046fd12e

View File

@ -4140,7 +4140,10 @@ sub vm_deviceplug {
my $netdevicefull = print_netdevice_full($vmid, $conf, $device, $deviceid, undef, $use_old_bios_files, $arch, $machine_type);
qemu_deviceadd($vmid, $netdevicefull);
eval { qemu_deviceaddverify($vmid, $deviceid); };
eval {
qemu_deviceaddverify($vmid, $deviceid);
qemu_set_link_status($vmid, $deviceid, !$device->{link_down});
};
if (my $err = $@) {
eval { qemu_netdevdel($vmid, $deviceid); };
warn $@ if $@;