From patchwork Fri Jun 10 00:59:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bharata B Rao X-Patchwork-Id: 9168731 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6E9E3604DB for ; Fri, 10 Jun 2016 01:10:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6148328364 for ; Fri, 10 Jun 2016 01:10:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 544BB28369; Fri, 10 Jun 2016 01:10:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id CA14F28364 for ; Fri, 10 Jun 2016 01:10:55 +0000 (UTC) Received: from localhost ([::1]:37851 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bBAyL-0002Ww-VR for patchwork-qemu-devel@patchwork.kernel.org; Thu, 09 Jun 2016 21:10:54 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53885) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bBAnp-0001lA-PN for qemu-devel@nongnu.org; Thu, 09 Jun 2016 21:00:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bBAnf-0008J4-2h for qemu-devel@nongnu.org; Thu, 09 Jun 2016 21:00:00 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:53670) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bBAne-0008II-RF for qemu-devel@nongnu.org; Thu, 09 Jun 2016 20:59:51 -0400 Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id u5A0x5Um129688 for ; Thu, 9 Jun 2016 20:59:50 -0400 Received: from e28smtp06.in.ibm.com (e28smtp06.in.ibm.com [125.16.236.6]) by mx0a-001b2d01.pphosted.com with ESMTP id 23e9m52697-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 09 Jun 2016 20:59:50 -0400 Received: from localhost by e28smtp06.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 10 Jun 2016 06:29:47 +0530 Received: from d28dlp03.in.ibm.com (9.184.220.128) by e28smtp06.in.ibm.com (192.168.1.136) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 10 Jun 2016 06:29:45 +0530 X-IBM-Helo: d28dlp03.in.ibm.com X-IBM-MailFrom: bharata@linux.vnet.ibm.com X-IBM-RcptTo: qemu-devel@nongnu.org;qemu-ppc@nongnu.org Received: from d28relay04.in.ibm.com (d28relay04.in.ibm.com [9.184.220.61]) by d28dlp03.in.ibm.com (Postfix) with ESMTP id 1B761125805C; Fri, 10 Jun 2016 06:32:13 +0530 (IST) Received: from d28av05.in.ibm.com (d28av05.in.ibm.com [9.184.220.67]) by d28relay04.in.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u5A0xEGO34799752; Fri, 10 Jun 2016 06:29:14 +0530 Received: from d28av05.in.ibm.com (localhost [127.0.0.1]) by d28av05.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u5A0xgHM025910; Fri, 10 Jun 2016 06:29:44 +0530 Received: from bharata.in.ibm.com ([9.79.185.199]) by d28av05.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id u5A0xCpm024706; Fri, 10 Jun 2016 06:29:41 +0530 From: Bharata B Rao To: qemu-devel@nongnu.org Date: Fri, 10 Jun 2016 06:29:07 +0530 X-Mailer: git-send-email 2.1.0 In-Reply-To: <1465520348-13964-1-git-send-email-bharata@linux.vnet.ibm.com> References: <1465520348-13964-1-git-send-email-bharata@linux.vnet.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16061000-0048-0000-0000-00000290DE81 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16061000-0049-0000-0000-00000D0EBB3D Message-Id: <1465520348-13964-9-git-send-email-bharata@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-06-09_09:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=3 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1604210000 definitions=main-1606100011 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 148.163.156.1 Subject: [Qemu-devel] [PATCH v4 8/9] hmp: Add 'info hotpluggable-cpus' HMP command X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mjrosato@linux.vnet.ibm.com, thuth@redhat.com, pkrempa@redhat.com, ehabkost@redhat.com, aik@ozlabs.ru, Bharata B Rao , agraf@suse.de, mdroth@linux.vnet.ibm.com, borntraeger@de.ibm.com, qemu-ppc@nongnu.org, pbonzini@redhat.com, imammedo@redhat.com, david@gibson.dropbear.id.au Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP This is the HMP equivalent for QMP query-hotpluggable-cpus. Signed-off-by: Bharata B Rao Reviewed-by: David Gibson --- 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 a4b1d3d..14d4712 100644 --- a/hmp.c +++ b/hmp.c @@ -2424,3 +2424,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