From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:50705) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UPF8C-00037H-DQ for qemu-devel@nongnu.org; Mon, 08 Apr 2013 12:41:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UPF87-00083L-Nm for qemu-devel@nongnu.org; Mon, 08 Apr 2013 12:41:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:15477) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UPF87-000836-GN for qemu-devel@nongnu.org; Mon, 08 Apr 2013 12:41:15 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r38GfEI9007910 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 8 Apr 2013 12:41:14 -0400 From: Michal Novotny Date: Mon, 8 Apr 2013 18:41:10 +0200 Message-Id: <111bea6806c8d7e0f20856e75edba74f86a6bc9b.1365430186.git.minovotn@redhat.com> Subject: [Qemu-devel] [PATCH v2] New cpu-max field in query-machines QMP command output List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Michal Novotny 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 --- qapi-schema.json | 4 +++- vl.c | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/qapi-schema.json b/qapi-schema.json index db542f6..689ca8d 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -2861,11 +2861,13 @@ # # @default: #optional whether the machine is default # +# @cpu-max: maximum number of CPUs supported by the machine type +# # 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 a8bba04..c05b3d3 100644 --- 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; -- 1.7.11.7