Jim Fehlig wrote:
Since libxl provides the domain ID in the event handler callback,
find the domain object based on the ID. This approach prevents
processing the callback on a domain that has already been reaped.
---
src/libxl/libxl_driver.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index 7484b83..e28b641 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -656,22 +656,22 @@ libxlVmReap(libxlDriverPrivatePtr driver,
* Handle previously registered event notification from libxenlight
*/
static void
-libxlEventHandler(void *data, const libxl_event *event)
+libxlEventHandler(void *data ATTRIBUTE_UNUSED, const libxl_event *event)
{
libxlDriverPrivatePtr driver = libxl_driver;
- virDomainObjPtr vm = data;
+ virDomainObjPtr vm = NULL;
virDomainEventPtr dom_event = NULL;
libxlDriverLock(driver);
On xen-unstable, I noticed an occasional deadlock here when libxl
invokes the event handler with a SUSPEND shutdown reason. The driver
lock is already held by the caller of libxl_domain_suspend(). Inspired
by the xl implementation, I've updated this patch to ignore the SUSPEND
shutdown reason before acquiring the driver lock.
Regards,
Jim