From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MQtKk-0001Qy-J8 for qemu-devel@nongnu.org; Tue, 14 Jul 2009 21:30:58 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MQtKg-0001Ol-5N for qemu-devel@nongnu.org; Tue, 14 Jul 2009 21:30:58 -0400 Received: from [199.232.76.173] (port=43408 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MQtKf-0001Oc-Vd for qemu-devel@nongnu.org; Tue, 14 Jul 2009 21:30:54 -0400 Received: from mx2.redhat.com ([66.187.237.31]:56887) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MQtKf-0001fL-I7 for qemu-devel@nongnu.org; Tue, 14 Jul 2009 21:30:53 -0400 Subject: Re: [Qemu-devel] [PATCH 04/13] qdev: add generic qdev_device_add() References: <1247225179-5495-1-git-send-email-kraxel@redhat.com> <200907101823.07096.paul@codesourcery.com> <4A57A449.5000907@redhat.com> <200907102151.04322.paul@codesourcery.com> <4A5C3689.3070001@redhat.com> <87vdluhlut.fsf@pike.pond.sub.org> From: Markus Armbruster Date: Wed, 15 Jul 2009 03:28:47 +0200 In-Reply-To: <87vdluhlut.fsf@pike.pond.sub.org> (Markus Armbruster's message of "Wed\, 15 Jul 2009 01\:43\:22 +0200") Message-ID: <87d482hgz4.fsf@pike.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: Paul Brook , qemu-devel@nongnu.org Markus Armbruster writes: > Gerd Hoffmann writes: > >> On 07/10/09 22:51, Paul Brook wrote: >>>>> I think this is going in the wrong direction. The device tree provides us >>>>> with a standard way of identifying which bus to add a device to. We >>>>> should be removing uses of pci_create, not adding new ones. >>>> Why? >>>> >>>> Let me guess: Because pci bus numbers are guest-changeable and thus not >>>> stable? >>> >>> Because I don't think this code need to be bus specific. >> >> Parts of the problem are certainly bus-specific though, such as >> parsing bus addresses. > > Yes. > > Provide a bus method to parse the addr property? > >>> We also need to figure out the naming of multiple similar devices on the same >>> bus. Possibly your "device id" could be used to identify devices on a bus. >>> e.g. if we wanted two scsi adapters: >>> >>> -device lsi,bus=pci0,id=foo >>> -device lsi,bus=pci0,id=bar >>> -device scsi-disk,bus=pci0/foo/scsi >>> -device scsi-disk,bus=pci0/bar/scsi > > Why foo/scsi? Is there a node "scsi" between the lsi device and the > disk? If yes, why? Got it: because qdev distinguishes between device nodes and bus nodes, there is a scsi bus node between the lsi device node and the scsi-disk device node.