[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v5 3/6] libvhost-user-glib: use g_main_context_get_thread_default
From: |
Johannes Berg |
Subject: |
[PATCH v5 3/6] libvhost-user-glib: use g_main_context_get_thread_default() |
Date: |
Thu, 23 Jan 2020 09:17:05 +0100 |
From: Johannes Berg <address@hidden>
If we use NULL, we just get the main program default mainloop
here. Using g_main_context_get_thread_default() has basically
the same effect, but it lets us start different devices in
different threads with different mainloops, which can be useful.
Reviewed-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Marc-André Lureau <address@hidden>
Signed-off-by: Johannes Berg <address@hidden>
---
contrib/libvhost-user/libvhost-user-glib.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/contrib/libvhost-user/libvhost-user-glib.c
b/contrib/libvhost-user/libvhost-user-glib.c
index 824c7780de61..53f1ca4cdd73 100644
--- a/contrib/libvhost-user/libvhost-user-glib.c
+++ b/contrib/libvhost-user/libvhost-user-glib.c
@@ -89,7 +89,7 @@ vug_source_new(VugDev *gdev, int fd, GIOCondition cond,
src->gfd.events = cond;
g_source_add_poll(gsrc, &src->gfd);
- id = g_source_attach(gsrc, NULL);
+ id = g_source_attach(gsrc, g_main_context_get_thread_default());
g_assert(id);
return gsrc;
--
2.24.1
- [PATCH v5 0/6] small vhost changes and in-band notifications, Johannes Berg, 2020/01/23
- [PATCH v5 3/6] libvhost-user-glib: use g_main_context_get_thread_default(),
Johannes Berg <=
- [PATCH v5 1/6] libvhost-user: implement VHOST_USER_PROTOCOL_F_REPLY_ACK, Johannes Berg, 2020/01/23
- [PATCH v5 4/6] libvhost-user: handle NOFD flag in call/kick/err better, Johannes Berg, 2020/01/23
- [PATCH v5 6/6] libvhost-user: implement in-band notifications, Johannes Berg, 2020/01/23
- [PATCH v5 2/6] libvhost-user-glib: fix VugDev main fd cleanup, Johannes Berg, 2020/01/23
- [PATCH v5 5/6] docs: vhost-user: add in-band kick/call messages, Johannes Berg, 2020/01/23