From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NLMwA-0004ib-DU for qemu-devel@nongnu.org; Thu, 17 Dec 2009 15:27:02 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NLMw5-0004f8-J0 for qemu-devel@nongnu.org; Thu, 17 Dec 2009 15:27:01 -0500 Received: from [199.232.76.173] (port=57402 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NLMw5-0004f4-DT for qemu-devel@nongnu.org; Thu, 17 Dec 2009 15:26:57 -0500 Received: from mail-yw0-f171.google.com ([209.85.211.171]:40428) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NLMw0-0000ch-Pm for qemu-devel@nongnu.org; Thu, 17 Dec 2009 15:26:57 -0500 Received: by ywh1 with SMTP id 1so2297689ywh.18 for ; Thu, 17 Dec 2009 12:25:10 -0800 (PST) Message-ID: <4B2A920C.1060506@codemonkey.ws> Date: Thu, 17 Dec 2009 14:18:20 -0600 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 3/6] pci romfiles: add property, add default to PCIDeviceInfo References: <1261053168-8079-1-git-send-email-kraxel@redhat.com> <1261053168-8079-4-git-send-email-kraxel@redhat.com> In-Reply-To: <1261053168-8079-4-git-send-email-kraxel@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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 wrote: > This patch adds a romfile property to the pci bus. It allows to specify > a romfile to load into the rom bar of the pci device. The default value > comes from a new field in PCIDeviceInfo. The property allows to change > the file and also to disable the rom loading using an empty string. > > Signed-off-by: Gerd Hoffmann > --- > hw/cirrus_vga.c | 4 +--- > hw/e1000.c | 9 +-------- > hw/pci.c | 24 +++++++++++++++++++++--- > hw/pci.h | 6 ++++-- > hw/rtl8139.c | 9 +-------- > hw/virtio-pci.c | 9 +-------- > 6 files changed, 29 insertions(+), 32 deletions(-) > > diff --git a/hw/cirrus_vga.c b/hw/cirrus_vga.c > index b08d2ae..6fe433d 100644 > --- a/hw/cirrus_vga.c > +++ b/hw/cirrus_vga.c > @@ -3209,9 +3209,6 @@ static int pci_cirrus_vga_initfn(PCIDevice *dev) > pci_register_bar((PCIDevice *)d, 1, CIRRUS_PNPMMIO_SIZE, > PCI_BASE_ADDRESS_SPACE_MEMORY, cirrus_pci_mmio_map); > } > - > - /* ROM BIOS */ > - pci_add_option_rom((PCIDevice *)d, VGABIOS_CIRRUS_FILENAME); > return 0; > } > > @@ -3226,6 +3223,7 @@ static PCIDeviceInfo cirrus_vga_info = { > .qdev.size = sizeof(PCICirrusVGAState), > .qdev.vmsd = &vmstate_pci_cirrus_vga, > .init = pci_cirrus_vga_initfn, > + .romfile = VGABIOS_CIRRUS_FILENAME, > .config_write = pci_cirrus_write_config, > }; > Really nice example of qdev in action. Very nice cleanup! Regards, Anthony Liguori