From nobody Fri May 3 23:37:52 2024 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 158207231079271.19446434382019; Tue, 18 Feb 2020 16:31:50 -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-18-kqroLTNLMniXjScxaAk0Pw-1; Tue, 18 Feb 2020 19:31:46 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7468F1005512; Wed, 19 Feb 2020 00:31:39 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 72E2019756; Wed, 19 Feb 2020 00:31:37 +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 6322F35AF8; Wed, 19 Feb 2020 00:31:32 +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 01J0VTu7029589 for ; Tue, 18 Feb 2020 19:31:29 -0500 Received: by smtp.corp.redhat.com (Postfix) id A2CCE10001AE; Wed, 19 Feb 2020 00:31:29 +0000 (UTC) Received: from lpt.redhat.com (ovpn-200-31.brq.redhat.com [10.40.200.31]) by smtp.corp.redhat.com (Postfix) with ESMTP id A8568100194E for ; Wed, 19 Feb 2020 00:31:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582072309; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=NCD5hkn/D92YEtozZOd1tY/tez1r1HXg7Z1S0e0ggXg=; b=eEtKGibw7pxPaeBd6pUAwK56toWA5dy1+ZVGGj2Ypqn2hLrYxc5erwKJwXdAT7r66GHvNz fWj9S9BrhGDeGRMO5ONcGb37ITSqSFTntWX2XR4UKJMs03QPXjy9mgnWbdt4G5cnkB4fmK b54KJkk9W5kUghXz8V4Z7/O/NDEf1h8= From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt RFC PATCH] util: vireventglibwatch: watch for G_IO_HUP and G_IO_ERR Date: Wed, 19 Feb 2020 01:31:22 +0100 Message-Id: <7f8f601f366643745879d72471217935ef339f39.1582072163.git.jtomko@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.84 on 10.5.11.23 X-MC-Unique: kqroLTNLMniXjScxaAk0Pw-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" To more closely match the previous usage in virEventPollDispatchHandles, where called the handle callback for any revents returned by poll. This should fix the virtlogd error on subsequent domain startup: error: can't connect to virtlogd: Cannot open log file: '/var/log/libvirt/qemu/f28live.log': Device or resource busy as well as virtlogd spinning caused by virLogHandlerDomainLogFileEvent never being called on hangup. Signed-off-by: J=C3=A1n Tomko Fixes: f8ab47cb4491dd72d866c1a96a9d94b8c3341de9 Fixes: 946a25274c46ffff46323c62f567ae7e753aa921 Reviewed-by: Daniel P. Berrang=C3=A9 Reviewed-by: Michal Privoznik --- src/util/vireventglibwatch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util/vireventglibwatch.c b/src/util/vireventglibwatch.c index 7694e74f23..178707f6b7 100644 --- a/src/util/vireventglibwatch.c +++ b/src/util/vireventglibwatch.c @@ -89,11 +89,11 @@ GSource *virEventGLibCreateSocketWatch(int fd, sizeof(virEventGLibFDSource)); ssource =3D (virEventGLibFDSource *)source; =20 - ssource->condition =3D condition; + ssource->condition =3D condition | G_IO_HUP | G_IO_ERR; ssource->fd =3D fd; =20 ssource->pollfd.fd =3D fd; - ssource->pollfd.events =3D condition; + ssource->pollfd.events =3D condition | G_IO_HUP | G_IO_ERR; =20 g_source_add_poll(source, &ssource->pollfd); =20 --=20 2.24.1