Skip to content

Commit c03712e

Browse files
iHiroakiKawaisudison
authored andcommitted
CLOUDSTACK-423 : During VM migration on KVM, VifDriver.unplug is not
called. VifDriver.unplug must be called in MigrateCommand which hooks VM migration in source host, because plug will be called in PrepareForMigration in destination host. But that operation is missing in current LibvirtComputingResources. Signed-off-by: Edison Su <sudison@gmail.com>
1 parent cb93954 commit c03712e

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

‎plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2320,12 +2320,15 @@ private synchronized Answer execute(MigrateCommand cmd) {
23202320
_vms.put(vmName, State.Stopping);
23212321
}
23222322

2323+
List<InterfaceDef> ifaces = null;
2324+
23232325
Domain dm = null;
23242326
Connect dconn = null;
23252327
Domain destDomain = null;
23262328
Connect conn = null;
23272329
try {
23282330
conn = LibvirtConnection.getConnection();
2331+
ifaces = getInterfaces(conn, vmName);
23292332
dm = conn.domainLookupByUUID(UUID.nameUUIDFromBytes(vmName
23302333
.getBytes()));
23312334
dconn = new Connect("qemu+tcp://" + cmd.getDestinationIp()
@@ -2364,6 +2367,9 @@ private synchronized Answer execute(MigrateCommand cmd) {
23642367
}
23652368
} else {
23662369
destroy_network_rules_for_vm(conn, vmName);
2370+
for (InterfaceDef iface : ifaces) {
2371+
_vifDriver.unplug(iface);
2372+
}
23672373
cleanupVM(conn, vmName,
23682374
getVnetId(VirtualMachineName.getVnet(vmName)));
23692375
}

0 commit comments

Comments
 (0)