From 3b6784d119074e3be8861cc4c30630f299bde121 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Tue, 10 Sep 2013 11:25:55 +0200 Subject: [PATCH] lib: Don't force the key argument when deleting metadata 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 a6fcab0c26..3f65f12ea0 100644 --- a/src/libvirt.c +++ b/src/libvirt.c @@ -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 */ -- 2.47.2