mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 09:17:52 +03:00
virsh: domjobinfo: Print also job operation for failed jobs
Printing that a job failed is rather unhelpful. Print at least the operation which failed. Achieve this by moving the check whether to print stats later but replace it with a check which will skip printing of the operation if there's no job. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
parent
2dae916de4
commit
2a55bcd8da
@ -6153,10 +6153,8 @@ cmdDomjobinfo(vshControl *ctl, const vshCmd *cmd)
|
|||||||
|
|
||||||
vshPrint(ctl, "%-17s %-12s\n", _("Job type:"),
|
vshPrint(ctl, "%-17s %-12s\n", _("Job type:"),
|
||||||
virshDomainJobToString(info.type));
|
virshDomainJobToString(info.type));
|
||||||
if (info.type != VIR_DOMAIN_JOB_BOUNDED &&
|
|
||||||
info.type != VIR_DOMAIN_JOB_UNBOUNDED &&
|
if (info.type == VIR_DOMAIN_JOB_NONE) {
|
||||||
(!(flags & VIR_DOMAIN_JOB_STATS_COMPLETED) ||
|
|
||||||
info.type != VIR_DOMAIN_JOB_COMPLETED)) {
|
|
||||||
ret = true;
|
ret = true;
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
@ -6169,6 +6167,14 @@ cmdDomjobinfo(vshControl *ctl, const vshCmd *cmd)
|
|||||||
vshPrint(ctl, "%-17s %-12s\n", _("Operation:"),
|
vshPrint(ctl, "%-17s %-12s\n", _("Operation:"),
|
||||||
virshDomainJobOperationToString(op));
|
virshDomainJobOperationToString(op));
|
||||||
|
|
||||||
|
if (info.type != VIR_DOMAIN_JOB_BOUNDED &&
|
||||||
|
info.type != VIR_DOMAIN_JOB_UNBOUNDED &&
|
||||||
|
(!(flags & VIR_DOMAIN_JOB_STATS_COMPLETED) ||
|
||||||
|
info.type != VIR_DOMAIN_JOB_COMPLETED)) {
|
||||||
|
ret = true;
|
||||||
|
goto cleanup;
|
||||||
|
}
|
||||||
|
|
||||||
vshPrint(ctl, "%-17s %-12llu ms\n", _("Time elapsed:"), info.timeElapsed);
|
vshPrint(ctl, "%-17s %-12llu ms\n", _("Time elapsed:"), info.timeElapsed);
|
||||||
if ((rc = virTypedParamsGetULLong(params, nparams,
|
if ((rc = virTypedParamsGetULLong(params, nparams,
|
||||||
VIR_DOMAIN_JOB_TIME_ELAPSED_NET,
|
VIR_DOMAIN_JOB_TIME_ELAPSED_NET,
|
||||||
|
Loading…
Reference in New Issue
Block a user