]> git.ipfire.org Git - thirdparty/libvirt.git/commit
vmware: Use virDomainObjListFindBy{UUID|ID}Ref
authorJohn Ferlan <jferlan@redhat.com>
Mon, 23 Oct 2017 17:25:34 +0000 (13:25 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Fri, 20 Apr 2018 11:50:41 +0000 (07:50 -0400)
commit19d5529fc19d70f5743e2e4ab1213df259c0e57c
treeee4effb027b17a19117e349eff0417474c0643d5
parent7b324eedb79dacb0b7fa5f40eb60644876214c2b
vmware: Use virDomainObjListFindBy{UUID|ID}Ref

For vmwareDomObjFromDomainLocked and vmwareDomainLookupByID
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.

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

For vmwareDomainUndefineFlags and vmwareDomainShutdownFlags since
virDomainObjListRemove will return an unlocked object, we need to
relock before making the EndAPI call.

Signed-off-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
src/vmware/vmware_driver.c