From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54009) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGBA1-0005iB-2d for qemu-devel@nongnu.org; Thu, 23 Jun 2016 16:23:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bGB9y-0004ty-TG for qemu-devel@nongnu.org; Thu, 23 Jun 2016 16:23:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33197) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGB9y-0004tm-NB for qemu-devel@nongnu.org; Thu, 23 Jun 2016 16:23:34 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 246CE3B728 for ; Thu, 23 Jun 2016 20:23:34 +0000 (UTC) From: Peter Krempa Date: Thu, 23 Jun 2016 22:23:23 +0200 Message-Id: <6a52d9a67cc72abb874c9906df039d11bfe1e18d.1466713052.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: Subject: [Qemu-devel] [PATCH 1/3] qapi: Report support for -device cpu hotplug in query-machines List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Igor Mammedov , David Gibson , Peter Krempa For management apps it's very useful to know whether the selected machine type supports cpu hotplug via the new -device approach. Using the presence of 'query-hotpluggable-cpus' is enough for a withess. Add a property to 'MachineInfo' called 'hotpluggable-cpus' that will report the presence of this feature. Example of output: { "hotpluggable-cpus": false, "name": "mac99", "cpu-max": 1 }, { "hotpluggable-cpus": true, "name": "pseries-2.7", "is-default": true, "cpu-max": 255, "alias": "pseries" }, Signed-off-by: Peter Krempa --- 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 0964eec..24ede28 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -2986,11 +2986,14 @@ # @cpu-max: maximum number of CPUs supported by the machine type # (since 1.5.0) # +# @hotpluggable-cpus: cpu hotplug via -device is supported (since 2.7.0) +# # Since: 1.2.0 ## { 'struct': 'MachineInfo', 'data': { 'name': 'str', '*alias': 'str', - '*is-default': 'bool', 'cpu-max': 'int' } } + '*is-default': 'bool', 'cpu-max': 'int', + 'hotpluggable-cpus': 'bool'} } ## # @query-machines: diff --git a/vl.c b/vl.c index c85833a..4c1f9ae 100644 --- a/vl.c +++ b/vl.c @@ -1524,6 +1524,7 @@ MachineInfoList *qmp_query_machines(Error **errp) info->name = g_strdup(mc->name); info->cpu_max = !mc->max_cpus ? 1 : mc->max_cpus; + info->hotpluggable_cpus = !!mc->query_hotpluggable_cpus; entry = g_malloc0(sizeof(*entry)); entry->value = info; -- 2.8.3