提交 a39427be 编写于 作者: J John Ferlan

uml: Fix umlProcessAutoDestroyDom dom processing

There's no need to check if @dom exists before trying to
call virDomainObjListRemove since it must exist due to
prior checks.

Additionally, if we do remove the @dom, then set it to NULL
so that the virObjectUnlock isn't referencing something that
is deleted.
Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
Reviewed-by: NMarc Hartmayer <mhartmay@linux.vnet.ibm.com>
Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
上级 6a6a5463
......@@ -747,8 +747,10 @@ static int umlProcessAutoDestroyDom(void *payload,
VIR_DOMAIN_EVENT_STOPPED,
VIR_DOMAIN_EVENT_STOPPED_DESTROYED);
if (dom && !dom->persistent)
if (!dom->persistent) {
virDomainObjListRemove(data->driver->domains, dom);
dom = NULL;
}
if (dom)
virObjectUnlock(dom);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册