From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paul Brook Subject: Re: [Qemu-devel] Re: RFC qdev path semantics Date: Wed, 16 Jun 2010 13:21:45 +0100 Message-ID: <201006161321.46082.paul@codesourcery.com> References: <20100614054923.879.33717.stgit@localhost.localdomain> <201006161245.27789.paul@codesourcery.com> <4C18BD14.7010001@siemens.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Cc: Jan Kiszka , "chrisw@redhat.com" , "kvm@vger.kernel.org" , Markus Armbruster , Alex Williamson , "kraxel@redhat.com" , "avi@redhat.com" To: qemu-devel@nongnu.org Return-path: Received: from mail.codesourcery.com ([38.113.113.100]:55864 "EHLO mail.codesourcery.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754402Ab0FPMVw (ORCPT ); Wed, 16 Jun 2010 08:21:52 -0400 In-Reply-To: <4C18BD14.7010001@siemens.com> Sender: kvm-owner@vger.kernel.org List-ID: > > 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. Paul From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=55662 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OOrdw-00016X-M2 for qemu-devel@nongnu.org; Wed, 16 Jun 2010 08:22:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OOrcv-0003do-HQ for qemu-devel@nongnu.org; Wed, 16 Jun 2010 08:21:54 -0400 Received: from mail.codesourcery.com ([38.113.113.100]:44202) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OOrcv-0003di-5x for qemu-devel@nongnu.org; Wed, 16 Jun 2010 08:21:53 -0400 From: Paul Brook Subject: Re: [Qemu-devel] Re: RFC qdev path semantics Date: Wed, 16 Jun 2010 13:21:45 +0100 References: <20100614054923.879.33717.stgit@localhost.localdomain> <201006161245.27789.paul@codesourcery.com> <4C18BD14.7010001@siemens.com> In-Reply-To: <4C18BD14.7010001@siemens.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201006161321.46082.paul@codesourcery.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: "chrisw@redhat.com" , "kvm@vger.kernel.org" , Jan Kiszka , Markus Armbruster , Alex Williamson , "kraxel@redhat.com" , "avi@redhat.com" > > 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. Paul