Received: from eggs.gnu.org ([2001:4830:134:3::10]:50938) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aOfUf-00035s-Qr for qemu-devel@nongnu.org; Thu, 28 Jan 2016 00:51:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aOfUc-0005Nk-K2 for qemu-devel@nongnu.org; Thu, 28 Jan 2016 00:51:45 -0500 Received: from e23smtp09.au.ibm.com ([202.81.31.142]:42839) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aOfUc-0005ND-2u for qemu-devel@nongnu.org; Thu, 28 Jan 2016 00:51:42 -0500 Received: from localhost by e23smtp09.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 28 Jan 2016 15:51:39 +1000 From: Bharata B Rao Date: Thu, 28 Jan 2016 11:19:55 +0530 Message-Id: <1453960195-15181-14-git-send-email-bharata@linux.vnet.ibm.com> In-Reply-To: <1453960195-15181-1-git-send-email-bharata@linux.vnet.ibm.com> References: <1453960195-15181-1-git-send-email-bharata@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH v7 13/13] hmp: Add "info ppc-cpu-cores" command List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: mjrosato@linux.vnet.ibm.com, ehabkost@redhat.com, aik@ozlabs.ru, Bharata B Rao , mdroth@linux.vnet.ibm.com, agraf@suse.de, pbonzini@redhat.com, qemu-ppc@nongnu.org, tyreld@linux.vnet.ibm.com, nfont@linux.vnet.ibm.com, imammedo@redhat.com, afaerber@suse.de, david@gibson.dropbear.id.au This is the hmp equivalent of "query ppc-cpu-cores" Signed-off-by: Bharata B Rao --- 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 +@item info ppc-cpu-cores +@findex 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