mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
virsh: Make vshCommandOptScaledInt() use vshCommandOpt()
This aligns it to the other vshCommandOpt*() functions.
This commit is contained in:
parent
e03ef9af7c
commit
5eaca29fbb
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user