From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MPN3q-0007I0-4j for qemu-devel@nongnu.org; Fri, 10 Jul 2009 16:51:14 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MPN3l-0007HJ-PA for qemu-devel@nongnu.org; Fri, 10 Jul 2009 16:51:13 -0400 Received: from [199.232.76.173] (port=59110 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MPN3l-0007HG-Iw for qemu-devel@nongnu.org; Fri, 10 Jul 2009 16:51:09 -0400 Received: from mx20.gnu.org ([199.232.41.8]:45476) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MPN3l-00019P-8k for qemu-devel@nongnu.org; Fri, 10 Jul 2009 16:51:09 -0400 Received: from mail.codesourcery.com ([65.74.133.4]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MPN3j-0005nv-L1 for qemu-devel@nongnu.org; Fri, 10 Jul 2009 16:51:08 -0400 From: Paul Brook Subject: Re: [Qemu-devel] [PATCH 04/13] qdev: add generic qdev_device_add() Date: Fri, 10 Jul 2009 21:51:03 +0100 References: <1247225179-5495-1-git-send-email-kraxel@redhat.com> <200907101823.07096.paul@codesourcery.com> <4A57A449.5000907@redhat.com> In-Reply-To: <4A57A449.5000907@redhat.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200907102151.04322.paul@codesourcery.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: qemu-devel@nongnu.org On Friday 10 July 2009, Gerd Hoffmann wrote: > On 07/10/09 19:23, Paul Brook wrote: > > On Friday 10 July 2009, Gerd Hoffmann wrote: > >> Will be used for -device command line. > > > > 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. > How about using user-specified ids to specify busses then? > >PCI example: > instead of -device $name,addr=$bus:$slot.$fn > use -device $name,bus=root,addr=$slot.$fn > >SCSI example: > host adapter: -device lsi,id=foo > scsi disk: -device scsi-disk,bus=foo,addr=$lun I was thinking something a bit more like -device lsi,bus=/i440fx/pci -device scsi-disk,bus=/i440fx/pci/lsi/scsi This example is maybe slightly unclear because the i440fx and lsi child busses happen to be called "pci" and "scsi". For devices with multiple child busses they may have different names. Adding some form of aliases may be convenient. For example the pci machine could alias "pci0" to "/i440fx/pci", which would give -device lsi,bus=pci0 -device scsi-disk,bus=pci0/lsi/scsi 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 Paul