mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-10-04 17:30:20 +00:00
migration : add del_nets_bridge_fdb
at the end of a live migration, we need to remove old mac entries on source host (vm is not yet stopped), before resume vm on target host Signed-off-by: Alexandre Derumier <aderumier@odiso.com> [T: resolve conflicts and rework on apply ] Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
4ddd2ca293
commit
73ed64967e
@ -1181,6 +1181,9 @@ sub phase3_cleanup {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# deletes local FDB entries if learning is disabled, they'll be re-added on target on resume
|
||||||
|
PVE::QemuServer::del_nets_bridge_fdb($conf, $vmid);
|
||||||
|
|
||||||
if (!$self->{vm_was_paused}) {
|
if (!$self->{vm_was_paused}) {
|
||||||
# config moved and nbd server stopped - now we can resume vm on target
|
# config moved and nbd server stopped - now we can resume vm on target
|
||||||
if ($tunnel && $tunnel->{version} && $tunnel->{version} >= 1) {
|
if ($tunnel && $tunnel->{version} && $tunnel->{version} >= 1) {
|
||||||
|
@ -8338,4 +8338,22 @@ sub add_nets_bridge_fdb {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub del_nets_bridge_fdb {
|
||||||
|
my ($conf, $vmid) = @_;
|
||||||
|
|
||||||
|
for my $opt (keys %$conf) {
|
||||||
|
next if $opt !~ m/^net(\d+)$/;
|
||||||
|
my $iface = "tap${vmid}i$1";
|
||||||
|
|
||||||
|
my $net = parse_net($conf->{$opt}) or next;
|
||||||
|
my $mac = $net->{macaddr} or next;
|
||||||
|
|
||||||
|
if ($have_sdn) {
|
||||||
|
PVE::Network::SDN::Zones::del_bridge_fdb($iface, $mac, $net->{bridge}, $net->{firewall});
|
||||||
|
} else {
|
||||||
|
PVE::Network::del_bridge_fdb($iface, $mac, $net->{firewall});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
@ -158,6 +158,7 @@ $MigrationTest::Shared::qemu_server_module->mock(
|
|||||||
$vm_stop_executed = 1;
|
$vm_stop_executed = 1;
|
||||||
delete $expected_calls->{'vm_stop'};
|
delete $expected_calls->{'vm_stop'};
|
||||||
},
|
},
|
||||||
|
del_nets_bridge_fdb => sub { return; },
|
||||||
);
|
);
|
||||||
|
|
||||||
my $qemu_server_cpuconfig_module = Test::MockModule->new("PVE::QemuServer::CPUConfig");
|
my $qemu_server_cpuconfig_module = Test::MockModule->new("PVE::QemuServer::CPUConfig");
|
||||||
|
Loading…
Reference in New Issue
Block a user