From: Luyao Huang Date: Fri, 27 Mar 2015 09:56:29 +0000 (+0800) Subject: virsh: blockCopy: Add missing jump on error path X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=390f218b83513a00b81549eb66854d8b263cb014;p=people%2Fliuw%2Flibxenctrl-split%2Flibvirt.git virsh: blockCopy: Add missing jump on error path The overflow check for the bandwidth parameter did not jump to the cleanup label. Additionally virsh should use vshError instead of virReportError. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1206987 Signed-off-by: Luyao Huang --- diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index b39f4b68e..9bbb964c5 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -2253,9 +2253,8 @@ cmdBlockCopy(vshControl *ctl, const vshCmd *cmd) * ullong bytes/s; make sure we don't overflow */ unsigned long long limit = MIN(ULONG_MAX, ULLONG_MAX >> 20); if (bandwidth > limit) { - virReportError(VIR_ERR_OVERFLOW, - _("bandwidth must be less than %llu"), - ULLONG_MAX >> 20); + vshError(ctl, _("bandwidth must be less than %llu"), limit); + goto cleanup; } if (virTypedParameterAssign(¶ms[nparams++], VIR_DOMAIN_BLOCK_COPY_BANDWIDTH,