From patchwork Fri Apr 12 13:58:21 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Capitulino X-Patchwork-Id: 236110 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 4D85C2C00B4 for ; Fri, 12 Apr 2013 23:58:58 +1000 (EST) Received: from localhost ([::1]:45840 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQeVE-0007vx-Id for incoming@patchwork.ozlabs.org; Fri, 12 Apr 2013 09:58:56 -0400 Received: from eggs.gnu.org ([208.118.235.92]:53548) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQeUs-0007tk-Kt for qemu-devel@nongnu.org; Fri, 12 Apr 2013 09:58:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UQeUo-0004kZ-22 for qemu-devel@nongnu.org; Fri, 12 Apr 2013 09:58:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:27091) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQeUn-0004kL-K9 for qemu-devel@nongnu.org; Fri, 12 Apr 2013 09:58:29 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r3CDwSxJ027694 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 12 Apr 2013 09:58:28 -0400 Received: from localhost (ovpn-113-61.phx2.redhat.com [10.3.113.61]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r3CDwSIx023383; Fri, 12 Apr 2013 09:58:28 -0400 From: Luiz Capitulino To: qemu-devel@nongnu.org Date: Fri, 12 Apr 2013 09:58:21 -0400 Message-Id: <1365775103-18737-2-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1365775103-18737-1-git-send-email-lcapitulino@redhat.com> References: <1365775103-18737-1-git-send-email-lcapitulino@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: aliguori@us.ibm.com Subject: [Qemu-devel] [PULL 1/3] 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 From: 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 Reviewed-by: Eric Blake Signed-off-by: Luiz Capitulino --- qapi-schema.json | 5 ++++- vl.c | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/qapi-schema.json b/qapi-schema.json index db542f6..66808c2 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -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: diff --git a/vl.c b/vl.c index d694a90..6547b5f 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;