mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-05-02 15:25:36 +00:00
nic online bridge/vlan change: link disconnect/reconnect
We want to notify guest of the change, so it can resubmit dhcp request, or send gratuitous arp,... Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
This commit is contained in:
parent
e6e6c2934d
commit
3f14f206a0
@ -5339,6 +5339,12 @@ sub vmconfig_update_net {
|
|||||||
safe_num_ne($oldnet->{firewall}, $newnet->{firewall})) {
|
safe_num_ne($oldnet->{firewall}, $newnet->{firewall})) {
|
||||||
PVE::Network::tap_unplug($iface);
|
PVE::Network::tap_unplug($iface);
|
||||||
|
|
||||||
|
#set link_down in guest if bridge or vlan change to notify guest (dhcp renew for example)
|
||||||
|
if (safe_string_ne($oldnet->{bridge}, $newnet->{bridge}) ||
|
||||||
|
safe_num_ne($oldnet->{tag}, $newnet->{tag})) {
|
||||||
|
qemu_set_link_status($vmid, $opt, 0);
|
||||||
|
}
|
||||||
|
|
||||||
if (safe_string_ne($oldnet->{bridge}, $newnet->{bridge})) {
|
if (safe_string_ne($oldnet->{bridge}, $newnet->{bridge})) {
|
||||||
if ($have_sdn) {
|
if ($have_sdn) {
|
||||||
PVE::Network::SDN::Vnets::del_ips_from_mac($oldnet->{bridge}, $oldnet->{macaddr}, $conf->{name});
|
PVE::Network::SDN::Vnets::del_ips_from_mac($oldnet->{bridge}, $oldnet->{macaddr}, $conf->{name});
|
||||||
@ -5351,6 +5357,13 @@ sub vmconfig_update_net {
|
|||||||
} else {
|
} else {
|
||||||
PVE::Network::tap_plug($iface, $newnet->{bridge}, $newnet->{tag}, $newnet->{firewall}, $newnet->{trunks}, $newnet->{rate});
|
PVE::Network::tap_plug($iface, $newnet->{bridge}, $newnet->{tag}, $newnet->{firewall}, $newnet->{trunks}, $newnet->{rate});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#set link_up in guest if bridge or vlan change to notify guest (dhcp renew for example)
|
||||||
|
if (safe_string_ne($oldnet->{bridge}, $newnet->{bridge}) ||
|
||||||
|
safe_num_ne($oldnet->{tag}, $newnet->{tag})) {
|
||||||
|
qemu_set_link_status($vmid, $opt, 1);
|
||||||
|
}
|
||||||
|
|
||||||
} elsif (safe_num_ne($oldnet->{rate}, $newnet->{rate})) {
|
} elsif (safe_num_ne($oldnet->{rate}, $newnet->{rate})) {
|
||||||
# Rate can be applied on its own but any change above needs to
|
# Rate can be applied on its own but any change above needs to
|
||||||
# include the rate in tap_plug since OVS resets everything.
|
# include the rate in tap_plug since OVS resets everything.
|
||||||
|
Loading…
Reference in New Issue
Block a user