From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: Re: [Qemu-devel] Re: RFC qdev path semantics Date: Wed, 16 Jun 2010 15:50:03 +0200 Message-ID: <4C18D68B.2080302@siemens.com> References: <20100614054923.879.33717.stgit@localhost.localdomain> <201006161245.27789.paul@codesourcery.com> <4C18BD14.7010001@siemens.com> <201006161321.46082.paul@codesourcery.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 7bit Cc: "qemu-devel@nongnu.org" , "chrisw@redhat.com" , "kvm@vger.kernel.org" , Markus Armbruster , Alex Williamson , "kraxel@redhat.com" , "avi@redhat.com" To: Paul Brook Return-path: Received: from goliath.siemens.de ([192.35.17.28]:24913 "EHLO goliath.siemens.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757903Ab0FPNu0 (ORCPT ); Wed, 16 Jun 2010 09:50:26 -0400 In-Reply-To: <201006161321.46082.paul@codesourcery.com> Sender: kvm-owner@vger.kernel.org List-ID: Paul Brook wrote: >>> I think this would be better served by adding explicit aliases/IDs for >>> those use-cases. i.e. define the global ID "pci.0" to be an alias for >>> >>> /i440FX-pcihost/pci >> Makes sense. We could attach this ID to the BusState (corresponding to >> DeviceState:id) and manually set it during machine init. >> qbus_find_recursive would then look for a matching ID instead of a name. > > If we accept your proposal that global ids are not accepted as local device > identifiers, then these probably shouldn't be stored in the device tree at > all. > > Allowing at most one global ID per node also seems like a rather arbitrary > limitation. > > How about having a global alias table that maps an ID to a devtree path? > The code to handle these becomes a straight string substitution followed by a > normal path lookup. We don't need separate code for device v.s. bus, and > "global_device_id/busname" just works. No principle concerns about such a table. It should nevertheless be reference-based to assist lifetime management of aliases that are created together with the devices they point to. Jan -- Siemens AG, Corporate Technology, CT T DE IT 1 Corporate Competence Center Embedded Linux