Received: from eggs.gnu.org ([2001:4830:134:3::10]:59672) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YpGZH-0000t2-Ds for qemu-devel@nongnu.org; Mon, 04 May 2015 09:37:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YpGZE-0004cE-7C for qemu-devel@nongnu.org; Mon, 04 May 2015 09:37:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58152) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YpGZE-0004aB-0A for qemu-devel@nongnu.org; Mon, 04 May 2015 09:37:52 -0400 Date: Mon, 4 May 2015 10:37:02 -0300 From: Eduardo Habkost Message-ID: <20150504133702.GK17796@thinpad.lan.raisama.net> References: <1430421547-18278-1-git-send-email-ehabkost@redhat.com> <20150504114728.0dd227dd@nial.brq.redhat.com> <55474318.8090501@redhat.com> <20150504151616.1c93e84f@igors-macbook-pro.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150504151616.1c93e84f@igors-macbook-pro.local> Subject: Re: [Qemu-devel] [PATCH] cpu: Register QOM links at /machine/cpus/ List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Igor Mammedov Cc: peter.maydell@linaro.org, mimu@linux.vnet.ibm.com, agraf@suse.de, qemu-devel@nongnu.org, borntraeger@de.ibm.com, bharata@linux.vnet.ibm.com, cornelia.huck@de.ibm.com, Paolo Bonzini , Andreas =?iso-8859-1?Q?F=E4rber?= , david@gibson.dropbear.id.au On Mon, May 04, 2015 at 03:16:16PM +0200, Igor Mammedov wrote: > On Mon, 04 May 2015 11:59:52 +0200 > Paolo Bonzini wrote: > > > > > > > On 04/05/2015 11:47, Igor Mammedov wrote: > > > On Thu, 30 Apr 2015 16:19:07 -0300 > > > Eduardo Habkost wrote: > > > > > > > This will provide a predictable path for the CPU objects, and a > > > > more powerful alternative for the query-cpus QMP command, as now > > > > every QOM property on CPU objects can be easily queried. > > > > > > provided the way cpu_index is generated, path won't be > > > predictable/stable with CPU unplug. I'd rather use DEVICE->id > > > instead of cpu_index. > > > > Can we use the APIC id then? Perhaps wrapped with a CPUState-level > > method get_stable_processor_id()? > We have CPUClass->get_arch_id() which results in APIC id for > target-i386. > But I'd rather see an arbitrary DEVICE->id as index/name, that way > when -device cpu-foo,id=cpuXXX becomes functional we would have > 1:1 mapping between CLI and /machine/cpus/ view. An arbitrary device ID sounds better to me, because it allows us to change guest-visible behavior without breaking QMP client expectations. The only question is what should be the default device ID for the CPUs created by -smp and cpu-add. I was going to suggest get_arch_id(), but cpu_index may be a better candidate for the same reason above: it is truly an arbitrary ID that doesn't depend on guest-visible bits. -- Eduardo