From: Osier Yang Date: Tue, 23 Aug 2011 06:55:23 +0000 (+0800) Subject: virsh: Print error if specified bandwidth is invalid for blockjob X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=dba7086fc3e1f6dcc6c636c251a6ce7362fcc0b6;p=libvirt.git virsh: Print error if specified bandwidth is invalid for blockjob It's strange that the command fails but without any error if one specifies as not a number. --- diff --git a/tools/virsh.c b/tools/virsh.c index 7d849ec1ad..004fe80ffb 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -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);