From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=35757 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oq435-0001hu-So for qemu-devel@nongnu.org; Mon, 30 Aug 2010 09:05:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Oq42x-0008TW-BZ for qemu-devel@nongnu.org; Mon, 30 Aug 2010 09:05:15 -0400 Received: from mail-yw0-f45.google.com ([209.85.213.45]:52436) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Oq42x-0008TK-8n for qemu-devel@nongnu.org; Mon, 30 Aug 2010 09:05:11 -0400 Received: by ywa6 with SMTP id 6so2349960ywa.4 for ; Mon, 30 Aug 2010 06:05:10 -0700 (PDT) Message-ID: <4C7BAB85.10604@codemonkey.ws> Date: Mon, 30 Aug 2010 08:00:53 -0500 From: Anthony Liguori MIME-Version: 1.0 References: <1283156160-4278-1-git-send-email-Jes.Sorensen@redhat.com> In-Reply-To: <1283156160-4278-1-git-send-email-Jes.Sorensen@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH v3] Do not try loading option ROM for hotplug PCI device in pc-0.11 compat mode List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jes.Sorensen@redhat.com Cc: qemu-devel@nongnu.org On 08/30/2010 03:16 AM, Jes.Sorensen@redhat.com wrote: > From: Jes Sorensen > > pc-0.11 and older uses fw_cfg to provide option ROMs. As fw_cfg is setup > at init time, it is not possible to load an option ROM for a hotplug > device when running in compat mode. > > v2: Alex Williamson pointed out that one can get to qdev directly from > pci_dev, so no need to pass it down. > > v3: Braces > What's the specific bug? The devices themselves have a check for hotplug which inhibits rom addition during hotplug so either there's a device missing this check or if we're going to go this route, we ought to remove those checks in the other devices. Regards, Anthony Liguori > Signed-off-by: Jes Sorensen > --- > hw/pci.c | 9 +++++++-- > 1 files changed, 7 insertions(+), 2 deletions(-) > > diff --git a/hw/pci.c b/hw/pci.c > index a98d6f3..a20f796 100644 > --- a/hw/pci.c > +++ b/hw/pci.c > @@ -1810,11 +1810,16 @@ static int pci_add_option_rom(PCIDevice *pdev) > return 0; > > if (!pdev->rom_bar) { > + int class; > /* > * Load rom via fw_cfg instead of creating a rom bar, > - * for 0.11 compatibility. > + * for 0.11 compatibility. fw_cfg is initialized at boot, so > + * we cannot do hotplug load of option roms. > */ > - int class = pci_get_word(pdev->config + PCI_CLASS_DEVICE); > + if (pdev->qdev.hotplugged) { > + return 0; > + } > + class = pci_get_word(pdev->config + PCI_CLASS_DEVICE); > if (class == 0x0300) { > rom_add_vga(pdev->romfile); > } else { >