aboutsummaryrefslogtreecommitdiff
path: root/monitor.c
diff options
context:
space:
mode:
authorLuiz Capitulino <lcapitulino@redhat.com>2009-12-18 13:25:04 -0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-12-19 08:26:03 -0600
commitb6e098d79f661c7d2a631d9c6c8e119f00c3069d (patch)
treee6f4e6660f55f43f3f2a77ac81fe0e0dd9d341b9 /monitor.c
parent940489824e49f9d0cd0c989f9dc95790eb45dcaa (diff)
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>
Diffstat (limited to 'monitor.c')
-rw-r--r--monitor.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/monitor.c b/monitor.c
index a3ec65f1d9..53a4674d9d 100644
--- a/monitor.c
+++ b/monitor.c
@@ -3501,6 +3501,7 @@ static const mon_cmd_t *monitor_parse_command(Monitor *mon,
break;
case 'i':
case 'l':
+ case 'M':
{
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, "integer is for 32-bit values\n");
goto fail;
+ } else if (c == 'M') {
+ val <<= 20;
}
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 'l':
+ case 'M':
if (qobject_type(value) != QTYPE_QINT) {
qemu_error_new(QERR_INVALID_PARAMETER_TYPE, name, "int");
return -1;