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: John Ferlan <jferlan@redhat.com>
Reviewed-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
John Ferlan 2018-03-27 10:18:06 -04:00
parent 6a6a5463af
commit a39427be49

View File

@ -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);