[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] memory_listener_unregister does not call region_del() - why

From: Alexey Kardashevskiy
Subject: [Qemu-devel] memory_listener_unregister does not call region_del() - why?
Date: Tue, 3 May 2016 19:07:39 +1000
User-agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.0


Noticed a thing - when we do vfio-pci hotplug, we register a memory listener on PCI address space:

memory_listener_register(&container->listener, container->space->as);

Then on the "pseries" machine, I add IOMMU subregions and this ends up in vfio_listener_region_add() where I can create hardware window and hook it to KVM, etc, some stuff. So far so good.

Now I am trying hot unplug. So vfio_instance_finalize() is called, and from it - vfio_put_group -> vfio_disconnect_container -> vfio_listener_release -> memory_listener_unregister(&container->listener), as expected.

Hoewever, unlike memory_listener_register() (which calls region_add() callbacks), memory_listener_unregister() is as simple as this:

void memory_listener_unregister(MemoryListener *listener)
    QTAILQ_REMOVE(&memory_listeners, listener, link);

No region_del() calls => no proper cleanup. Hm.

Is there any particular reason for it to be that simple and there is another way to be notified about some memory listener being unregistered? Thanks.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]