From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Williamson Subject: Re: [Qemu-devel] [RFC PATCH 1/5] qdev: Create qdev_get_dev_path() Date: Fri, 18 Jun 2010 09:21:10 -0600 Message-ID: <1276874470.4669.57.camel@x201> 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> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: chrisw@redhat.com, kraxel@redhat.com, kvm@vger.kernel.org, Jan Kiszka , qemu-devel@nongnu.org, avi@redhat.com, Paul Brook To: Markus Armbruster Return-path: Received: from mx1.redhat.com ([209.132.183.28]:25052 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932475Ab0FRPVY (ORCPT ); Fri, 18 Jun 2010 11:21:24 -0400 In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: 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