qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] serial-pci: remove memory regions from BAR before destroying them
@ 2014-06-25 18:21 Paolo Bonzini
  2014-06-26  7:32 ` Markus Armbruster
  0 siblings, 1 reply; 9+ messages in thread
From: Paolo Bonzini @ 2014-06-25 18:21 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, kraxel, armbru

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 <armbru@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/char/serial-pci.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/char/serial-pci.c b/hw/char/serial-pci.c
index 6c25296..7340c8d 100644
--- a/hw/char/serial-pci.c
+++ b/hw/char/serial-pci.c
@@ -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]);
     }
-- 
1.9.3

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-07-15  8:40 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-25 18:21 [Qemu-devel] [PATCH] serial-pci: remove memory regions from BAR before destroying them Paolo Bonzini
2014-06-26  7:32 ` Markus Armbruster
2014-06-26 10:08   ` Paolo Bonzini
2014-07-14 12:36   ` Peter Crosthwaite
2014-07-14 14:20     ` Paolo Bonzini
2014-07-14 14:28       ` Peter Crosthwaite
2014-07-14 15:25     ` Markus Armbruster
2014-07-15  8:35       ` Gerd Hoffmann
2014-07-15  8:39         ` Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).