When a vCPU is introspected, it waits for introspection commands or event
replies. If the introspection channel is closed, the receiving thread
will wake-up the vCPU threads. With this function the vCPU thread will
wake-up on SIGKILL too.

Signed-off-by: Adalbert Lazăr <[email protected]>
---
 include/linux/swait.h | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/include/linux/swait.h b/include/linux/swait.h
index 73e06e9986d4..9c53383219f6 100644
--- a/include/linux/swait.h
+++ b/include/linux/swait.h
@@ -297,4 +297,15 @@ do {                                                       
                \
        __ret;                                                          \
 })
 
+#define __swait_event_killable(wq, condition)                          \
+       ___swait_event(wq, condition, TASK_KILLABLE, 0, schedule())
+
+#define swait_event_killable_exclusive(wq, condition)                  \
+({                                                                     \
+       int __ret = 0;                                                  \
+       if (!(condition))                                               \
+               __ret = __swait_event_killable(wq, condition);          \
+       __ret;                                                          \
+})
+
 #endif /* _LINUX_SWAIT_H */
_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Reply via email to