]> xenbits.xensource.com Git - libvirt.git/commit
uml: Use virDomainObjListFindBy{UUID|ID}Ref
authorJohn Ferlan <jferlan@redhat.com>
Mon, 23 Oct 2017 17:14:13 +0000 (13:14 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Thu, 19 Apr 2018 18:44:51 +0000 (14:44 -0400)
commit6477dcc88e0039df9390467522e91592e1f47295
tree9b6c13085fbd2296e0628641ed63e9aa3205c358
parent7e134bd377cac4c0213bfb75e7aef0accf2b371f
uml: Use virDomainObjListFindBy{UUID|ID}Ref

For umlDomObjFromDomainLocked and umlDomainLookupByID let's
return a locked and referenced @vm object so that callers
can then use the common and more consistent virDomainObjEndAPI
in order to handle cleanup rather than needing to know that the
returned object is locked and calling virObjectUnlock. This
means for some consumers we need to relock the @dom after a
virDomainObjListRemove, but before calling virDomainObjEndAPI.

The LookupByName already returns the ref counted and locked object,
so this will make things more consistent.

Signed-off-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
src/uml/uml_driver.c