[libvirt] [PATCH 11/14] lib: Don't force the key argument when deleting metadata

Eric Blake eblake at redhat.com
Tue Sep 17 02:53:33 UTC 2013


On 09/10/2013 04:15 AM, Peter Krempa wrote:
> virDomainSetMetadata when operating on the metadata element was
> requesting the @key argument to be passed even if @metadata was NULL
> used to delete the corresponding metadata element. This is not needed as
> the key is only used when adding the element and matching is done via
> the XML namespace.
> ---
>  src/libvirt.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/src/libvirt.c b/src/libvirt.c
> index 07a3fd5..2c94950 100644
> --- a/src/libvirt.c
> +++ b/src/libvirt.c
> @@ -10734,7 +10734,8 @@ virDomainSetMetadata(virDomainPtr domain,
>          break;
>      case VIR_DOMAIN_METADATA_ELEMENT:
>          virCheckNonNullArgGoto(uri, error);
> -        virCheckNonNullArgGoto(key, error);
> +        if (metadata)
> +            virCheckNonNullArgGoto(key, error);

ACK - if we delete ALL metadata (rather than just the metadata tied to a
particular key), then it doesn't matter what key we pass.

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 621 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20130916/003fba1c/attachment-0001.sig>


More information about the libvir-list mailing list