From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58450) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGq02-0003p4-5O for qemu-devel@nongnu.org; Thu, 29 Jan 2015 09:23:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YGpzw-00021f-GU for qemu-devel@nongnu.org; Thu, 29 Jan 2015 09:23:13 -0500 Received: from mx1.redhat.com ([209.132.183.28]:49076) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGpzw-00021Z-9i for qemu-devel@nongnu.org; Thu, 29 Jan 2015 09:23:08 -0500 Date: Thu, 29 Jan 2015 15:21:12 +0100 From: Peter Krempa Message-ID: <20150129142112.GA1193617@andariel.home> References: <9f7bba73a1af52e5263660dccb0b2f5c0f998fa0.1421214155.git.zhugh.fnst@cn.fujitsu.com> <20150129151249.77ccd27c@nial.brq.redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="TB36FDmn/VVEgNH/" Content-Disposition: inline In-Reply-To: <20150129151249.77ccd27c@nial.brq.redhat.com> Subject: Re: [Qemu-devel] [PATCH v3 4/7] monitor: use cc->get_arch_id as the cpu index List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Igor Mammedov Cc: Zhu Guihua , qemu-devel@nongnu.org, tangchen@cn.fujitsu.com, guz.fnst@cn.fujitsu.com, isimatu.yasuaki@jp.fujitsu.com, chen.fan.fnst@cn.fujitsu.com, anshul.makkar@profitbricks.com, afaerber@suse.de --TB36FDmn/VVEgNH/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jan 29, 2015 at 15:12:49 +0100, Igor Mammedov wrote: > On Wed, 14 Jan 2015 15:27:27 +0800 > Zhu Guihua wrote: >=20 > > From: Gu Zheng > >=20 > > Use cc->get_arch_id as the cpu index to avoid the cpu index duplicated > > issue in the QMP/HMP command output. > >=20 > > Signed-off-by: Gu Zheng > > Signed-off-by: Zhu Guihua > > --- > > cpus.c | 4 +++- > > monitor.c | 4 +++- > > 2 files changed, 6 insertions(+), 2 deletions(-) > >=20 > > diff --git a/cpus.c b/cpus.c > > index 2edb5cd..d5e35c0 100644 > > --- a/cpus.c > > +++ b/cpus.c > > @@ -1420,6 +1420,7 @@ CpuInfoList *qmp_query_cpus(Error **errp) > > =20 > > CPU_FOREACH(cpu) { > > CpuInfoList *info; > > + CPUClass *cc; > > #if defined(TARGET_I386) > > X86CPU *x86_cpu =3D X86_CPU(cpu); > > CPUX86State *env =3D &x86_cpu->env; > > @@ -1437,11 +1438,12 @@ CpuInfoList *qmp_query_cpus(Error **errp) > > CPUTriCoreState *env =3D &tricore_cpu->env; > > #endif > > =20 > > + cc =3D CPU_GET_CLASS(cpu); > > cpu_synchronize_state(cpu); > > =20 > > info =3D g_malloc0(sizeof(*info)); > > info->value =3D g_malloc0(sizeof(*info->value)); > > - info->value->CPU =3D cpu->cpu_index; > > + info->value->CPU =3D cc->get_arch_id(cpu); > I'm not sure what impact sparse ID numbering would be on libvirt > CCing libvirt folks so they could check it. Libvirt is currently using only the "thread_id" field of the data returned by the query-cpus QMP command. One place where we currently treat the cpu ID space as continuous is in the CPU hotplug and unplug API, but the unplug part is currently obsolete as it uses only the very old HMP command. At any rate, changing the "CPU" field shouldn't change anything that libvirt relies on. Peter --TB36FDmn/VVEgNH/ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJUykHYAAoJEDbsFqzQGGgrvE8P/3UM6HQKhzFWFEGYJPCYXK1x DC+HvfHj7duAHZsipeay4i09tp8UJpzXLQz798HEJE2kp2UpPoz7hpMs7xS8LIhZ v05IFQb6XNYufWprBjQgmDGEDFFZhcNnXJ/RPxE2hpseu7eH22YhIXUPVAlsNvJu BAwTdSosdpWZ/prPXVSNEAO7vcvC67JCoOX0HD27ke2FTfseYOwO0HqWdXCjcOH0 g5x+sYsSUWN2rGn21TYShC1waBEfoev7uHL+H6DioghkkwqqgyxKpk8laf1rFfLu rGSNbJxGcvgFfeO5uznLFp7k0ySO7yiNLJTYc21Mgq1zlPq6ffJRO2A71wLiCRuf 6kosTAmYJd2oSyyg+Legj1uMvDtkc0f0nIaYNa1KQX674tHDdKpxDVHHgJtsjavE PNKzyiJwlDnj2Ad+Q7BJ87gSSjB3bfR2lJfp6OnXAoStU0j/FmbByOMplmBCounm c558llaao2OJ8svKdJu1TihEqehYH7f7lqDYLHEGY+h2I4bhCeF/ej5Bz/TExRFm A8FOD8Z8RK4xdbn30VLYHhID1NHbUqZcIzJmtgWFF+Bt2C61VjsYf8gAL8FwTL7Y 1dnltkNXGvLx7C0/kYeGlwlZiIqn4Dk5izYZ7XVCuypQdeaRxFIERSleaIYMfPrO 4WWTjuzQm+ODxWUq0DOZ =Brqb -----END PGP SIGNATURE----- --TB36FDmn/VVEgNH/--