Comment 0 for bug 1912846

Revision history for this message
Eugenio PĂ©rez (eperezma) wrote : Assertion hit on hot-unplugging iommu enabled device

From commit ("2d24a646 device-core: use RCU for
list of children of a bus") an assertion is hit when
removing a device, since mr->listeners are not properly
removed. To reproduce:

/home/qemu/build/x86_64-softmmu/qemu-system-x86_64 -qmp tcp:0:4444,server,nowait ... \
    -netdev tap,id=hostnet0,vhostforce=on,vhost=on \
    -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:14:18:cc,bus=pci.1,addr=0x0,iommu_platform=on,ats=on

In QMP:
{'execute': 'qmp_capabilities'}
{"execute": "device_del", "arguments": {"id": "net0"} }

And crash:
../softmmu/memory.c:2818: do_address_space_destroy: Assertion `QTAILQ_EMPTY(&as->listeners)' failed.