提交 4fdd4d20 编写于 作者: L Luyao Huang 提交者: Cole Robinson

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=1206987Signed-off-by: NLuyao Huang <lhuang@redhat.com>
(cherry picked from commit 390f218b)
上级 52ef86af
......@@ -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(&params[nparams++],
VIR_DOMAIN_BLOCK_COPY_BANDWIDTH,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册