mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-25 21:02:22 +00:00
qemu: Always remove domain object if MigratePrepare fails
If migration failed in Prepare phase after virDomainAssignDef and before a job was started, the domain object was not properly removed.
This commit is contained in:
parent
03d89991f2
commit
1cb031a2bb
@ -1178,8 +1178,12 @@ cleanup:
|
|||||||
virDomainDefFree(def);
|
virDomainDefFree(def);
|
||||||
VIR_FORCE_CLOSE(dataFD[0]);
|
VIR_FORCE_CLOSE(dataFD[0]);
|
||||||
VIR_FORCE_CLOSE(dataFD[1]);
|
VIR_FORCE_CLOSE(dataFD[1]);
|
||||||
if (vm)
|
if (vm) {
|
||||||
|
if (ret >= 0 || vm->persistent)
|
||||||
virDomainObjUnlock(vm);
|
virDomainObjUnlock(vm);
|
||||||
|
else
|
||||||
|
qemuDomainRemoveInactive(driver, vm);
|
||||||
|
}
|
||||||
if (event)
|
if (event)
|
||||||
qemuDomainEventQueue(driver, event);
|
qemuDomainEventQueue(driver, event);
|
||||||
qemuMigrationCookieFree(mig);
|
qemuMigrationCookieFree(mig);
|
||||||
@ -1188,9 +1192,6 @@ cleanup:
|
|||||||
endjob:
|
endjob:
|
||||||
if (qemuMigrationJobFinish(driver, vm) == 0) {
|
if (qemuMigrationJobFinish(driver, vm) == 0) {
|
||||||
vm = NULL;
|
vm = NULL;
|
||||||
} else if (!vm->persistent) {
|
|
||||||
qemuDomainRemoveInactive(driver, vm);
|
|
||||||
vm = NULL;
|
|
||||||
}
|
}
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user