From: Blue Swirl <blauwirbel@gmail.com>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 2/2] all vga: fail graicefully when vga ports are taken
Date: Wed, 12 May 2010 21:59:43 +0300 [thread overview]
Message-ID: <AANLkTimeUrsHWu34MF4l8-mo9M44ZU7tqQ9NJHRS5VaB@mail.gmail.com> (raw)
In-Reply-To: <1273610601-12805-2-git-send-email-kraxel@redhat.com>
On 5/11/10, Gerd Hoffmann <kraxel@redhat.com> wrote:
> Try to pci hotplug a vga card, watch qemu die with hw_error().
> This patch fixes it.
>
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> ---
> hw/cirrus_vga.c | 3 +++
> hw/vga-pci.c | 3 +++
> hw/vmware_vga.c | 3 +++
> 3 files changed, 9 insertions(+), 0 deletions(-)
>
> diff --git a/hw/cirrus_vga.c b/hw/cirrus_vga.c
> index 9f61a01..2f50e86 100644
> --- a/hw/cirrus_vga.c
> +++ b/hw/cirrus_vga.c
> @@ -3189,6 +3189,9 @@ static int pci_cirrus_vga_initfn(PCIDevice *dev)
> uint8_t *pci_conf = d->dev.config;
> int device_id = CIRRUS_ID_CLGD5446;
>
> + if (is_ioport_assigned(0x3c0))
> + return -1;
> +
-ECODING_STYLE.
> /* setup VGA */
> vga_common_init(&s->vga, VGA_RAM_SIZE);
> cirrus_init_common(s, device_id, 1);
> diff --git a/hw/vga-pci.c b/hw/vga-pci.c
> index c8d260c..2ef3278 100644
> --- a/hw/vga-pci.c
> +++ b/hw/vga-pci.c
> @@ -79,6 +79,9 @@ static int pci_vga_initfn(PCIDevice *dev)
> VGACommonState *s = &d->vga;
> uint8_t *pci_conf = d->dev.config;
>
> + if (is_ioport_assigned(0x3c0))
> + return -1;
> +
> // vga + console init
> vga_common_init(s, VGA_RAM_SIZE);
> vga_init(s);
> diff --git a/hw/vmware_vga.c b/hw/vmware_vga.c
> index 4e7a75d..cd0eb57 100644
> --- a/hw/vmware_vga.c
> +++ b/hw/vmware_vga.c
> @@ -1232,6 +1232,9 @@ static int pci_vmsvga_initfn(PCIDevice *dev)
> struct pci_vmsvga_state_s *s =
> DO_UPCAST(struct pci_vmsvga_state_s, card, dev);
>
> + if (is_ioport_assigned(0x3c0))
> + return -1;
> +
> pci_config_set_vendor_id(s->card.config, PCI_VENDOR_ID_VMWARE);
> pci_config_set_device_id(s->card.config, SVGA_PCI_DEVICE_ID);
> s->card.config[PCI_COMMAND] = PCI_COMMAND_IO |
>
> --
> 1.6.6.1
>
>
>
next prev parent reply other threads:[~2010-05-12 18:59 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-11 20:43 [Qemu-devel] [PATCH 1/2] ioport: add function to check whenever a port is assigned or not Gerd Hoffmann
2010-05-11 20:43 ` [Qemu-devel] [PATCH 2/2] all vga: fail graicefully when vga ports are taken Gerd Hoffmann
2010-05-12 18:59 ` Blue Swirl [this message]
2010-05-18 12:33 ` Markus Armbruster
2010-05-18 12:45 ` Gerd Hoffmann
2010-05-18 14:06 ` Markus Armbruster
-- strict thread matches above, loose matches on Subject: below --
2010-05-19 9:54 [Qemu-devel] [PATCH 1/2] ioport: add function to check whenever a port is assigned or not Gerd Hoffmann
2010-05-19 9:54 ` [Qemu-devel] [PATCH 2/2] all vga: fail graicefully when vga ports are taken Gerd Hoffmann
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=AANLkTimeUrsHWu34MF4l8-mo9M44ZU7tqQ9NJHRS5VaB@mail.gmail.com \
--to=blauwirbel@gmail.com \
--cc=kraxel@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).