提交 7f3534a5 编写于 作者: P Peter Krempa

virsh: domjobinfo: Allow printing stats also for failed and other jobs

Introduce the --anystats flag which does not skip the printing of the
stats if the job was unsuccessful.
Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NEric Blake <eblake@redhat.com>
上级 2a55bcd8
......@@ -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)) {
......
......@@ -1381,11 +1381,16 @@ Returns basic information about the domain.
Abort the currently running domain job.
=item B<domjobinfo> I<domain> [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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册