},
{.name = "async",
.type = VSH_OT_BOOL,
- .help = N_("don't wait for --abort to complete")
+ .help = N_("implies --abort; request but don't wait for job end")
},
{.name = "pivot",
.type = VSH_OT_BOOL,
- .help = N_("conclude and pivot a copy job")
+ .help = N_("implies --abort; conclude and pivot a copy or commit job")
},
{.name = "info",
.type = VSH_OT_BOOL,
.help = N_("get active job information for the specified disk")
},
+ {.name = "raw",
+ .type = VSH_OT_BOOL,
+ .help = N_("implies --info; output details rather than human summary")
+ },
{.name = "bandwidth",
.type = VSH_OT_DATA,
.help = N_("set the Bandwidth limit in MiB/s")
virDomainBlockJobInfo info;
bool ret = false;
int rc;
+ bool raw = vshCommandOptBool(cmd, "raw");
bool abortMode = (vshCommandOptBool(cmd, "abort") ||
vshCommandOptBool(cmd, "async") ||
vshCommandOptBool(cmd, "pivot"));
- bool infoMode = vshCommandOptBool(cmd, "info");
+ bool infoMode = vshCommandOptBool(cmd, "info") || raw;
bool bandwidth = vshCommandOptBool(cmd, "bandwidth");
virDomainPtr dom = NULL;
const char *path;
if (abortMode + infoMode + bandwidth > 1) {
vshError(ctl, "%s",
- _("conflict between --abort, --info, and --bandwidth modes"));
+ _("conflict between abort, info, and bandwidth modes"));
return false;
}
if (rc < 0)
goto cleanup;
if (rc == 0) {
+ if (!raw)
+ vshPrint(ctl, _("No current block job for %s"), path);
ret = true;
goto cleanup;
}
- vshPrintJobProgress(vshDomainBlockJobToString(info.type),
- info.end - info.cur, info.end);
- if (info.bandwidth != 0)
- vshPrint(ctl, _(" Bandwidth limit: %lu MiB/s\n"), info.bandwidth);
+ if (raw) {
+ vshPrint(ctl, _(" type=%s\n bandwidth=%lu\n cur=%llu\n end=%llu\n"),
+ vshDomainBlockJobTypeToString(info.type),
+ info.bandwidth, info.cur, info.end);
+ } else {
+ vshPrintJobProgress(vshDomainBlockJobToString(info.type),
+ info.end - info.cur, info.end);
+ if (info.bandwidth != 0)
+ vshPrint(ctl, _(" Bandwidth limit: %lu MiB/s"),
+ info.bandwidth);
+ vshPrint(ctl, "\n");
+ }
ret = true;
cleanup:
if (dom)
on hypervisor.
=item B<blockjob> I<domain> I<path> { [I<--abort>] [I<--async>] [I<--pivot>] |
-[I<--info>] | [I<bandwidth>] }
+[I<--info>] [I<--raw>] | [I<bandwidth>] }
-Manage active block operations. There are three modes: I<--info>,
-I<bandwidth>, and I<--abort>; I<--info> is default except that I<--async>
-or I<--pivot> implies I<--abort>.
+Manage active block operations. There are three mutually-exclusive modes:
+I<--info>, I<bandwidth>, and I<--abort>. I<--async> and I<--pivot> imply
+abort mode; I<--raw> implies info mode; and if no mode was given, I<--info>
+mode is assumed.
I<path> specifies fully-qualified path of the disk; it corresponds
to a unique target name (<target dev='name'/>) or source file (<source
file='name'/>) for one of the disk devices attached to I<domain> (see
also B<domblklist> for listing these names).
-If I<--abort> is specified, the active job on the specified disk will
+In I<--abort> mode, the active job on the specified disk will
be aborted. If I<--async> is also specified, this command will return
immediately, rather than waiting for the cancellation to complete. If
I<--pivot> is specified, this requests that an active copy or active
commit job be pivoted over to the new image.
-If I<--info> is specified, the active job information on the specified
-disk will be printed.
+
+In I<--info> mode, the active job information on the specified
+disk will be printed. By default, the output is a single human-readable
+summary line; this format may change in future versions. Adding
+I<--raw> lists each field of the struct, in a stable format.
+
I<bandwidth> can be used to set bandwidth limit for the active job.
Specifying a negative value is interpreted as an unsigned long long
value or essentially unlimited. The hypervisor can choose whether to