From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:50068) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SBmGK-0005qD-7b for qemu-devel@nongnu.org; Sun, 25 Mar 2012 08:09:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SBmGI-0005NK-Eh for qemu-devel@nongnu.org; Sun, 25 Mar 2012 08:09:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40268) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SBmGI-0005ND-6u for qemu-devel@nongnu.org; Sun, 25 Mar 2012 08:09:30 -0400 Message-ID: <4F6F0AEB.5030504@redhat.com> Date: Sun, 25 Mar 2012 14:09:15 +0200 From: Avi Kivity MIME-Version: 1.0 References: <5071f24e827d5948ed3de7f53991b148b4ef38e9.1332430835.git.julien.grall@citrix.com> <4F6B847C.8080402@codemonkey.ws> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [QEMU][RFC PATCH 4/6] xen-pci: Register PCI in Xen List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefano Stabellini Cc: "Julien Grall (Intern)" , "xen-devel@lists.xensource.com" , "qemu-devel@nongnu.org" , Anthony Liguori , Julian Pidancet On 03/23/2012 01:02 PM, Stefano Stabellini wrote: > Maybe the best thing to do is to have a set of machine specific options > to select what devices need to be built in the machine. > Most devices already can be dynamically selected: NICs, usb, acpi, > cirrus, etc. > We already have a Xen machine (xenfv_machine) that uses pc_init1 to > initialize it. > We could have a simple bitmask to determine what devices need to be > enabled, then in pc_init1 we could have something like: > > if (devices & VGA_ENABLE) { > pc_vga_init(); > } > > Given the number of enable variable already present in the code > (pci_enabled, acpi_enabled, usb_enabled, xen_enabled, > cirrus_vga_enabled, ...), it might end up actually making the code more > readable. The flexibility could end up being useful in the generic case > as well, for testing if nothing else. > > We would still need to call xc_hvm_register_pcidev to register PCI > devices in Xen, but we wouldn't expect to fail unless there was a > misconfiguration somewhere. In that case we could just exit. > > > > Now the problem is: there isn't a simple way to specify the BDF where > you want to create the device; pci_create_simple takes a devfn but most > of the higher level functions (pc_vga_init, pci_nic_init_nofail, ...) > don't export the parameter at the moment. > We would need to be able to tell pc_vga_init where to create the card, > so we would have to export the devfn as a parameter. > You already have total flexibility with the -device foo parameter. It allows you to create any device, anywhere, with whatever configuration you want. Use in conjunction with -nodefconfig. You may want your own host/pci bridge that lacks the device 0 configuration space. -- error compiling committee.c: too many arguments to function