From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50475) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b0i65-0007rj-5w for qemu-devel@nongnu.org; Thu, 12 May 2016 00:19:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b0i5u-0000q8-RG for qemu-devel@nongnu.org; Thu, 12 May 2016 00:19:36 -0400 Received: from e28smtp04.in.ibm.com ([125.16.236.4]:40416) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b0i5u-0000od-56 for qemu-devel@nongnu.org; Thu, 12 May 2016 00:19:26 -0400 Received: from localhost by e28smtp04.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 12 May 2016 09:19:09 +0530 From: Bharata B Rao Date: Thu, 12 May 2016 09:18:24 +0530 Message-Id: <1463024905-28401-15-git-send-email-bharata@linux.vnet.ibm.com> In-Reply-To: <1463024905-28401-1-git-send-email-bharata@linux.vnet.ibm.com> References: <1463024905-28401-1-git-send-email-bharata@linux.vnet.ibm.com> Subject: [Qemu-devel] [for-2.7 PATCH v3 14/15] hmp: Add 'info hotpluggable-cpus' HMP command List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, afaerber@suse.de, david@gibson.dropbear.id.au, imammedo@redhat.com, armbru@redhat.com, thuth@redhat.com, aik@ozlabs.ru, agraf@suse.de, pbonzini@redhat.com, ehabkost@redhat.com, pkrempa@redhat.com, mdroth@linux.vnet.ibm.com, eblake@redhat.com, mjrosato@linux.vnet.ibm.com, borntraeger@de.ibm.com, Bharata B Rao This is the HMP equivalent for QMP query-hotpluggable-cpus. Signed-off-by: Bharata B Rao --- hmp-commands-info.hx | 14 ++++++++++++++ hmp.c | 41 +++++++++++++++++++++++++++++++++++++++++ hmp.h | 1 + 3 files changed, 56 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 +@item info hotpluggable-cpus +@findex hotpluggable-cpus +Show information about hotpluggable CPUs +ETEXI + STEXI @end table ETEXI diff --git a/hmp.c b/hmp.c index d510236..6480ae7 100644 --- a/hmp.c +++ b/hmp.c @@ -2381,3 +2381,44 @@ 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: \"%ld\"\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: \"%ld\"\n", c->node); + } + if (c->has_socket) { + monitor_printf(mon, " socket: \"%ld\"\n", c->socket); + } + if (c->has_core) { + monitor_printf(mon, " core: \"%ld\"\n", c->core); + } + if (c->has_thread) { + monitor_printf(mon, " thread: \"%ld\"\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.1.0