From: Aurelien Jarno <aurelien@aurel32.net>
To: Jes.Sorensen@redhat.com
Cc: Alex.Williamson@redhat.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] Do not try loading option ROM for hotplug PCI device in pc-0.11 compat mode
Date: Fri, 30 Jul 2010 23:08:47 +0200 [thread overview]
Message-ID: <20100730210847.GD20459@volta.aurel32.net> (raw)
In-Reply-To: <1279900598-8432-1-git-send-email-Jes.Sorensen@redhat.com>
On Fri, Jul 23, 2010 at 05:56:38PM +0200, Jes.Sorensen@redhat.com wrote:
> From: Jes Sorensen <Jes.Sorensen@redhat.com>
>
> 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.
>
> Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
> ---
> hw/pci.c | 8 ++++++--
> 1 files changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/hw/pci.c b/hw/pci.c
> index a98d6f3..2d38643 100644
> --- a/hw/pci.c
> +++ b/hw/pci.c
> @@ -1810,11 +1810,15 @@ 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;
Missing braces around the return 0 line.
> + class = pci_get_word(pdev->config + PCI_CLASS_DEVICE);
> if (class == 0x0300) {
> rom_add_vga(pdev->romfile);
> } else {
> --
> 1.7.1.1
Otherwise looks good.
--
Aurelien Jarno GPG: 1024D/F1BCDB73
aurelien@aurel32.net http://www.aurel32.net
next prev parent reply other threads:[~2010-07-30 21:08 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-23 15:56 [Qemu-devel] [PATCH] Do not try loading option ROM for hotplug PCI device in pc-0.11 compat mode Jes.Sorensen
2010-07-30 21:08 ` Aurelien Jarno [this message]
2010-07-31 9:16 ` Jes Sorensen
2010-07-31 14:19 ` Aurelien Jarno
2010-07-31 14:40 ` Jes Sorensen
2010-07-31 15:13 ` Aurelien Jarno
2010-07-31 15:21 ` Jes Sorensen
2010-07-31 15:29 ` Aurelien Jarno
-- strict thread matches above, loose matches on Subject: below --
2010-07-23 12:17 Jes.Sorensen
2010-07-23 15:37 ` Markus Armbruster
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100730210847.GD20459@volta.aurel32.net \
--to=aurelien@aurel32.net \
--cc=Alex.Williamson@redhat.com \
--cc=Jes.Sorensen@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).