]> xenbits.xensource.com Git - libvirt.git/commitdiff
lib: Don't force the key argument when deleting metadata
authorPeter Krempa <pkrempa@redhat.com>
Tue, 10 Sep 2013 09:25:55 +0000 (11:25 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 17 Sep 2013 07:42:49 +0000 (09:42 +0200)
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

index a6fcab0c2638bd554dd899e91ba2c0d5c243c95a..3f65f12ea0f410a2fc6ec0b182c385496a613649 100644 (file)
@@ -10739,7 +10739,8 @@ virDomainSetMetadata(virDomainPtr domain,
         break;
     case VIR_DOMAIN_METADATA_ELEMENT:
         virCheckNonNullArgGoto(uri, error);
-        virCheckNonNullArgGoto(key, error);
+        if (metadata)
+            virCheckNonNullArgGoto(key, error);
         break;
     default:
         /* For future expansion */