From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39380) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b9nAn-0005ht-Kw for qemu-devel@nongnu.org; Mon, 06 Jun 2016 01:34:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b9nAi-0003se-Ec for qemu-devel@nongnu.org; Mon, 06 Jun 2016 01:34:00 -0400 Date: Mon, 6 Jun 2016 15:29:26 +1000 From: David Gibson Message-ID: <20160606052926.GJ9226@voom.fritz.box> References: <1463024905-28401-1-git-send-email-bharata@linux.vnet.ibm.com> <1463024905-28401-15-git-send-email-bharata@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="BOmey7/79ja+7F5w" Content-Disposition: inline In-Reply-To: <1463024905-28401-15-git-send-email-bharata@linux.vnet.ibm.com> Subject: Re: [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: Bharata B Rao Cc: qemu-devel@nongnu.org, qemu-ppc@nongnu.org, afaerber@suse.de, 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 --BOmey7/79ja+7F5w Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, May 12, 2016 at 09:18:24AM +0530, Bharata B Rao wrote: > This is the HMP equivalent for QMP query-hotpluggable-cpus. >=20 > 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(+) >=20 > 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 > =20 > + { > + .name =3D "hotpluggable-cpus", > + .args_type =3D "", > + .params =3D "", > + .help =3D "Show information about hotpluggable CPUs", > + .mhandler.cmd =3D 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 *qdic= t) > =20 > qapi_free_DumpQueryResult(result); > } > + > +void hmp_hotpluggable_cpus(Monitor *mon, const QDict *qdict) > +{ > + Error *err =3D NULL; > + HotpluggableCPUList *l =3D qmp_query_hotpluggable_cpus(&err); > + HotpluggableCPUList *saved =3D l; > + CpuInstanceProperties *c; > + > + if (err !=3D 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_pa= th); > + } > + > + c =3D 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 =3D 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 *qdic= t); > 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); > =20 > #endif --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --BOmey7/79ja+7F5w Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJXVQo2AAoJEGw4ysog2bOSFXYP/iBygYElAnLWP3tygVBKgpxy OYbmFfTZw2sCH2RAUyeWyhdRNGSkrIWCIFINwbmkF2ogeqzD10gUYkPC3rAu6a4E EEspydHyH/wD30J5mKtnXU9QJ55odrgo1z+wYBznHDkUxrXth/1ZZuVG080TQwD3 27RkBE9PxDHQ8moekF9TpNMiqy/p2HeZy7KFD7EbA8pIs7l6u4+Ps9667+E/lEQ/ pAUU35Qiv4IWS5mk3KCiThQO7Lq1gdG+dUCxFnJVjNxFK7iWHNESr1wuK8Yke58u Xn4L3UOBFcuPKVKUI8kgCO7tOkTLX1w0r3N2m8fnbfwbuqc/mULLMz4YKY9H8fFD 8CLoBPTg5iZzffqqA9Qd1aBYIPaRsaZd5kO36j1xETSAFnbB6aCcB4ioHAKLqi+5 M4x4XfpFMjJMykfT1zHTnJ0Id7RC4/IXz+sP56oO+Zx+oNNlb+V+HGwmpsowrhQY UGno6nxASMKqii+NvEdvAFZJPja2EhqbWNbkAD/NpFmkmD5DyNg6Q3UCmuFF0g1x reaVFVlSJYZFgLda5Oblo0F7ZeePNox78fXaseGHzzUkmYa2tEHsxGzTdCK+X8Nk dd0IOph+NstahcxuP8PJ/nrCO3BaKGeWMogCeH4xVBQdN7QvBLT13pQstvPIOrkv lm1F9fXhTQYifpg8aNf/ =fAiS -----END PGP SIGNATURE----- --BOmey7/79ja+7F5w--