mirror of https://github.com/xemu-project/xemu.git
monitor: Introduce 'M' argument type
This is a target long value in megabytes which should be converted to bytes. It will be used by handlers which accept a megabyte value when in "user mode". Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
940489824e
commit
b6e098d79f
|
@ -3501,6 +3501,7 @@ static const mon_cmd_t *monitor_parse_command(Monitor *mon,
|
||||||
break;
|
break;
|
||||||
case 'i':
|
case 'i':
|
||||||
case 'l':
|
case 'l':
|
||||||
|
case 'M':
|
||||||
{
|
{
|
||||||
int64_t val;
|
int64_t val;
|
||||||
|
|
||||||
|
@ -3531,6 +3532,8 @@ static const mon_cmd_t *monitor_parse_command(Monitor *mon,
|
||||||
monitor_printf(mon, "\'%s\' has failed: ", cmdname);
|
monitor_printf(mon, "\'%s\' has failed: ", cmdname);
|
||||||
monitor_printf(mon, "integer is for 32-bit values\n");
|
monitor_printf(mon, "integer is for 32-bit values\n");
|
||||||
goto fail;
|
goto fail;
|
||||||
|
} else if (c == 'M') {
|
||||||
|
val <<= 20;
|
||||||
}
|
}
|
||||||
qdict_put(qdict, key, qint_from_int(val));
|
qdict_put(qdict, key, qint_from_int(val));
|
||||||
}
|
}
|
||||||
|
@ -3935,6 +3938,7 @@ static int check_arg(const CmdArgs *cmd_args, QDict *args)
|
||||||
}
|
}
|
||||||
case 'i':
|
case 'i':
|
||||||
case 'l':
|
case 'l':
|
||||||
|
case 'M':
|
||||||
if (qobject_type(value) != QTYPE_QINT) {
|
if (qobject_type(value) != QTYPE_QINT) {
|
||||||
qemu_error_new(QERR_INVALID_PARAMETER_TYPE, name, "int");
|
qemu_error_new(QERR_INVALID_PARAMETER_TYPE, name, "int");
|
||||||
return -1;
|
return -1;
|
||||||
|
|
Loading…
Reference in New Issue