From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50853) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGHER-0006IA-Ml for qemu-devel@nongnu.org; Thu, 23 Jun 2016 22:52:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bGHEO-00062c-DS for qemu-devel@nongnu.org; Thu, 23 Jun 2016 22:52:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35229) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGHEO-00062R-4y for qemu-devel@nongnu.org; Thu, 23 Jun 2016 22:52:32 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D294DBDEE for ; Fri, 24 Jun 2016 02:52:30 +0000 (UTC) Date: Fri, 24 Jun 2016 12:53:57 +1000 From: David Gibson Message-ID: <20160624125357.11cedead@voom.fritz.box> In-Reply-To: <20160623225418.0908a68d@igors-macbook-pro.local> References: <3b55c78a3f4f12d143ae7b42209f1900bc2c6cc2.1466713052.git.pkrempa@redhat.com> <20160623225418.0908a68d@igors-macbook-pro.local> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; boundary="Sig_/yn/3hR+XpA4.sKKUJZ4w..0"; protocol="application/pgp-signature" Subject: Re: [Qemu-devel] [PATCH 2/3] [VARIANT 1] qapi: Change 'core' to 'core-id' in 'CpuInstanceProperties' List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Igor Mammedov Cc: Peter Krempa , qemu-devel@nongnu.org --Sig_/yn/3hR+XpA4.sKKUJZ4w..0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Thu, 23 Jun 2016 22:54:18 +0200 Igor Mammedov wrote: > On Thu, 23 Jun 2016 22:23:24 +0200 > Peter Krempa wrote: >=20 > > struct CPUCore uses 'core-id' as the property name. As docs for > > query-hotpluggable-cpus state that the cpu core properties should be > > passed back to device_add by management in case new members are added > > and thus the names for the fields should be kept in sync. =20 > David also prefers core-id, > one nit pls also add -id suffix to socket and thread fields in schema > to be consistent. Heh. I wrote a patch almost identical to this yesterday, intending to post it today. So, Reviewed-by: David Gibson with the same comment as Igor about changing socket and thread to match. >=20 > >=20 > > Signed-off-by: Peter Krempa > > --- > > hmp.c | 4 ++-- > > hw/ppc/spapr.c | 4 ++-- > > include/hw/cpu/core.h | 3 +++ > > qapi-schema.json | 4 ++-- > > 4 files changed, 9 insertions(+), 6 deletions(-) > >=20 > > diff --git a/hmp.c b/hmp.c > > index 997a768..543f087 100644 > > --- a/hmp.c > > +++ b/hmp.c > > @@ -2463,8 +2463,8 @@ void hmp_hotpluggable_cpus(Monitor *mon, const > > QDict *qdict) if (c->has_socket) { > > monitor_printf(mon, " socket: \"%" PRIu64 "\"\n", > > c->socket); } > > - if (c->has_core) { > > - monitor_printf(mon, " core: \"%" PRIu64 "\"\n", > > c->core); > > + if (c->has_core_id) { > > + monitor_printf(mon, " core: \"%" PRIu64 "\"\n", > > c->core_id); } > > if (c->has_thread) { > > monitor_printf(mon, " thread: \"%" PRIu64 "\"\n", > > c->thread); diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c > > index 778fa25..0b6bb9c 100644 > > --- a/hw/ppc/spapr.c > > +++ b/hw/ppc/spapr.c > > @@ -2367,8 +2367,8 @@ static HotpluggableCPUList > > *spapr_query_hotpluggable_cpus(MachineState *machine) > >=20 > > cpu_item->type =3D spapr_get_cpu_core_type(machine->cpu_model); > > cpu_item->vcpus_count =3D smp_threads; > > - cpu_props->has_core =3D true; > > - cpu_props->core =3D i * smt; > > + cpu_props->has_core_id =3D true; > > + cpu_props->core_id =3D i * smt; > > /* TODO: add 'has_node/node' here to describe > > to which node core belongs */ > >=20 > > diff --git a/include/hw/cpu/core.h b/include/hw/cpu/core.h > > index 4540a7d..79ac79c 100644 > > --- a/include/hw/cpu/core.h > > +++ b/include/hw/cpu/core.h > > @@ -26,6 +26,9 @@ typedef struct CPUCore { > > int nr_threads; > > } CPUCore; > >=20 > > +/* Note: topology field names need to be kept in sync with > > + * 'CpuInstanceProperties' */ > > + > > #define CPU_CORE_PROP_CORE_ID "core-id" > >=20 > > #endif > > diff --git a/qapi-schema.json b/qapi-schema.json > > index 24ede28..37ef5fd 100644 > > --- a/qapi-schema.json > > +++ b/qapi-schema.json > > @@ -4271,7 +4271,7 @@ > > # > > # @node: #optional NUMA node ID the CPU belongs to > > # @socket: #optional socket number within node/board the CPU belongs > > to -# @core: #optional core number within socket the CPU belongs to > > +# @core-id: #optional core number within socket the CPU belongs to > > # @thread: #optional thread number within core the CPU belongs to > > # > > # Since: 2.7 > > @@ -4279,7 +4279,7 @@ > > { 'struct': 'CpuInstanceProperties', > > 'data': { '*node': 'int', > > '*socket': 'int', > > - '*core': 'int', > > + '*core-id': 'int', > > '*thread': 'int' > > } > > } =20 >=20 --=20 David Gibson Senior Software Engineer, Virtualization, Red Hat --Sig_/yn/3hR+XpA4.sKKUJZ4w..0 Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXbKDFAAoJEGw4ysog2bOSDxEP/1h125VLbUcEtvfmsZqSkc5+ Rg20otGSbp+JUKsnxe1QYtvDi3n5kFAKwy4n/vFjkMH8QHxyyvtKbsyUIXWww/Qp XSHVzxfN1BER6cgMgvss3ek401qxYopk+IM8NBHQ0U1jEpeo1xSFxVSvSaFo7Utp YVJ47HAs6XkZ2GrCLgdRch03hAn/SFCCa3B07H7rlaCfHCwO84HHaNltGSL+y99n urtVs97grUeIXjH/NBeRRZcgJWOIxMUHGm83bIO+79YuPrN8dXWlPpZIkwrXdkL1 8O01qXDlW8KxgCUuQU0Y96XFq6ZxOPSoOXjeVtu6tMZte+cW0sbNoWE/jUn9qoqg YsvVIJknKrIi3W8kuVo1N6yRWKI97hld+5AuifHfMBVxhGO0LTGITTof7zLg3pfM zSPAHx4RzPYXTvESCaZXYNR2EnuFnifo3jtXaji9fgWUownUFMJjWnpnX0xpjMny Q3wY9wrZIIUvsHLDfaKr0ojGvWPU7Lya/kAvw1Tsd18NSM0FGZyoPqEuTqyh3Hny LmopySJDNotZa4R0TmmkxjZiFPHTY7ONNbh8k3oUXmos0kwQ2Wl6qPX8bpyWXvXX /2LuanfIBGQUk4HZ+wik/rGJAX/AYqPSIUazW9yvBo41VMuCGgpS74b0kkhcQa72 4OY9ig9nDCRI970gqTnN =HCiX -----END PGP SIGNATURE----- --Sig_/yn/3hR+XpA4.sKKUJZ4w..0--