From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46934) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bBHvk-0002Ai-Sq for qemu-devel@nongnu.org; Fri, 10 Jun 2016 04:36:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bBHvi-0004PE-G0 for qemu-devel@nongnu.org; Fri, 10 Jun 2016 04:36:39 -0400 Date: Fri, 10 Jun 2016 18:34:21 +1000 From: David Gibson Message-ID: <20160610083421.GS9226@voom.fritz.box> References: <1465520348-13964-1-git-send-email-bharata@linux.vnet.ibm.com> <1465520348-13964-9-git-send-email-bharata@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="7ufiXnXZuEWu9ktD" Content-Disposition: inline In-Reply-To: <1465520348-13964-9-git-send-email-bharata@linux.vnet.ibm.com> Subject: Re: [Qemu-devel] [PATCH v4 8/9] 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, imammedo@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 --7ufiXnXZuEWu9ktD Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jun 10, 2016 at 06:29:07AM +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 This has a compile error on 32-bit host, because qapi 'int' values are actually uint64s. I've fixed it in my tree. > --- > 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 a4b1d3d..14d4712 100644 > --- a/hmp.c > +++ b/hmp.c > @@ -2424,3 +2424,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 --7ufiXnXZuEWu9ktD Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJXWnuNAAoJEGw4ysog2bOSgTgQANxD5sEuUt4VRdmnMismuSlo q5xQ7rSGrhLKEFG4xj675zFyK/k5I8qkVMEyV7PtapKf5JrOtYuJ+DEorG7OcTuT 5lKzs868h0ga0FutZYXb5mxSZPCocK1kp56ulbLimuUEzSYgGBbupbJYTLHvmCYt EFjGP04BJR/B3fWWNV4WAxhFCaPQokGdcxhBmS29n3e0rXm7LtrXUE56xCuiqhlP 8rR5LV046e7cUhqdSIE+Apx1RmR//YdE4xSqu+iLoMnf4e1KDSeP567KTKmy2KDQ Di78en7xpRmp4KfIVahQWFivloSfvWlwqhfHDap8cRgnyHc03UH9a2OTjJ2t+U0V qIf30G9fusnGofJGSiX51Ue1r3ultsJ52tWPvGjO+Kgy+a7IzKQGeKFQhtDVyCEZ sAvNe2k/XqKEG6+bW058B929Lc6JjzYVDwBgR5ar7ynug7X/UU7U3ZT/RGi+M1K0 F4EuzxXX2EO4ZxkR5sS6LKyrG+gql8+lW43CtS+fzHoZlbTs9YZ0fdZriEXTF62o Vt7/yV65s4RNJ9iKtHVIc4m5frnrAKJb1oV5OMZBLNadJwLbn/qKgF9MUWTJUMGz eogM4or+aw9vlBy8WY5jgt9Pf4UgFXY8/BVfhN8/1EmppnKWC1ZAzXgJSwSq/Tly jEDVW4KQYBIGC9b34j/T =6ZmY -----END PGP SIGNATURE----- --7ufiXnXZuEWu9ktD--