Re: [PATCH v2] bhyve: Use virDomainObjListFindBy{UUID|ID}Ref

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 04/02/2018 03:11 PM, John Ferlan wrote:
> For bhyveDomObjFromDomain, bhyveDomainLookupByUUID, and
> bhyveDomainLookupByID 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 bhyveDomainUndefine and bhyveDomainDestroy since the
> virDomainObjListRemove will return an unlocked object, we need to
> relock before making the EndAPI call.
> 
> Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx>
> ---
> 
>  Patch 1:
> https://www.redhat.com/archives/libvir-list/2018-March/msg00490.html
> 
>  of the larger series:
> https://www.redhat.com/archives/libvir-list/2018-March/msg00489.html
> 
> Changes since v1:
> 
>  * From review, use virObjectLock after virDomainObjListRemove when
>    calling in a path that would have returned a reffed and locked
>    object since virDomainObjListRemove will return an unlocked, but
>    reffed object.
> 
>  src/bhyve/bhyve_driver.c | 62 ++++++++++++++++++------------------------------
>  1 file changed, 23 insertions(+), 39 deletions(-)

ACK

Michal

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux