]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
tools: report messages for 'dominfo' command
authorDaniel P. Berrangé <berrange@redhat.com>
Fri, 22 Jan 2021 15:06:52 +0000 (15:06 +0000)
committerDaniel P. Berrangé <berrange@redhat.com>
Fri, 12 Feb 2021 09:19:13 +0000 (09:19 +0000)
$ virsh dominfo demo
Id:             2
Name:           demo
UUID:           eadf8ef0-bf14-4c5f-9708-4a19bacf9e81
OS Type:        hvm
State:          running
CPU(s):         2
CPU time:       15.8s
Max memory:     1536000 KiB
Used memory:    1536000 KiB
Persistent:     yes
Autostart:      disable
Managed save:   no
Security model: selinux
Security DOI:   0
Security label: unconfined_u:unconfined_r:svirt_t:s0:c443,c956 (permissive)
Messages:       tainted: custom monitor control commands issued
                tainted: use of deprecated configuration settings
                deprecated configuration: machine type 'pc-1.2'

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
tools/virsh-domain-monitor.c

index 02ff1fbd62d498d13189fc54d598120022a4d4b2..897339b6f9cd46129a259f83ce93d7dd6f3a44c5 100644 (file)
@@ -1291,6 +1291,7 @@ cmdDominfo(vshControl *ctl, const vshCmd *cmd)
     char *str, uuid[VIR_UUID_STRING_BUFLEN];
     int has_managed_save = 0;
     virshControlPtr priv = ctl->privData;
+    g_auto(GStrv) messages = NULL;
 
     if (!(dom = virshCommandOptDomain(ctl, cmd, NULL)))
         return false;
@@ -1391,6 +1392,15 @@ cmdDominfo(vshControl *ctl, const vshCmd *cmd)
             VIR_FREE(seclabel);
         }
     }
+
+    if (virDomainGetMessages(dom, &messages, 0) > 0) {
+        size_t i;
+        for (i = 0; messages[i] != NULL; i++) {
+            vshPrint(ctl, "%-15s %s\n",
+                     i == 0 ? _("Messages:") : "", messages[i]);
+        }
+    }
+
     virshDomainFree(dom);
     return ret;
 }