mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-02 01:45:17 +00:00
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:
parent
6a6a5463af
commit
a39427be49
@ -747,8 +747,10 @@ static int umlProcessAutoDestroyDom(void *payload,
|
|||||||
VIR_DOMAIN_EVENT_STOPPED,
|
VIR_DOMAIN_EVENT_STOPPED,
|
||||||
VIR_DOMAIN_EVENT_STOPPED_DESTROYED);
|
VIR_DOMAIN_EVENT_STOPPED_DESTROYED);
|
||||||
|
|
||||||
if (dom && !dom->persistent)
|
if (!dom->persistent) {
|
||||||
virDomainObjListRemove(data->driver->domains, dom);
|
virDomainObjListRemove(data->driver->domains, dom);
|
||||||
|
dom = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if (dom)
|
if (dom)
|
||||||
virObjectUnlock(dom);
|
virObjectUnlock(dom);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user