From: Luyao Huang Date: Fri, 27 Mar 2015 09:56:29 +0000 (+0800) Subject: virsh: blockCopy: Add missing jump on error path X-Git-Tag: v1.2.13.1~22 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4fdd4d20897dff2606cf7a584633c92347624f17;p=thirdparty%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 (cherry picked from commit 390f218b83513a00b81549eb66854d8b263cb014) --- diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 0abd1b561b..e9028adf2b 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -2250,9 +2250,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,