[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PULL 3/4] qapi: Report support for -device cpu hotplug in qu
From: |
David Gibson |
Subject: |
[Qemu-ppc] [PULL 3/4] qapi: Report support for -device cpu hotplug in query-machines |
Date: |
Mon, 27 Jun 2016 15:29:31 +1000 |
From: Peter Krempa <address@hidden>
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' alone is not enough as a
witness.
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 <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Igor Mammedov <address@hidden>
Signed-off-by: David Gibson <address@hidden>
---
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 84b6708..a075759 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.5.5
- [Qemu-ppc] [PULL 0/4] ppc-for-2.7 queue 20160627, David Gibson, 2016/06/27
- [Qemu-ppc] [PULL 3/4] qapi: Report support for -device cpu hotplug in query-machines,
David Gibson <=
- [Qemu-ppc] [PULL 1/4] target-ppc: ppce500_spin.c uses SPR_PIR, should use SPR_BOOKE_PIR, David Gibson, 2016/06/27
- [Qemu-ppc] [PULL 2/4] ppc/xics: Remove unused xics_set_irq_type(), David Gibson, 2016/06/27
- [Qemu-ppc] [PULL 4/4] qapi: keep names in 'CpuInstanceProperties' in sync with struct CPUCore, David Gibson, 2016/06/27
- Re: [Qemu-ppc] [PULL 0/4] ppc-for-2.7 queue 20160627, Peter Maydell, 2016/06/27