[libvirt] [PATCH v2 4/4] vmware: Use virDomainObjListFindBy{UUID|ID}Ref

Pavel Hrdina phrdina at redhat.com
Fri Apr 20 09:12:44 UTC 2018


On Mon, Apr 02, 2018 at 09:16:40AM -0400, John Ferlan wrote:
> 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 at redhat.com>
> ---
>  src/vmware/vmware_driver.c | 53 +++++++++++++++++-----------------------------
>  1 file changed, 19 insertions(+), 34 deletions(-)

Reviewed-by: Pavel Hrdina <phrdina at redhat.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20180420/1925c0ad/attachment-0001.sig>


More information about the libvir-list mailing list