mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-28 00:25:23 +00:00
7b3cf84bbb
libxl events are delivered to libvirt via the libxlDomainEventHandler callback registered with libxl. Documenation in $xensrc/tools/libxl/libxl_event.h states that the callback "may occur on any thread in which the application calls libxl". This can result in deadlock since many of the libvirt callees of libxl hold a lock on the virDomainObj they are working on. When the callback is invoked, it attempts to find a virDomainObj corresponding to the domain ID provided by libxl. Searching the domain obj list results in locking each obj before checking if it is active, and its ID equals the requested ID. Deadlock is possible when attempting to lock an obj that is already locked further up the call stack. Indeed, Max Ustermann reported an instance of this deadlock https://www.redhat.com/archives/libvir-list/2015-November/msg00130.html Guido Rossmueller also recently stumbled across it https://www.redhat.com/archives/libvir-list/2016-September/msg00287.html Fix the deadlock by moving the lookup of virDomainObj to the libxlDomainShutdownThread. After this patch, libxl events are enqueued on the libvirt side and processed by dedicated thread, avoiding the described deadlock. Reported-by: Max Ustermann <ustermann78@web.de> Reported-by: Guido Rossmueller <Guido.Rossmueller@gdata.de> |
||
---|---|---|
.. | ||
libvirtd_libxl.aug | ||
libxl_capabilities.c | ||
libxl_capabilities.h | ||
libxl_conf.c | ||
libxl_conf.h | ||
libxl_domain.c | ||
libxl_domain.h | ||
libxl_driver.c | ||
libxl_driver.h | ||
libxl_migration.c | ||
libxl_migration.h | ||
libxl.conf | ||
test_libvirtd_libxl.aug.in |