From patchwork Mon Apr 8 16:41:10 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Novotny X-Patchwork-Id: 234840 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id ACAF92C0097 for ; Tue, 9 Apr 2013 02:41:37 +1000 (EST) Received: from localhost ([::1]:60922 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UPF8R-00037T-RX for incoming@patchwork.ozlabs.org; Mon, 08 Apr 2013 12:41:35 -0400 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 Received: from miglaptop.brq.redhat.com (dhcp-1-126.brq.redhat.com [10.34.1.126]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r38GfDi2003309; Mon, 8 Apr 2013 12:41:13 -0400 From: Michal Novotny To: qemu-devel@nongnu.org Date: Mon, 8 Apr 2013 18:41:10 +0200 Message-Id: <111bea6806c8d7e0f20856e75edba74f86a6bc9b.1365430186.git.minovotn@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Michal Novotny Subject: [Qemu-devel] [PATCH v2] New cpu-max field in query-machines QMP command output X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 Reviewed-by: Eric Blake --- 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;