]> xenbits.xensource.com Git - libvirt.git/commitdiff
virsh: Print error if specified bandwidth is invalid for blockjob
authorOsier Yang <jyang@redhat.com>
Tue, 23 Aug 2011 06:55:23 +0000 (14:55 +0800)
committerOsier Yang <jyang@redhat.com>
Tue, 23 Aug 2011 06:55:23 +0000 (14:55 +0800)
It's strange that the command fails but without any error if one
specifies as not a number.

tools/virsh.c

index 7d849ec1adfcb328ceeb76fa9bea37cfaec2870f..004fe80ffb5b3cd688e85064d0dab464139cd26a 100644 (file)
@@ -5209,8 +5209,10 @@ blockJobImpl(vshControl *ctl, const vshCmd *cmd,
     if (vshCommandOptString(cmd, "path", &path) < 0)
         goto out;
 
-    if (vshCommandOptUL(cmd, "bandwidth", &bandwidth) < 0)
+    if (vshCommandOptUL(cmd, "bandwidth", &bandwidth) < 0) {
+        vshError(ctl, "%s", _("bandwidth must be a number"));
         goto out;
+    }
 
     if (mode == VSH_CMD_BLOCK_JOB_ABORT)
         ret = virDomainBlockJobAbort(dom, path, 0);