From nobody Sat Feb 7 09:42:30 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1580217253909762.6428591865031; Tue, 28 Jan 2020 05:14:13 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-248-oM1FjwQiO-Wd66WMeOcI-Q-1; Tue, 28 Jan 2020 08:14:09 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7399318A6EC8; Tue, 28 Jan 2020 13:14:03 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4B5378E5E9; Tue, 28 Jan 2020 13:14:03 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id F3E9118034FD; Tue, 28 Jan 2020 13:14:02 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 00SDDuke019573 for ; Tue, 28 Jan 2020 08:13:56 -0500 Received: by smtp.corp.redhat.com (Postfix) id D59351001DE1; Tue, 28 Jan 2020 13:13:56 +0000 (UTC) Received: from domokun.gsslab.fab.redhat.com (unknown [10.33.8.110]) by smtp.corp.redhat.com (Postfix) with ESMTP id 739091001DD8; Tue, 28 Jan 2020 13:13:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580217252; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=HDkosILZJj0DpvyzbfvsPVUsjccROfAxaz2wtIrsSQw=; b=aywr5sSn3eUukUwX0AKAQ6PRt+8EWo56ho3raKto1u0gjYi8DYdTc3CBv/XMkLXloiqeOc 2win17QKyzjdvNiuMWEd3w4AbB/6+edVL4gJKg7CVQDdEqBkfhYhcy3l2DpGUpbjaHT6Ma 3AzSPPOy4oqqBrted7Pjts73RzPuQ1M= From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH v2 40/56] util: switch to use the GLib event loop impl Date: Tue, 28 Jan 2020 13:11:21 +0000 Message-Id: <20200128131137.1762449-41-berrange@redhat.com> In-Reply-To: <20200128131137.1762449-1-berrange@redhat.com> References: <20200128131137.1762449-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-MC-Unique: oM1FjwQiO-Wd66WMeOcI-Q-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" This sets the GLib event loop as the impl when calling virEventRegisterDefaultImpl(). This remains a private impl detail of libvirt, so applications must *NOT* assume that a call to virEventRegisterDefaultImpl() results in a GLib based event loop. They should continue to use the libvirt-glib API gvir_event_register() if they explicitly want to guarantee a GLib event loop. This follows the general principal that the libvirt public API should not expose the fact that GLib is being used internally. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Pavel Hrdina --- src/util/virevent.c | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/src/util/virevent.c b/src/util/virevent.c index fd5d8f5bf1..3477d63554 100644 --- a/src/util/virevent.c +++ b/src/util/virevent.c @@ -22,7 +22,7 @@ #include =20 #include "virevent.h" -#include "vireventpoll.h" +#include "vireventglib.h" #include "virlog.h" #include "virerror.h" =20 @@ -309,17 +309,7 @@ int virEventRegisterDefaultImpl(void) =20 virResetLastError(); =20 - if (virEventPollInit() < 0) { - virDispatchError(NULL); - return -1; - } - - virEventRegisterImpl(virEventPollAddHandle, - virEventPollUpdateHandle, - virEventPollRemoveHandle, - virEventPollAddTimeout, - virEventPollUpdateTimeout, - virEventPollRemoveTimeout); + virEventGLibRegister(); =20 return 0; } @@ -350,10 +340,5 @@ int virEventRunDefaultImpl(void) VIR_DEBUG("running default event implementation"); virResetLastError(); =20 - if (virEventPollRunOnce() < 0) { - virDispatchError(NULL); - return -1; - } - - return 0; + return virEventGLibRunOnce(); } --=20 2.24.1