Skip to contentSkip to conversation

secondary-vga: delete mmio subregions upon exit

PATCH In review [email protected] 2 participants 2 messages Oct 2, 2018 – Oct 5, 2018

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 secondary-vga: delete mmio subregions upon exit

From: "remy.noel" <[email protected]>

93abfc88bd649de1933588bfc7175605331b3ea9 introduced a reference cycle in the vga-pci devices, preventing cleanup of the object upon hotblug.

This patch allows to break the cycle.

---
 hw/display/vga-pci.c | 5 +++++
 1 file changed, 5 insertions(+)
hw/display/vga-pci.c +5 -0
index 24ca1b3e1f..a68f014c9f 100644
@@ -309,6 +309,11 @@ 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]);
+    }
 }
 
 static void pci_secondary_vga_init(Object *obj)
Signature · 1 line
2.19.0
#1 lore raw
Quoted 6 lines · On Tue, Oct 02, 2018 at 02:19:35PM +0200, [email protected] wrote:

From: "remy.noel" <[email protected]>

93abfc88bd649de1933588bfc7175605331b3ea9 introduced a reference cycle in the vga-pci devices, preventing cleanup of the object upon hotblug.

This patch allows to break the cycle.

Added to vga queue.

thanks,
Gerd