From patchwork Mon Apr 8 10:00:35 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Novotny X-Patchwork-Id: 234891 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 CA3DD2C0097 for ; Tue, 9 Apr 2013 06:37:57 +1000 (EST) Received: from localhost ([::1]:46242 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UPIp9-0002Vf-Ug for incoming@patchwork.ozlabs.org; Mon, 08 Apr 2013 16:37:55 -0400 Received: from eggs.gnu.org ([208.118.235.92]:34369) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UPIok-0002Ua-L3 for qemu-devel@nongnu.org; Mon, 08 Apr 2013 16:37:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UPIoc-0001WH-Hr for qemu-devel@nongnu.org; Mon, 08 Apr 2013 16:37:30 -0400 Received: from ip-94-113-21-219.net.upcbroadband.cz ([94.113.21.219]:42394 helo=miglaptop.brq.redhat.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UPIoc-0001UJ-5U for qemu-devel@nongnu.org; Mon, 08 Apr 2013 16:37:22 -0400 Received: from miglaptop.brq.redhat.com (example.com [127.0.0.1]) by miglaptop.brq.redhat.com (8.14.5/8.14.5) with ESMTP id r38A0aPY010493; Mon, 8 Apr 2013 12:00:37 +0200 Received: (from mig@localhost) by miglaptop.brq.redhat.com (8.14.5/8.14.5/Submit) id r38A0Zik010492; Mon, 8 Apr 2013 12:00:35 +0200 From: Michal Novotny To: qemu-devel@nongnu.org Date: Mon, 8 Apr 2013 12:00:35 +0200 Message-Id: X-Mailer: git-send-email 1.7.11.7 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 94.113.21.219 Cc: Michal Novotny , lcapitulino@redhat.com Subject: [Qemu-devel] [PATCH] 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 This alters the query-machines QMP command to output information about maximum number of CPUs for each machine type with default value 1 in case the number of max_cpus is not set. Signed-off-by: Michal Novotny --- qapi-schema.json | 2 +- vl.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/qapi-schema.json b/qapi-schema.json index db542f6..39cae4b 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -2865,7 +2865,7 @@ ## { '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;