Received: from eggs.gnu.org ([2001:4830:134:3::10]:37525) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YpH1N-0006Fx-Rt for qemu-devel@nongnu.org; Mon, 04 May 2015 10:07:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YpH1L-0005gw-5V for qemu-devel@nongnu.org; Mon, 04 May 2015 10:06:57 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39846) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YpH1K-0005gb-TN for qemu-devel@nongnu.org; Mon, 04 May 2015 10:06:55 -0400 Date: Mon, 4 May 2015 11:05:58 -0300 From: Eduardo Habkost Message-ID: <20150504140558.GL17796@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> <554771E4.8070309@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <554771E4.8070309@redhat.com> 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: Paolo Bonzini 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, Igor Mammedov , Andreas =?iso-8859-1?Q?F=E4rber?= , david@gibson.dropbear.id.au On Mon, May 04, 2015 at 03:19:32PM +0200, Paolo Bonzini wrote: > > > On 04/05/2015 15:16, Igor Mammedov wrote: > >> > 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. > > CPUs would already be available at /machine/peripheral. I think aliases > should provide alternative indexing whenever possible---not simply > filter by device type. Could you clarify what you mean by "alternative indexing"? All I am trying to provide right now is having a predictable path for CPUs, it doesn't matter if using -device, device_add, -smp, or cpu-add. Filtering by device type is not what I need, here. If we can make the CPU QOM path predictable inside /machine/peripheral or anywhere else, that would be enough to me[1]. device IDs are predictable when using -device because they are in the command-line. And they are predictable for -smp CPUs if we use cpu_index as default ID. Making the path depend on guest-visible bits that can change depending on the architeture or machine would make the path less predictable. I have an alternative patch that simply adds a "qom-path" field to query-cpus. If we find out that making commitments about QOM paths is too hard, I can submit it instead. [1] Is there anybody or any document that can explain to me what all the containers inside /machine mean? I see /machine/peripheral, /machine/peripheral-anon, /machine/unattached, here, and I don't know what they mean. -- Eduardo