diff options
author | Johannes Berg <johannes.berg@intel.com> | 2020-01-23 09:17:05 +0100 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2020-02-27 03:46:10 -0500 |
commit | a00fdc9c9d3e7f2c3c21d14ba8fd04451ec423a2 (patch) | |
tree | a3b2cb51b7f0fd27cc6fff39a43f832d1e200662 /contrib | |
parent | a7290a79fa262124916dab2bb75188cfd07faad6 (diff) |
libvhost-user-glib: use g_main_context_get_thread_default()
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 <stefanha@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Message-Id: <20200123081708.7817-4-johannes@sipsolutions.net>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/libvhost-user/libvhost-user-glib.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/contrib/libvhost-user/libvhost-user-glib.c b/contrib/libvhost-user/libvhost-user-glib.c index 824c7780de..53f1ca4cdd 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; |