From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MLO0D-0001SX-Oi for qemu-devel@nongnu.org; Mon, 29 Jun 2009 17:03:01 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MLO09-0001QT-Kk for qemu-devel@nongnu.org; Mon, 29 Jun 2009 17:03:01 -0400 Received: from [199.232.76.173] (port=48298 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MLO09-0001QL-IB for qemu-devel@nongnu.org; Mon, 29 Jun 2009 17:02:57 -0400 Received: from mx2.redhat.com ([66.187.237.31]:53822) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MLO08-00053t-S5 for qemu-devel@nongnu.org; Mon, 29 Jun 2009 17:02:57 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n5TL2tvC011494 for ; Mon, 29 Jun 2009 17:02:55 -0400 Subject: Re: [Qemu-devel] [RFC PATCH] qdev: add -pcidevice command line option. References: <1246286263-27970-1-git-send-email-kraxel@redhat.com> From: Markus Armbruster Date: Mon, 29 Jun 2009 23:02:38 +0200 In-Reply-To: <1246286263-27970-1-git-send-email-kraxel@redhat.com> (Gerd Hoffmann's message of "Mon\, 29 Jun 2009 16\:37\:43 +0200") Message-ID: <877hyuda8h.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: qemu-devel@nongnu.org Gerd Hoffmann writes: > Ok, lets start to collect some low-hanging fruit we can get from the > qdev bits even at the current early state. > > ==> stop adding cmd line switches for each and every device <== > ==> do funky stuff you could not do before <== > > Here is a patch adding a generic -pcidevice command line switch. Works > only for qdev-converted devices. Works (for now) only for devices which > don't need configuration (i.e. nics don't work or maybe use vlan0 > unconditionally). Most useful with my qdev patch queue applied. > > Examples: > > -pcidevice ES1370,addr=42 (replaces -audio es1370). > -pcidevice virtio-balloon-pci (replaces -balloon). > -pcidevice lsi53c895a,addr=23 (add scsi adapter in specified slot). > -pcidevice "PIIX3 USB-UHCI" (add second usb bus). > > Comments? > > Note that we proably need a bunch of additional cleanups like killing > the -balloon switch and maybe some safety bells to stop users from doing > crazy stuff like adding a second acpi adapter. Might be the scsi > example doesn't actually work with disks due to initialization order > issues. None of this is in this RfC patch yet. > > Cc: Markus Armbruster Why limit this to PCI devices? The device name indirectly specifies the bus type. Parameter addr then specifies bus instance and device address on the bus, in a bus-specific syntax. Of course, it's perfectly fine to implement only PCI initially, but I'd rather not encode that restriction in the option name :) To extend this to devices that need configuration: what about interpreting additional parameters as qdev properties? Oh, there's a TODO in pci_device_add() that suggests exactly that.