From patchwork Wed Feb 26 09:07:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1244821 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=E4cULFXX; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48S97m6ZHVz9sNg for ; Wed, 26 Feb 2020 20:13:08 +1100 (AEDT) Received: from localhost ([::1]:40600 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6skc-0007mr-Nw for incoming@patchwork.ozlabs.org; Wed, 26 Feb 2020 04:13:06 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59378) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6sfQ-0006RH-6L for qemu-devel@nongnu.org; Wed, 26 Feb 2020 04:07:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j6sfO-0000uo-Oa for qemu-devel@nongnu.org; Wed, 26 Feb 2020 04:07:44 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:33813 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j6sfO-0000tf-Kb for qemu-devel@nongnu.org; Wed, 26 Feb 2020 04:07:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582708062; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/oKgHpzvvYWsVdDfIdCVEbYUj7F09lISrJlwoM5pP5g=; b=E4cULFXX9JLwDFPdg2ep9AuVLzKO1XQrWdi1eQkmTCd8mHBone9l6SiJnn/OcxhTGrOodt xqKOiJ3S2hhykAwrI3LWRJPyFLDXdEaJ6goOtZ3ERrqW4Wfd9N14xBo0KSqaZKcqeIy3ff 21Y5PlEEfmJHTLiEuaM+lJQNrirFQSE= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-110-gTXb_iKNMEKGYNmbvAScOw-1; Wed, 26 Feb 2020 04:07:37 -0500 X-MC-Unique: gTXb_iKNMEKGYNmbvAScOw-1 Received: by mail-wm1-f69.google.com with SMTP id r19so655440wmh.1 for ; Wed, 26 Feb 2020 01:07:36 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=RCsZu5eqrBUiXUZoz9bzfU4qWCKnd0BfjuIJHzusOXA=; b=HDxswMgXj9ZtjUbTQ2JMrzdxSoOnlTt78OFc/x7m3lzxHbp/4c6KH6KnXE2AQXuzNn G5r8gLCgHCUmxb5NoxibCTOe3yLY3uLh1bwlTvuCxQXCdRY2ZcvvWNjh221G47fa+Fk3 231M8lLNf2ZlwgDKT8l44+QKZL1sZtwmTQtsDodweboNvpplu9q1VJLQ6f6T05gY+iRp CiCRpw/Bc0btrKjyHZ5KotgsCLal3gDMzx/1LNlcJtcZn02muSVPUDpuFReHeB1ZH6/e mweLytPDg9EmW28hPseSpJUces4Zdle2BL79vBLx2XaB8NqnI6uhr5Ev5uMd+hMaRHr7 XxMQ== X-Gm-Message-State: APjAAAXy+57iwu+m6AE9mGrM5x7UwFaIye5ORSlnXuNDkubt5W6Uq8tG rmyNFTpfQLIY7LJHVorwBNzj+6nH+raLjhLTyFsTONEj+tsklPri6fUjSiW1UbiX4uoRC7goDMN 2XeL61UZfhLKyZtw= X-Received: by 2002:a5d:4d0a:: with SMTP id z10mr4239824wrt.253.1582708055387; Wed, 26 Feb 2020 01:07:35 -0800 (PST) X-Google-Smtp-Source: APXvYqzIQfWQxm1m/XuaBG3gKFFThXgSVFZxp6KSDGzjOdkOZLrjtmcEcqWOjEQMMmDMdEkBfvNhJw== X-Received: by 2002:a5d:4d0a:: with SMTP id z10mr4239800wrt.253.1582708055144; Wed, 26 Feb 2020 01:07:35 -0800 (PST) Received: from redhat.com (bzq-79-178-2-214.red.bezeqint.net. [79.178.2.214]) by smtp.gmail.com with ESMTPSA id g10sm2443272wrr.13.2020.02.26.01.07.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Feb 2020 01:07:34 -0800 (PST) Date: Wed, 26 Feb 2020 04:07:34 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL v2 24/30] libvhost-user-glib: use g_main_context_get_thread_default() Message-ID: <20200226090010.708934-25-mst@redhat.com> References: <20200226090010.708934-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20200226090010.708934-1-mst@redhat.com> X-Mailer: git-send-email 2.24.1.751.gd10ce2899c X-Mutt-Fcc: =sent X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 205.139.110.120 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: Peter Maydell , Stefan Hajnoczi , Johannes Berg , =?utf-8?q?Marc-Andr=C3=A9?= Lureau Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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. Reviewed-by: Stefan Hajnoczi Reviewed-by: Marc-André Lureau Signed-off-by: Johannes Berg Message-Id: <20200123081708.7817-4-johannes@sipsolutions.net> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- 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 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;