New QMP command query-cpu-max and HMP command cpu_max

These commands return the maximum number of CPUs supported by the
currently running emulator instance, as defined in its QEMUMachine
struct.

Signed-off-by: Michal Novotny <minovotn@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
This commit is contained in:
Michal Novotny 2013-03-25 17:31:33 +01:00 committed by Luiz Capitulino
parent e5ecec7bad
commit 4d700430a2
7 changed files with 56 additions and 0 deletions

8
hmp.c
View file

@ -748,6 +748,14 @@ void hmp_ringbuf_read(Monitor *mon, const QDict *qdict)
g_free(data);
}
void hmp_query_cpu_max(Monitor *mon, const QDict *qdict)
{
int cpu_max;
cpu_max = qmp_query_cpu_max(NULL);
monitor_printf(mon, "Maximum number of CPUs is %d\n", cpu_max);
}
static void hmp_cont_cb(void *opaque, int err)
{
if (!err) {