]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virsh: Fix ambiguous output in metadata-change event
authorHan Han <hhan@redhat.com>
Wed, 27 Oct 2021 08:52:33 +0000 (16:52 +0800)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 1 Nov 2021 16:00:41 +0000 (17:00 +0100)
When you set metadata with type element like the following:
dom.setMetadata(libvirt.VIR_DOMAIN_METADATA_ELEMENT, "<test/>", 'abc', "HAHAH", 0)

Then for `virsh event --all`, then it will output this message:
event 'metadata-change' for domain 'rhel9': element HAHAH

The message is ambiguous since it looks like the params for
metadata-change event is the element HAHAH. Actually that means the type is
element while the url is HAHAH. Let's make it more clear.

Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
tools/virsh-domain.c

index 7f3356a536696866a8375d49d0074bb46aab0500..d454075dfcefc69988c69baf200a4c7c3dcca62b 100644 (file)
@@ -13317,7 +13317,7 @@ virshEventMetadataChangePrint(virConnectPtr conn G_GNUC_UNUSED,
 {
     g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
 
-    virBufferAsprintf(&buf, _("event 'metadata-change' for domain '%s': %s %s\n"),
+    virBufferAsprintf(&buf, _("event 'metadata-change' for domain '%s': type %s, uri %s\n"),
                       virDomainGetName(dom),
                       UNKNOWNSTR(virshEventMetadataChangeTypeTypeToString(type)),
                       NULLSTR(nsuri));