qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] all vga: refuse hotplugging.
@ 2010-05-26  8:43 Gerd Hoffmann
  2010-05-26 10:59 ` Stefano Stabellini
  2010-05-28 14:21 ` Paul Brook
  0 siblings, 2 replies; 9+ messages in thread
From: Gerd Hoffmann @ 2010-05-26  8:43 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gerd Hoffmann

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 |    4 ++++
 hw/vga-pci.c    |    4 ++++
 hw/vmware_vga.c |    4 ++++
 3 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/hw/cirrus_vga.c b/hw/cirrus_vga.c
index ba48289..5175725 100644
--- a/hw/cirrus_vga.c
+++ b/hw/cirrus_vga.c
@@ -3188,6 +3188,10 @@ static int pci_cirrus_vga_initfn(PCIDevice *dev)
      uint8_t *pci_conf = d->dev.config;
      int device_id = CIRRUS_ID_CLGD5446;
 
+     if (dev->qdev.hotplugged) {
+         return -1;
+     }
+
      /* 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..a2de201 100644
--- a/hw/vga-pci.c
+++ b/hw/vga-pci.c
@@ -79,6 +79,10 @@ static int pci_vga_initfn(PCIDevice *dev)
      VGACommonState *s = &d->vga;
      uint8_t *pci_conf = d->dev.config;
 
+     if (dev->qdev.hotplugged) {
+         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..d12d86f 100644
--- a/hw/vmware_vga.c
+++ b/hw/vmware_vga.c
@@ -1232,6 +1232,10 @@ static int pci_vmsvga_initfn(PCIDevice *dev)
     struct pci_vmsvga_state_s *s =
         DO_UPCAST(struct pci_vmsvga_state_s, card, dev);
 
+    if (dev->qdev.hotplugged) {
+        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

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2010-05-31  8:55 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-26  8:43 [Qemu-devel] [PATCH] all vga: refuse hotplugging Gerd Hoffmann
2010-05-26 10:59 ` Stefano Stabellini
2010-05-26 11:22   ` Gerd Hoffmann
2010-05-26 11:49     ` Stefano Stabellini
2010-05-26 12:58       ` Gerd Hoffmann
2010-05-26 13:18         ` Stefano Stabellini
2010-05-26 13:39           ` Gerd Hoffmann
2010-05-28 14:21 ` Paul Brook
2010-05-31  8:48   ` Gerd Hoffmann

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).