From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:44362) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UNSwd-0005Ry-SC for qemu-devel@nongnu.org; Wed, 03 Apr 2013 15:02:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UNSwc-00088t-H8 for qemu-devel@nongnu.org; Wed, 03 Apr 2013 15:02:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:28603) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UNSwb-00088d-Vk for qemu-devel@nongnu.org; Wed, 03 Apr 2013 15:02:02 -0400 Date: Wed, 3 Apr 2013 21:01:48 +0200 From: Igor Mammedov Message-ID: <20130403210148.6e4cea6a@thinkpad.mammed.net> In-Reply-To: <515C7359.3080202@suse.de> References: <1363876125-8264-1-git-send-email-imammedo@redhat.com> <1363876125-8264-13-git-send-email-imammedo@redhat.com> <5152D5A5.4030405@redhat.com> <20130403195800.0ba38817@thinkpad.mammed.net> <515C7359.3080202@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 12/12] target-i386: implement CPU hot-add List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Andreas =?UTF-8?B?RsOkcmJlcg==?= Cc: kwolf@redhat.com, peter.maydell@linaro.org, aliguori@us.ibm.com, yang.z.zhang@intel.com, ehabkost@redhat.com, mst@redhat.com, jan.kiszka@siemens.com, stefano.stabellini@eu.citrix.com, claudio.fontana@huawei.com, qemu-devel@nongnu.org, aderumier@odiso.com, armbru@redhat.com, blauwirbel@gmail.com, quintela@redhat.com, alex.williamson@redhat.com, kraxel@redhat.com, anthony.perard@citrix.com, Paolo Bonzini , lcapitulino@redhat.com, rth@twiddle.net On Wed, 03 Apr 2013 20:22:17 +0200 Andreas F=C3=A4rber wrote: > Am 03.04.2013 19:58, schrieb Igor Mammedov: > > On Wed, 27 Mar 2013 12:19:01 +0100 > > Paolo Bonzini wrote: > >=20 > >> Il 21/03/2013 15:28, Igor Mammedov ha scritto: > >>> + if (x86_cpu_is_cpu_exist(qdev_get_machine(), &apic_id)) { > >> > >> Similarly, can this be done in qmp_cpu_set? And should it really be an > > I've tried to abstract qmp part from target/implementation details. > > We could introduce global func like, and then use it if from QMP subsys= tem: > > bool is_cpu_exist(int64_t id) { > > ... iterate over CPUs ... > > if (cpu->get_firmware_id() =3D=3D id) > > return true; > > ... > > } > >=20 > > Andreas, Is it acceptable if I add it to qom/cpu.h, >=20 > If you make it cpu_exists() then sure, >=20 > > qom/cpu.c ? >=20 > but this is not going to work yet, you may need to place it in cpus.c > due to first_cpu and next_cpu operating on CPUArchState. I actually do recursive search on QOM tree /machine for TYPE_CPU avoiding usage of first_cpu and next_cpu. So it's abstracted from CPUArchState. >=20 > Andreas >=20 > --=20 > SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=C3=BCrnberg, Germany > GF: Jeff Hawn, Jennifer Guild, Felix Imend=C3=B6rffer; HRB 16746 AG N=C3= =BCrnberg >=20 --=20 Regards, Igor