libvhost-user-glib: use g_main_context_get_thread_default()
commita00fdc9c9d3e7f2c3c21d14ba8fd04451ec423a2
authorJohannes Berg <johannes.berg@intel.com>
Thu, 23 Jan 2020 08:17:05 +0000 (23 09:17 +0100)
committerMichael S. Tsirkin <mst@redhat.com>
Thu, 27 Feb 2020 08:46:10 +0000 (27 03:46 -0500)
treea3b2cb51b7f0fd27cc6fff39a43f832d1e200662
parenta7290a79fa262124916dab2bb75188cfd07faad6
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>
contrib/libvhost-user/libvhost-user-glib.c