]> git.proxmox.com Git - qemu.git/commitdiff
New cpu-max field in query-machines QMP command output
authorMichal Novotny <minovotn@redhat.com>
Mon, 8 Apr 2013 16:21:02 +0000 (18:21 +0200)
committerLuiz Capitulino <lcapitulino@redhat.com>
Fri, 12 Apr 2013 13:41:53 +0000 (09:41 -0400)
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>
qapi-schema.json
vl.c

index db542f6692fd2c101817447f42cd3ad3455ec96a..66808c2f2719de74873f206f7f360adb5ce217a6 100644 (file)
 #
 # @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:
diff --git a/vl.c b/vl.c
index d694a9039b61b0b6b318f80ceb73264b3e49977d..6547b5fe38ab53b72b236cd45c3db797cc754c8a 100644 (file)
--- a/vl.c
+++ b/vl.c
@@ -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;