New cpu-max field in query-machines QMP command output

Alter the query-machines QMP command to output information about
maximum number of CPUs for each machine type with default value
set to 1 in case the number of max_cpus is not set.

Signed-off-by: Michal Novotny <minovotn@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
This commit is contained in:
Michal Novotny 2013-04-08 18:21:02 +02:00 committed by Luiz Capitulino
parent 93b48c201e
commit c72e768836
2 changed files with 5 additions and 1 deletions

View File

@ -2861,11 +2861,14 @@
#
# @default: #optional whether the machine is default
#
# @cpu-max: maximum number of CPUs supported by the machine type
# (since 1.5.0)
#
# Since: 1.2.0
##
{ 'type': 'MachineInfo',
'data': { 'name': 'str', '*alias': 'str',
'*is-default': 'bool' } }
'*is-default': 'bool', 'cpu-max': 'int' } }
##
# @query-machines:

1
vl.c
View File

@ -1617,6 +1617,7 @@ MachineInfoList *qmp_query_machines(Error **errp)
}
info->name = g_strdup(m->name);
info->cpu_max = !m->max_cpus ? 1 : m->max_cpus;
entry = g_malloc0(sizeof(*entry));
entry->value = info;