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.
This commit is contained in:
Osier Yang 2011-08-23 14:55:23 +08:00
parent 9f5afc732c
commit dba7086fc3

View 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);