19d5529 vmware: Use virDomainObjListFindBy{UUID|ID}Ref

Authored and Committed by John Ferlan 6 years ago
    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>
    
        
file modified
+19 -34