From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=49604 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OCH9m-0006IK-4b for qemu-devel@nongnu.org; Wed, 12 May 2010 14:59:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OCH9k-0002Ea-In for qemu-devel@nongnu.org; Wed, 12 May 2010 14:59:45 -0400 Received: from mail-pv0-f173.google.com ([74.125.83.173]:53200) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OCH9k-0002ES-D7 for qemu-devel@nongnu.org; Wed, 12 May 2010 14:59:44 -0400 Received: by pvg7 with SMTP id 7so250840pvg.4 for ; Wed, 12 May 2010 11:59:43 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <1273610601-12805-2-git-send-email-kraxel@redhat.com> References: <1273610601-12805-1-git-send-email-kraxel@redhat.com> <1273610601-12805-2-git-send-email-kraxel@redhat.com> Date: Wed, 12 May 2010 21:59:43 +0300 Message-ID: Subject: Re: [Qemu-devel] [PATCH 2/2] all vga: fail graicefully when vga ports are taken From: Blue Swirl Content-Type: text/plain; charset=UTF-8 List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: qemu-devel@nongnu.org On 5/11/10, Gerd Hoffmann wrote: > Try to pci hotplug a vga card, watch qemu die with hw_error(). > This patch fixes it. > > Signed-off-by: Gerd Hoffmann > --- > 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 > > >