[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v7 13/13] hmp: Add "info ppc-cpu-cores" command
From: |
Bharata B Rao |
Subject: |
[Qemu-devel] [PATCH v7 13/13] hmp: Add "info ppc-cpu-cores" command |
Date: |
Thu, 28 Jan 2016 11:19:55 +0530 |
This is the hmp equivalent of "query ppc-cpu-cores"
Signed-off-by: Bharata B Rao <address@hidden>
---
hmp-commands-info.hx | 16 ++++++++++++++++
hmp.c | 31 +++++++++++++++++++++++++++++++
hmp.h | 1 +
3 files changed, 48 insertions(+)
diff --git a/hmp-commands-info.hx b/hmp-commands-info.hx
index 9b71351..cd9a42e 100644
--- a/hmp-commands-info.hx
+++ b/hmp-commands-info.hx
@@ -786,6 +786,22 @@ STEXI
Display the value of a storage key (s390 only)
ETEXI
+#if defined(TARGET_PPC64)
+ {
+ .name = "ppc-cpu-cores",
+ .args_type = "",
+ .params = "",
+ .help = "show PowerPC CPU core devices",
+ .mhandler.cmd = hmp_info_ppc_cpu_cores,
+ },
+#endif
+
+STEXI
address@hidden info ppc-cpu-cores
address@hidden ppc-cpu-cores
+Show PowerPC CPU core devices.
+ETEXI
+
STEXI
@end table
ETEXI
diff --git a/hmp.c b/hmp.c
index 54f2620..ae75aa1 100644
--- a/hmp.c
+++ b/hmp.c
@@ -2375,3 +2375,34 @@ void hmp_rocker_of_dpa_groups(Monitor *mon, const QDict
*qdict)
qapi_free_RockerOfDpaGroupList(list);
}
+
+void hmp_info_ppc_cpu_cores(Monitor *mon, const QDict *qdict)
+{
+ Error *err = NULL;
+ PPCCPUCoreList *ppc_cpu_core_list = qmp_query_ppc_cpu_cores(&err);
+ PPCCPUCoreList *s = ppc_cpu_core_list;
+ CpuInfoList *thread;
+
+ while (s) {
+ monitor_printf(mon, "PowerPC CPU device: \"%s\"\n",
+ s->value->id ? s->value->id : "");
+ monitor_printf(mon, " hotplugged: %s\n",
+ s->value->hotplugged ? "true" : "false");
+ monitor_printf(mon, " hotpluggable: %s\n",
+ s->value->hotpluggable ? "true" : "false");
+ monitor_printf(mon, " Threads:\n");
+ for (thread = s->value->threads; thread; thread = thread->next) {
+ monitor_printf(mon, " CPU #%" PRId64 ":", thread->value->CPU);
+ monitor_printf(mon, " nip=0x%016" PRIx64,
+ thread->value->u.ppc->nip);
+ if (thread->value->halted) {
+ monitor_printf(mon, " (halted)");
+ }
+ monitor_printf(mon, " thread_id=%" PRId64 "\n",
+ thread->value->thread_id);
+ }
+ s = s->next;
+ }
+
+ qapi_free_PPCCPUCoreList(ppc_cpu_core_list);
+}
diff --git a/hmp.h b/hmp.h
index a8c5b5a..a31e3d2 100644
--- a/hmp.h
+++ b/hmp.h
@@ -131,5 +131,6 @@ void hmp_rocker(Monitor *mon, const QDict *qdict);
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_ppc_cpu_cores(Monitor *mon, const QDict *qdict);
#endif
--
2.1.0
- [Qemu-devel] [PATCH v7 06/13] cpu: Add a sync version of cpu_remove(), (continued)
- [Qemu-devel] [PATCH v7 06/13] cpu: Add a sync version of cpu_remove(), Bharata B Rao, 2016/01/28
- [Qemu-devel] [PATCH v7 07/13] xics, xics_kvm: Handle CPU unplug correctly, Bharata B Rao, 2016/01/28
- [Qemu-devel] [PATCH v7 08/13] target-ppc: Introduce PowerPC specific CPU core device, Bharata B Rao, 2016/01/28
- [Qemu-devel] [PATCH v7 10/13] spapr: CPU hotplug support, Bharata B Rao, 2016/01/28
- [Qemu-devel] [PATCH v7 09/13] spapr: Enable CPU hotplug for pseries-2.6 and add CPU DRC DT entries, Bharata B Rao, 2016/01/28
- [Qemu-devel] [PATCH v7 11/13] spapr: CPU hot unplug support, Bharata B Rao, 2016/01/28
- [Qemu-devel] [PATCH v7 12/13] qmp: Add query-ppc-cpu-cores command, Bharata B Rao, 2016/01/28
- [Qemu-devel] [PATCH v7 13/13] hmp: Add "info ppc-cpu-cores" command,
Bharata B Rao <=