]> Git Repo - qemu.git/commitdiff
serial-pci: remove memory regions from BAR before destroying them
authorPaolo Bonzini <[email protected]>
Wed, 25 Jun 2014 18:21:37 +0000 (20:21 +0200)
committerPaolo Bonzini <[email protected]>
Mon, 14 Jul 2014 14:14:15 +0000 (16:14 +0200)
Otherwise, hot-unplug of pci-serial-2x trips the assertion
in memory_region_destroy:

    (qemu) device_del gg
    (qemu) qemu-system-x86_64: /work/armbru/tmp/qemu/memory.c:1021: memory_region_destroy: Assertion `((&mr->subregions)->tqh_first == ((void *)0))' failed.
    Aborted (core dumped)

Reported-by: Markus Armbruster <[email protected]>
Reviewed-by: Markus Armbruster <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
hw/char/serial-pci.c

index f53bb9c5d09c5497f5097d6e8727dc130a0e612f..c133c33e7ac7589307ed67cc1b7effdd7e6f011e 100644 (file)
@@ -148,6 +148,7 @@ static void multi_serial_pci_exit(PCIDevice *dev)
     for (i = 0; i < pci->ports; i++) {
         s = pci->state + i;
         serial_exit_core(s);
+        memory_region_del_subregion(&pci->iobar, &s->io);
         memory_region_destroy(&s->io);
         g_free(pci->name[i]);
     }
This page took 0.025026 seconds and 4 git commands to generate.