From dba7086fc3e1f6dcc6c636c251a6ce7362fcc0b6 Mon Sep 17 00:00:00 2001 From: Osier Yang Date: Tue, 23 Aug 2011 14:55:23 +0800 Subject: [PATCH] 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. --- tools/virsh.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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);