mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-07-11 04:15:49 +00:00
virsh: Implement VIR_DOMAIN_JOB_STATS_KEEP_COMPLETED for 'domjobinfo'
Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
parent
d4a4933a0d
commit
7884b40659
@ -6025,6 +6025,10 @@ static const vshCmdOptDef opts_domjobinfo[] = {
|
|||||||
.type = VSH_OT_BOOL,
|
.type = VSH_OT_BOOL,
|
||||||
.help = N_("return statistics of a recently completed job")
|
.help = N_("return statistics of a recently completed job")
|
||||||
},
|
},
|
||||||
|
{.name = "keep-completed",
|
||||||
|
.type = VSH_OT_BOOL,
|
||||||
|
.help = N_("don't destroy statistics of a recently completed job when reading")
|
||||||
|
},
|
||||||
{.name = NULL}
|
{.name = NULL}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -6117,12 +6121,17 @@ cmdDomjobinfo(vshControl *ctl, const vshCmd *cmd)
|
|||||||
int op;
|
int op;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
|
VSH_REQUIRE_OPTION("keep-completed", "completed");
|
||||||
|
|
||||||
if (!(dom = virshCommandOptDomain(ctl, cmd, NULL)))
|
if (!(dom = virshCommandOptDomain(ctl, cmd, NULL)))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (vshCommandOptBool(cmd, "completed"))
|
if (vshCommandOptBool(cmd, "completed"))
|
||||||
flags |= VIR_DOMAIN_JOB_STATS_COMPLETED;
|
flags |= VIR_DOMAIN_JOB_STATS_COMPLETED;
|
||||||
|
|
||||||
|
if (vshCommandOptBool(cmd, "keep-completed"))
|
||||||
|
flags |= VIR_DOMAIN_JOB_STATS_KEEP_COMPLETED;
|
||||||
|
|
||||||
memset(&info, 0, sizeof(info));
|
memset(&info, 0, sizeof(info));
|
||||||
|
|
||||||
rc = virDomainGetJobStats(dom, &info.type, ¶ms, &nparams, flags);
|
rc = virDomainGetJobStats(dom, &info.type, ¶ms, &nparams, flags);
|
||||||
|
@ -1380,12 +1380,13 @@ Returns basic information about the domain.
|
|||||||
|
|
||||||
Abort the currently running domain job.
|
Abort the currently running domain job.
|
||||||
|
|
||||||
=item B<domjobinfo> I<domain> [I<--completed>]
|
=item B<domjobinfo> I<domain> [I<--completed> [I<--keep-completed>]]
|
||||||
|
|
||||||
Returns information about jobs running on a domain. I<--completed> tells
|
Returns information about jobs running on a domain. I<--completed> tells
|
||||||
virsh to return information about a recently finished job. Statistics of
|
virsh to return information about a recently finished job. Statistics of
|
||||||
a completed job are automatically destroyed once read or when libvirtd
|
a completed job are automatically destroyed once read (unless
|
||||||
is restarted. Note that time information returned for completed
|
I<--keep-completed> is used) or when libvirtd is restarted.
|
||||||
|
Note that time information returned for completed
|
||||||
migrations may be completely irrelevant unless both source and
|
migrations may be completely irrelevant unless both source and
|
||||||
destination hosts have synchronized time (i.e., NTP daemon is running
|
destination hosts have synchronized time (i.e., NTP daemon is running
|
||||||
on both of them).
|
on both of them).
|
||||||
|
Loading…
Reference in New Issue
Block a user