[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PULL 17/18] hmp: Add 'info hotpluggable-cpus' HMP command
From: |
David Gibson |
Subject: |
[Qemu-ppc] [PULL 17/18] hmp: Add 'info hotpluggable-cpus' HMP command |
Date: |
Fri, 17 Jun 2016 16:36:38 +1000 |
From: Bharata B Rao <address@hidden>
This is the HMP equivalent for QMP query-hotpluggable-cpus.
Signed-off-by: Bharata B Rao <address@hidden>
Reviewed-by: David Gibson <address@hidden>
[dwg: Fixed problem with printf formats on 32-bit host]
Signed-off-by: David Gibson <address@hidden>
---
hmp-commands-info.hx | 14 ++++++++++++++
hmp.c | 42 ++++++++++++++++++++++++++++++++++++++++++
hmp.h | 1 +
3 files changed, 57 insertions(+)
diff --git a/hmp-commands-info.hx b/hmp-commands-info.hx
index 52539c3..7da9e6c 100644
--- a/hmp-commands-info.hx
+++ b/hmp-commands-info.hx
@@ -800,6 +800,20 @@ STEXI
Display the latest dump status.
ETEXI
+ {
+ .name = "hotpluggable-cpus",
+ .args_type = "",
+ .params = "",
+ .help = "Show information about hotpluggable CPUs",
+ .mhandler.cmd = hmp_hotpluggable_cpus,
+ },
+
+STEXI
address@hidden info hotpluggable-cpus
address@hidden hotpluggable-cpus
+Show information about hotpluggable CPUs
+ETEXI
+
STEXI
@end table
ETEXI
diff --git a/hmp.c b/hmp.c
index 30897af..997a768 100644
--- a/hmp.c
+++ b/hmp.c
@@ -2433,3 +2433,45 @@ void hmp_info_dump(Monitor *mon, const QDict *qdict)
qapi_free_DumpQueryResult(result);
}
+
+void hmp_hotpluggable_cpus(Monitor *mon, const QDict *qdict)
+{
+ Error *err = NULL;
+ HotpluggableCPUList *l = qmp_query_hotpluggable_cpus(&err);
+ HotpluggableCPUList *saved = l;
+ CpuInstanceProperties *c;
+
+ if (err != NULL) {
+ hmp_handle_error(mon, &err);
+ return;
+ }
+
+ monitor_printf(mon, "Hotpluggable CPUs:\n");
+ while (l) {
+ monitor_printf(mon, " type: \"%s\"\n", l->value->type);
+ monitor_printf(mon, " vcpus_count: \"%" PRIu64 "\"\n",
+ l->value->vcpus_count);
+ if (l->value->has_qom_path) {
+ monitor_printf(mon, " qom_path: \"%s\"\n", l->value->qom_path);
+ }
+
+ c = l->value->props;
+ monitor_printf(mon, " CPUInstance Properties:\n");
+ if (c->has_node) {
+ monitor_printf(mon, " node: \"%" PRIu64 "\"\n", c->node);
+ }
+ if (c->has_socket) {
+ monitor_printf(mon, " socket: \"%" PRIu64 "\"\n", c->socket);
+ }
+ if (c->has_core) {
+ monitor_printf(mon, " core: \"%" PRIu64 "\"\n", c->core);
+ }
+ if (c->has_thread) {
+ monitor_printf(mon, " thread: \"%" PRIu64 "\"\n", c->thread);
+ }
+
+ l = l->next;
+ }
+
+ qapi_free_HotpluggableCPUList(saved);
+}
diff --git a/hmp.h b/hmp.h
index 093d65f..f5d9749 100644
--- a/hmp.h
+++ b/hmp.h
@@ -132,5 +132,6 @@ void hmp_rocker_ports(Monitor *mon, const QDict *qdict);
void hmp_rocker_of_dpa_flows(Monitor *mon, const QDict *qdict);
void hmp_rocker_of_dpa_groups(Monitor *mon, const QDict *qdict);
void hmp_info_dump(Monitor *mon, const QDict *qdict);
+void hmp_hotpluggable_cpus(Monitor *mon, const QDict *qdict);
#endif
--
2.5.5
- [Qemu-ppc] [PULL 01/18] hw/ppc/spapr: Silence deprecation message in qtest mode, (continued)
- [Qemu-ppc] [PULL 01/18] hw/ppc/spapr: Silence deprecation message in qtest mode, David Gibson, 2016/06/17
- [Qemu-ppc] [PULL 06/18] qdev: hotplug: Introduce HotplugHandler.pre_plug() callback, David Gibson, 2016/06/17
- [Qemu-ppc] [PULL 02/18] ppc / sparc: Add a tester for checking whether OpenBIOS runs successfully, David Gibson, 2016/06/17
- [Qemu-ppc] [PULL 08/18] xics, xics_kvm: Handle CPU unplug correctly, David Gibson, 2016/06/17
- [Qemu-ppc] [PULL 04/18] vfio: Fix broken EEH, David Gibson, 2016/06/17
- [Qemu-ppc] [PULL 16/18] QMP: Add query-hotpluggable-cpus, David Gibson, 2016/06/17
- [Qemu-ppc] [PULL 11/18] spapr: Abstract CPU core device and type specific core devices, David Gibson, 2016/06/17
- [Qemu-ppc] [PULL 15/18] spapr: CPU hot unplug support, David Gibson, 2016/06/17
- [Qemu-ppc] [PULL 09/18] spapr_drc: Prevent detach racing against attach for CPU DR, David Gibson, 2016/06/17
- [Qemu-ppc] [PULL 17/18] hmp: Add 'info hotpluggable-cpus' HMP command,
David Gibson <=
- [Qemu-ppc] [PULL 05/18] target-ppc: Fix rlwimi, rlwinm, rlwnm, David Gibson, 2016/06/17
- [Qemu-ppc] [PULL 13/18] spapr: convert boot CPUs into CPU core devices, David Gibson, 2016/06/17
- [Qemu-ppc] [PULL 07/18] cpu: Abstract CPU core type, David Gibson, 2016/06/17
- [Qemu-ppc] [PULL 12/18] spapr: Move spapr_cpu_init() to spapr_cpu_core.c, David Gibson, 2016/06/17
- [Qemu-ppc] [PULL 03/18] target-ppc: Bug in BookE wait instruction, David Gibson, 2016/06/17
- [Qemu-ppc] [PULL 14/18] spapr: CPU hotplug support, David Gibson, 2016/06/17
- [Qemu-ppc] [PULL 10/18] qom: API to get instance_size of a type, David Gibson, 2016/06/17
- [Qemu-ppc] [PULL 18/18] spapr: implement query-hotpluggable-cpus callback, David Gibson, 2016/06/17
- Re: [Qemu-ppc] [PULL 00/18] ppc-for-2.7 queue 20160617, Peter Maydell, 2016/06/17