diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index d8c09927d2..b599ce4807 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -6029,6 +6029,10 @@ static const vshCmdOptDef opts_domjobinfo[] = { .type = VSH_OT_BOOL, .help = N_("don't destroy statistics of a recently completed job when reading") }, + {.name = "anystats", + .type = VSH_OT_BOOL, + .help = N_("print statistics for any kind of job (even failed ones)") + }, {.name = NULL} }; @@ -6167,7 +6171,8 @@ cmdDomjobinfo(vshControl *ctl, const vshCmd *cmd) vshPrint(ctl, "%-17s %-12s\n", _("Operation:"), virshDomainJobOperationToString(op)); - if (info.type != VIR_DOMAIN_JOB_BOUNDED && + if (!vshCommandOptBool(cmd, "anystats") && + info.type != VIR_DOMAIN_JOB_BOUNDED && info.type != VIR_DOMAIN_JOB_UNBOUNDED && (!(flags & VIR_DOMAIN_JOB_STATS_COMPLETED) || info.type != VIR_DOMAIN_JOB_COMPLETED)) { diff --git a/tools/virsh.pod b/tools/virsh.pod index 59743a5aa4..4196bea7bd 100644 --- a/tools/virsh.pod +++ b/tools/virsh.pod @@ -1381,11 +1381,16 @@ Returns basic information about the domain. Abort the currently running domain job. =item B I [I<--completed> [I<--keep-completed>]] +[I<--anystats>] Returns information about jobs running on a domain. I<--completed> tells virsh to return information about a recently finished job. Statistics of a completed job are automatically destroyed once read (unless I<--keep-completed> is used) or when libvirtd is restarted. + +Normally only statistics for running and successful completed jobs are printed. +I<--anystats> can be used to also display statistics for failed jobs. + Note that time information returned for completed migrations may be completely irrelevant unless both source and destination hosts have synchronized time (i.e., NTP daemon is running