提交 5eaca29f 编写于 作者: A Andrea Bolognani 提交者: John Ferlan

virsh: Make vshCommandOptScaledInt() use vshCommandOpt()

This aligns it to the other vshCommandOpt*() functions.
上级 e03ef9af
......@@ -1804,16 +1804,16 @@ vshCommandOptScaledInt(const vshCmd *cmd, const char *name,
unsigned long long *value, int scale,
unsigned long long max)
{
const char *str;
int ret;
vshCmdOpt *arg;
char *end;
int ret;
ret = vshCommandOptString(cmd, name, &str);
if (ret <= 0)
if ((ret = vshCommandOpt(cmd, name, &arg, true)) <= 0)
return ret;
if (virStrToLong_ullp(str, &end, 10, value) < 0 ||
if (virStrToLong_ullp(arg->data, &end, 10, value) < 0 ||
virScaleInteger(value, end, scale, max) < 0)
return -1;
return 1;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册