tools: report messages for 'dominfo' command

$ 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>
This commit is contained in:
Daniel P. Berrangé 2021-01-22 15:06:52 +00:00
parent 970a59d746
commit 46783e6307

View 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;
}