提交 0ab90e61 编写于 作者: R remy.noel 提交者: Gerd Hoffmann

secondary-vga: delete mmio subregions upon exit

93abfc88 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: Nremy.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: NGerd Hoffmann <kraxel@redhat.com>
上级 5a358b39
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册