diff options
author | remy.noel <remy.noel@blade-group.com> | 2018-10-02 14:19:35 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2018-10-05 11:23:37 +0200 |
commit | 0ab90e617040e5590f7fc403b5d34f76f53f6bdc (patch) | |
tree | 84e0fa8c84b2d487fc5ac6303339a9163f30e974 /hw/display/vga-pci.c | |
parent | 5a358b39f52a28a84b380c1685c93010987b3412 (diff) | |
download | qemu-0ab90e617040e5590f7fc403b5d34f76f53f6bdc.zip qemu-0ab90e617040e5590f7fc403b5d34f76f53f6bdc.tar.gz qemu-0ab90e617040e5590f7fc403b5d34f76f53f6bdc.tar.bz2 |
secondary-vga: delete mmio subregions upon exit
93abfc88bd649de1933588bfc7175605331b3ea9 introduced a reference cycle in
the vga-pci devices, preventing cleanup of the object upon hotblug.
This patch allows to break the cycle.
Signed-off-by: remy.noel <remy.noel@blade-group.com>
Message-id: 20181002121935.23706-1-remy.noel@blade-group.com
[ kraxel: delete the recently added edid region too ]
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/display/vga-pci.c')
-rw-r--r-- | hw/display/vga-pci.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/hw/display/vga-pci.c b/hw/display/vga-pci.c index 24ca1b3..a17c96e 100644 --- a/hw/display/vga-pci.c +++ b/hw/display/vga-pci.c @@ -309,6 +309,14 @@ static void pci_secondary_vga_exit(PCIDevice *dev) VGACommonState *s = &d->vga; graphic_console_close(s->con); + memory_region_del_subregion(&d->mmio, &d->mrs[0]); + memory_region_del_subregion(&d->mmio, &d->mrs[1]); + if (d->flags & (1 << PCI_VGA_FLAG_ENABLE_QEXT)) { + memory_region_del_subregion(&d->mmio, &d->mrs[2]); + } + if (d->flags & (1 << PCI_VGA_FLAG_ENABLE_EDID)) { + memory_region_del_subregion(&d->mmio, &d->mrs[3]); + } } static void pci_secondary_vga_init(Object *obj) |