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

Peter Krempa pkrempa at redhat.com
Tue Sep 10 10:15:47 UTC 2013


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);
         break;
     default:
         /* For future expansion */
-- 
1.8.3.2




More information about the libvir-list mailing list