},
{.name = "timeout",
.type = VSH_OT_INT,
- .help = N_("with --wait, abort if copy exceeds timeout (in seconds)")
+ .help = N_("implies --wait, abort if copy exceeds timeout (in seconds)")
},
{.name = "pivot",
.type = VSH_OT_BOOL,
- .help = N_("with --wait, pivot when mirroring starts")
+ .help = N_("implies --wait, pivot when mirroring starts")
},
{.name = "finish",
.type = VSH_OT_BOOL,
- .help = N_("with --wait, quit when mirroring starts")
+ .help = N_("implies --wait, quit when mirroring starts")
},
{.name = "async",
.type = VSH_OT_BOOL,
bool quit = false;
int abort_flags = 0;
+ blocking |= vshCommandOptBool(cmd, "timeout") || pivot || finish;
if (blocking) {
if (pivot && finish) {
vshError(ctl, "%s", _("cannot mix --pivot and --finish"));
sigaction(SIGINT, &sig_action, &old_sig_action);
GETTIMEOFDAY(&start);
- } else if (verbose || vshCommandOptBool(cmd, "timeout") ||
- vshCommandOptBool(cmd, "async") || pivot || finish) {
+ } else if (verbose || vshCommandOptBool(cmd, "async")) {
vshError(ctl, "%s", _("missing --wait option"));
return false;
}
vshError(ctl, _("failed to finish job for disk %s"), path);
goto cleanup;
}
- vshPrint(ctl, "\n%s",
- quit ? _("Copy aborted") :
- pivot ? _("Successfully pivoted") :
- finish ? _("Successfully copied") :
- _("Now in mirroring phase"));
+ if (quit)
+ vshPrint(ctl, "\n%s", _("Copy aborted"));
+ else if (pivot)
+ vshPrint(ctl, "\n%s", _("Successfully pivoted"));
+ else if (finish)
+ vshPrint(ctl, "\n%s", _("Successfully copied"));
+ else
+ vshPrint(ctl, "\n%s", _("Now in mirroring phase"));
ret = true;
cleanup:
qemu, it may be non-zero only for an online domain.
=item B<blockcopy> I<domain> I<path> I<dest> [I<bandwidth>] [I<--shallow>]
-[I<--reuse-external>] [I<--raw>] [I<--wait> [I<--verbose>]
-[{I<--pivot> | I<--finish>}] [I<--timeout> B<seconds>] [I<--async>]]
+[I<--reuse-external>] [I<--raw>] [I<--wait> [I<--async>] [I<--verbose>]]
+[{I<--pivot> | I<--finish>}] [I<--timeout> B<seconds>]
Copy a disk backing image chain to I<dest>. By default, this command
flattens the entire chain; but if I<--shallow> is specified, the copy
then this command will block until the mirroring phase begins, or cancel
the operation if the optional I<timeout> in seconds elapses or SIGINT is
sent (usually with C<Ctrl-C>). Using I<--verbose> along with I<--wait>
-will produce periodic status updates. Using I<--pivot> or I<--finish>
-along with I<--wait> will additionally end the job cleanly rather than
-leaving things in the mirroring phase. If job cancellation is triggered,
-I<--async> will return control to the user as fast as possible, otherwise
-the command may continue to block a little while longer until the job
-is done cleaning up.
+will produce periodic status updates. Using I<--pivot> (similar to
+B<blockjob> I<--pivot>) or I<--finish> (similar to B<blockjob> I<--abort>)
+implies I<--wait>, and will additionally end the job cleanly rather than
+leaving things in the mirroring phase. If job cancellation is triggered
+by timeout or by I<--finish>, I<--async> will return control to the user
+as fast as possible, otherwise the command may continue to block a little
+while longer until the job has actually cancelled.
I<path> specifies fully-qualified path of the disk.
I<bandwidth> specifies copying bandwidth limit in MiB/s.