.type = VSH_OT_BOOL,
.help = N_("print statistics for any kind of job (even failed ones)")
},
+ {.name = "rawstats",
+ .type = VSH_OT_BOOL,
+ .help = N_("print the raw data returned by libvirt")
+ },
{.name = NULL}
};
int ivalue;
int op;
int rc;
+ size_t i;
+ bool rawstats = vshCommandOptBool(cmd, "rawstats");
VSH_REQUIRE_OPTION("keep-completed", "completed");
if (virshDomainJobStatsToDomainJobInfo(params, nparams, &info) < 0)
goto cleanup;
} else if (last_error->code == VIR_ERR_NO_SUPPORT) {
- if (flags) {
- vshError(ctl, "%s", _("Optional flags are not supported by the "
- "daemon"));
+ if (flags != 0 || rawstats) {
+ vshError(ctl, "%s",
+ _("Optional flags or --rawstats are not supported by the daemon"));
goto cleanup;
}
vshDebug(ctl, VSH_ERR_DEBUG, "detailed statistics not supported\n");
if (rc < 0)
goto cleanup;
+ if (rawstats) {
+ vshPrint(ctl, "Job type: %d\n\n", info.type);
+
+ for (i = 0; i < nparams; i++) {
+ g_autofree char *par = virTypedParameterToString(¶ms[i]);
+ vshPrint(ctl, "%s: %s\n", params[i].field, NULLSTR(par));
+ }
+
+ ret = true;
+ goto cleanup;
+ }
+
vshPrint(ctl, "%-17s %-12s\n", _("Job type:"),
virshDomainJobToString(info.type));
Abort the currently running domain job.
=item B<domjobinfo> I<domain> [I<--completed> [I<--keep-completed>]]
-[I<--anystats>]
+[I<--anystats>] [I<--rawstats>]
Returns information about jobs running on a domain. I<--completed> tells
virsh to return information about a recently finished job. Statistics of
Normally only statistics for running and successful completed jobs are printed.
I<--anystats> can be used to also display statistics for failed jobs.
+In case I<--rawstats> is used, all fields are printed as received from the
+server without any attempts to interpret the data. The "Job type:" field is
+special, since it's reported by the API and not part of stats.
+
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