[libvirt] [PATCH 12/14] secret: Introduce secretAssignDef
Daniel P. Berrange
berrange at redhat.com
Fri Feb 26 17:13:20 UTC 2016
On Thu, Feb 25, 2016 at 09:03:16AM -0500, John Ferlan wrote:
> This new API will allocate the secret, assign the def pointer, and
> insert the secret onto the passed list. Whether that's the temporary
> list in loadSecrets which gets loaded into the driver list or driver
> list during secretDefineXML.
>
> Signed-off-by: John Ferlan <jferlan at redhat.com>
> ---
> src/secret/secret_driver.c | 33 +++++++++++++++++++++++----------
> 1 file changed, 23 insertions(+), 10 deletions(-)
>
> diff --git a/src/secret/secret_driver.c b/src/secret/secret_driver.c
> index 70bd2f3..8ebe79d 100644
> --- a/src/secret/secret_driver.c
> +++ b/src/secret/secret_driver.c
> @@ -168,6 +168,22 @@ secretFindByUsage(int usageType,
> return NULL;
> }
>
> +
> +static virSecretObjPtr
> +secretAssignDef(virSecretObjPtr *list,
> + virSecretDefPtr def)
> +{
> + virSecretObjPtr secret;
> +
> + if (VIR_ALLOC(secret) < 0)
> + return NULL;
> +
> + listInsert(list, secret);
> + secret->def = def;
> +
> + return secret;
> +}
Could probably argue this function ultimately belongs in src/conf/secret_conf.c
to match domain_conf.c virDomainObjAssignDef
ACK anyway.
Regards,
Daniel
--
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org -o- http://virt-manager.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
More information about the libvir-list
mailing list