mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-24 05:25:18 +00:00
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 <lhuang@redhat.com>
This commit is contained in:
parent
53eae3e7c3
commit
390f218b83
@ -2253,9 +2253,8 @@ cmdBlockCopy(vshControl *ctl, const vshCmd *cmd)
|
|||||||
* ullong bytes/s; make sure we don't overflow */
|
* ullong bytes/s; make sure we don't overflow */
|
||||||
unsigned long long limit = MIN(ULONG_MAX, ULLONG_MAX >> 20);
|
unsigned long long limit = MIN(ULONG_MAX, ULLONG_MAX >> 20);
|
||||||
if (bandwidth > limit) {
|
if (bandwidth > limit) {
|
||||||
virReportError(VIR_ERR_OVERFLOW,
|
vshError(ctl, _("bandwidth must be less than %llu"), limit);
|
||||||
_("bandwidth must be less than %llu"),
|
goto cleanup;
|
||||||
ULLONG_MAX >> 20);
|
|
||||||
}
|
}
|
||||||
if (virTypedParameterAssign(¶ms[nparams++],
|
if (virTypedParameterAssign(¶ms[nparams++],
|
||||||
VIR_DOMAIN_BLOCK_COPY_BANDWIDTH,
|
VIR_DOMAIN_BLOCK_COPY_BANDWIDTH,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user