From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=48371 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OPdNn-00057E-Kc for qemu-devel@nongnu.org; Fri, 18 Jun 2010 11:21:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OPdNi-0001Zb-Hw for qemu-devel@nongnu.org; Fri, 18 Jun 2010 11:21:27 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51386) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OPdNi-0001ZF-9E for qemu-devel@nongnu.org; Fri, 18 Jun 2010 11:21:22 -0400 Subject: Re: [Qemu-devel] [RFC PATCH 1/5] qdev: Create qdev_get_dev_path() From: Alex Williamson In-Reply-To: References: <20100614054923.879.33717.stgit@localhost.localdomain> <4C17492A.4050207@siemens.com> <201006151228.03533.paul@codesourcery.com> <1276635192.12015.901.camel@x201> <1276813540.3216.52.camel@x201> Content-Type: text/plain; charset="UTF-8" Date: Fri, 18 Jun 2010 09:21:10 -0600 Message-ID: <1276874470.4669.57.camel@x201> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: chrisw@redhat.com, kvm@vger.kernel.org, Jan Kiszka , Paul Brook , qemu-devel@nongnu.org, avi@redhat.com, kraxel@redhat.com On Fri, 2010-06-18 at 16:03 +0200, Markus Armbruster wrote: > Alex Williamson writes: > > On Wed, 2010-06-16 at 10:23 +0200, Markus Armbruster wrote: > >> Alex Williamson writes: > >> > > >> > (A): /i440FX-pcihost/pci.0/e1000.05.0 > >> > > >> > vs > >> > > >> > (B): /pci.0/05.0 > >> > > >> > (removing both the root bridge driver name and the device driver name) > >> > >> / is the main system bus. System bus defines no bus address at the > >> moment. Therefore, you have to use the driver name i440FX-pcihost. > > > > So is the general rule "If a device's parent bus does not provide an > > address, print device name"? > > I think the general rule for constructing a *canonical* qdev path should > be: > > * If it's the main system bus, the path is /. > > * If it's another bus, the path is P/B, where P is the canonical path of > the device providing the bus, and B is the bus name. Unambiguous, > since no device ever defines two buses with the same name. > > * If it's a device, the path is P/D, where P is the canonical path of > the bus. If the bus defines bus addresses, then D is @A, where A is > the device's bus address. > > We haven't made up our minds whether the else case exists, or what to > do if it does. The simple "else D is the device model driver's name" > works only if the bus can't take multiple device models with the same > driver. It certainly exists today, so do we make up bus addresses, do we use driver name + instance number, or ...? Both of these cases need to make sure they're not artificially imposing a creation order than we can't guarantee across migration. Hopefully Paul has a better suggestion than creation order. > The canonical path is not the only path. For instance, a qdev ID is a > valid path, but it's not canonical. /i440FX-pcihost/pci.0/e1000 is > another valid, non-canonical path. Is it not canonical because of "e1000" or because or "i440FX-pcihost". It seems like both to me with the nuance that i440FX-pcihost doesn't support multiple instances, so we know which one it is. Is the correct canonical path for this then: //pci.0/@d.f How do we make progress on defining that TBD and all the ones under isa buses? Thanks, Alex