From: Peter Krempa Date: Fri, 19 Jun 2015 13:43:02 +0000 (+0200) Subject: virsh: blockcopy: Report error if the copy job fails X-Git-Tag: v1.2.17-rc1~78 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e7d3ff8464ed4833fa9c9bd9ef1f613f04434b31;p=thirdparty%2Flibvirt.git virsh: blockcopy: Report error if the copy job fails When the block job would fail while watching it using the "--wait" option for blockcopy, virsh would rather unhelpfully report: $ virsh blockcopy vm hdc /tmp/raw.img --granularity 4096 --verbose --wait Now in mirroring phase Add a special case when the block job vanishes while waiting for it to finish to improve the message: $ virsh blockcopy vm hdc /tmp/raw.img --granularity 8192 --verbose --wait error: Block Copy unexpectedly failed --- diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 1a124f34d5..4e890f4063 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -2312,8 +2312,11 @@ cmdBlockCopy(vshControl *ctl, const vshCmd *cmd) vshError(ctl, _("failed to query job for disk %s"), path); goto cleanup; } - if (result == 0) - break; + + if (result == 0) { + vshError(ctl, _("Block Copy unexpectedly failed")); + goto cleanup; + } if (verbose) vshPrintJobProgress(_("Block Copy"), info.end - info.cur, info.end);