Re: [PATCH 04/10] secret: Introduce virSecretObjListFindBy{UUID|Usage} support

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

 



On 03/02/2016 11:55 AM, John Ferlan wrote:
> New API's including unlocked and Locked versions in order to be able
> to use in either manner.
> 
> Support for searching hash object lists instead of linked lists will
> replace existing secret_driver functions secretFindByUUID and
> secretFindByUsage
> 
> Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx>
> ---
>  src/conf/secret_conf.c | 144 +++++++++++++++++++++++++++++++++++++++++++++++++
>  src/conf/secret_conf.h |  14 +++++
>  2 files changed, 158 insertions(+)
> 

> +/**
> + * virSecretObjFindByUUIDLocked:

> +    ret = virHashLookup(secrets->objs, uuidstr);
> +    if (ret)
> +        virObjectRef(ret);
> +    return ret;

It's safe to write:

return virObjectRef(virHashLookup(...));

since virObjectRef intentionally has sane handling of NULL.  Of course,
you were just copying existing practice, and maybe the more verbose form
is arguably more legible, so I don't care if you change it.  (Or maybe a
followup patch the other code you were copying from to use the compact
form...)


ACK

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
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]