@@ -765,6 +765,12 @@ void libxl__ev_slowlock_unlock(libxl__gc *gc, libxl__ev_slowlock *lock)
ev_slowlock_init_internal(lock, lock->userdata_userid);
}
+void libxl__ev_slowlock_dispose(libxl__gc *gc, libxl__ev_slowlock *lock)
+{
+ libxl__ev_child_kill_deregister(lock->ao, &lock->child, SIGKILL);
+ libxl__ev_slowlock_unlock(gc, lock);
+}
+
/*
* Local variables:
* mode: C
@@ -393,6 +393,8 @@ struct libxl__ev_child {
* libxl__ev_slowlock_lock: Idle -> Active
* May call callback synchronously.
* libxl__ev_slowlock_unlock: LockAcquired/Idle -> Idle
+ * libxl__ev_slowlock_dispose: Idle/Active/LockAcquired -> Idle
+ * The callback will not be called anymore.
* callback: When called: Active -> LockAcquired (on error: Idle)
* The callback is only called once.
*/
@@ -411,6 +413,7 @@ struct libxl__ev_slowlock {
_hidden void libxl__ev_devlock_init(libxl__ev_slowlock *);
_hidden void libxl__ev_slowlock_lock(libxl__egc *, libxl__ev_slowlock *);
_hidden void libxl__ev_slowlock_unlock(libxl__gc *, libxl__ev_slowlock *);
+_hidden void libxl__ev_slowlock_dispose(libxl__gc *, libxl__ev_slowlock *);
/*
* QMP asynchronous calls
Which allow to cancel the lock operation while it is in Active state. Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> --- Notes: v2: - Renamed libxl__ev_qmplock_dispose to libxl__ev_slowlock_dispose - This new API was part of the patch "Introduce libxl__ev_qmplock" in v1. tools/libxl/libxl_internal.c | 6 ++++++ tools/libxl/libxl_internal.h | 3 +++ 2 files changed, 9 insertions(+)