提交 a2ac63af 编写于 作者: M Michal Privoznik

virDomainRestore: Don't keep transient domains around

So while working on my previous patches, I've noticed that
virDomainRestore implementation in qemu and test drivers has the
same problem as I am fixing.
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
上级 f41be296
......@@ -6828,8 +6828,6 @@ qemuDomainRestoreFlags(virConnectPtr conn,
VIR_WARN("Failed to close %s", path);
qemuDomainObjEndJob(driver, vm);
if (ret < 0)
qemuDomainRemoveInactive(driver, vm);
cleanup:
virDomainDefFree(def);
......@@ -6837,6 +6835,8 @@ qemuDomainRestoreFlags(virConnectPtr conn,
VIR_FREE(xml);
VIR_FREE(xmlout);
virFileWrapperFdFree(wrapperFd);
if (vm && ret < 0)
qemuDomainRemoveInactive(driver, vm);
virDomainObjEndAPI(&vm);
virNWFilterUnlockFilterUpdates();
return ret;
......
......@@ -2132,8 +2132,13 @@ testDomainRestoreFlags(virConnectPtr conn,
goto cleanup;
def = NULL;
if (testDomainStartState(privconn, dom, VIR_DOMAIN_RUNNING_RESTORED) < 0)
if (testDomainStartState(privconn, dom, VIR_DOMAIN_RUNNING_RESTORED) < 0) {
if (!dom->persistent) {
virDomainObjListRemove(privconn->domains, dom);
dom = NULL;
}
goto cleanup;
}
event = virDomainEventLifecycleNewFromObj(dom,
VIR_DOMAIN_EVENT_STARTED,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册