From nobody Sun Feb 8 14:53:32 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.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 207.211.31.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 [207.211.31.120]) by mx.zohomail.com with SMTPS id 1580923169857451.25791655326054; Wed, 5 Feb 2020 09:19:29 -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-353-pvlPmq8GPcSwyRHTeZaDng-1; Wed, 05 Feb 2020 12:19:22 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AE0CB10CE784; Wed, 5 Feb 2020 17:19:15 +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 85AE210016DA; Wed, 5 Feb 2020 17:19:15 +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 3A95018089D8; Wed, 5 Feb 2020 17:19:15 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 015HJ75p015915 for ; Wed, 5 Feb 2020 12:19:07 -0500 Received: by smtp.corp.redhat.com (Postfix) id DD4B5857B7; Wed, 5 Feb 2020 17:19:07 +0000 (UTC) Received: from domokun.gsslab.fab.redhat.com (unknown [10.33.8.110]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2A216857A8; Wed, 5 Feb 2020 17:19:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580923168; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=0KicCTmqxqvXSisk90UkprzDo2sM980HQZF+5Ihp8dA=; b=B6gad3sfqILIQK7sZhcsnBLtWjlp5r/OTIhB/3C4Kvr3p+U9VSdDbx0LcM1d4TYSDoY6Hp 23Mv+4BwjgaA/9WQeHeKKQSTJHm2eiPuH2/51fYFsk/1E7XFg4djHbtccp/euojUknUVM0 HTBdG6MIPase7FEtXw7b39jfnB4UF/w= From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH v3 5/7] util: switch to use the GLib event loop impl Date: Wed, 5 Feb 2020 17:18:56 +0000 Message-Id: <20200205171858.2694632-6-berrange@redhat.com> In-Reply-To: <20200205171858.2694632-1-berrange@redhat.com> References: <20200205171858.2694632-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Cc: Pavel Hrdina 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.84 on 10.5.11.22 X-MC-Unique: pvlPmq8GPcSwyRHTeZaDng-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. Reviewed-by: Pavel Hrdina Signed-off-by: Daniel P. Berrang=C3=A9 --- 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