mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-08-11 16:41:44 +00: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:
parent
bd772c2e87
commit
79046fd12e
@ -4140,7 +4140,10 @@ sub vm_deviceplug {
|
|||||||
|
|
||||||
my $netdevicefull = print_netdevice_full($vmid, $conf, $device, $deviceid, undef, $use_old_bios_files, $arch, $machine_type);
|
my $netdevicefull = print_netdevice_full($vmid, $conf, $device, $deviceid, undef, $use_old_bios_files, $arch, $machine_type);
|
||||||
qemu_deviceadd($vmid, $netdevicefull);
|
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 = $@) {
|
if (my $err = $@) {
|
||||||
eval { qemu_netdevdel($vmid, $deviceid); };
|
eval { qemu_netdevdel($vmid, $deviceid); };
|
||||||
warn $@ if $@;
|
warn $@ if $@;
|
||||||
|
Loading…
Reference in New Issue
Block a user