Re: [libvirt] [PATCH] virsh: fix forget jump to clean up when set a big bandwidth

2015-03-30 Thread Peter Krempa
On Fri, Mar 27, 2015 at 17:56:29 +0800, Luyao Huang wrote:
> We already have a check for this, just add a jump to cleanup and change to 
> use vshError instead of virReportError.
> 
> Signed-off-by: Luyao Huang 
> ---
>  tools/virsh-domain.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)

I've reworded the commit message and pushed the patch.

Peter


signature.asc
Description: Digital signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] [PATCH] virsh: fix forget jump to clean up when set a big bandwidth

2015-03-27 Thread Luyao Huang
We already have a check for this, just add a jump to cleanup and change to 
use vshError instead of virReportError.

Signed-off-by: Luyao Huang 
---
 tools/virsh-domain.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index 1d8225c..33fbf9c 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,
-- 
1.8.3.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list