From nobody Wed Nov 12 05:24:28 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1568723272; cv=none; d=zoho.com; s=zohoarc; b=LtM5Pl/aUeJXQ48/MypssFGquv8SRDI3VFWokSFB0IeGKqg/cKOXQKoR3z1grceKnRBTRC4r93f7cQdXO2yI2B5V2EM+iP8oxiNYXPnFldQIbyAcq6Tlu+nfb6opPhSFj6yWhBfNTJ/rStipQQ8L+1dtozOOQ7Mwx/xlRvt7/70= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568723272; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=NxiqdcIlxf3P/XxLjnl1XMU+kESIm8eim4zi7TtuIjA=; b=Brttk2RGRJm1IJksQS3AGG70M3F8uUALcGik4fo3k964FX95HR28wf+MY7yA96ceY7JBNgjFVNUFxow9NHvuWkecnhtA8vqyuD550HXDmJt4Rl7goA4jUT6NtY++11ObiCaH+PMCwrOa5xuDvkhv0EKdidvfVGI/1KeQpIJjttY= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 156872327243665.3243609014537; Tue, 17 Sep 2019 05:27:52 -0700 (PDT) Received: from localhost ([::1]:45532 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iACaE-0007J9-Ah for importer@patchew.org; Tue, 17 Sep 2019 08:27:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35321) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iACXv-0005gh-Vk for qemu-devel@nongnu.org; Tue, 17 Sep 2019 08:25:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iACXu-0006DJ-Uk for qemu-devel@nongnu.org; Tue, 17 Sep 2019 08:25:27 -0400 Received: from s3.sipsolutions.net ([2a01:4f8:191:4433::2]:59338 helo=sipsolutions.net) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iACXu-00068X-Oa for qemu-devel@nongnu.org; Tue, 17 Sep 2019 08:25:26 -0400 Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iACXr-0003sD-Qd; Tue, 17 Sep 2019 14:25:23 +0200 From: Johannes Berg To: qemu-devel@nongnu.org Date: Tue, 17 Sep 2019 14:25:12 +0200 Message-Id: <20190917122512.15320-1-johannes@sipsolutions.net> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a01:4f8:191:4433::2 Subject: [Qemu-devel] [PATCH] libvhost-user-glib: use g_main_context_get_thread_default() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Johannes Berg , "Michael S . Tsirkin" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Johannes Berg 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. Signed-off-by: Johannes Berg Reviewed-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Stefan Hajnoczi --- 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 =3D cond; =20 g_source_add_poll(gsrc, &src->gfd); - id =3D g_source_attach(gsrc, NULL); + id =3D g_source_attach(gsrc, g_main_context_get_thread_default()); g_assert(id); =20 return gsrc; --=20 2.20.1