diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2010-05-11 22:28:44 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2010-08-04 15:32:44 +0200 |
commit | 94213a333e35e6aa5095044ef54f64792c2d0303 (patch) | |
tree | 9903ade2cc68810fabee0af3ea815848d84db17a | |
parent | 5e14bcd5a6c24ca65da71400c9f5d86ae3b1c5e1 (diff) |
all vga: refuse hotplugging.
Try to pci hotplug a vga card, watch qemu die with hw_error().
This patch fixes it.
-rw-r--r-- | hw/cirrus_vga.c | 4 | ||||
-rw-r--r-- | hw/vga-pci.c | 4 | ||||
-rw-r--r-- | 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 bbd4b082d..62296c017 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 eef0e3c73..84467074e 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 682f28777..7ff89aa74 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); pci_config_set_class(s->card.config, PCI_CLASS_DISPLAY_VGA); |