From 58f549d4fa90d0bec0eafbad968328388526dd86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1n=20Tomko?= Date: Wed, 19 Feb 2020 01:00:49 +0100 Subject: [PATCH] util: vireventglibwatch: watch for G_IO_HUP and G_IO_ERR MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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án Tomko Fixes: f8ab47cb4491dd72d866c1a96a9d94b8c3341de9 Fixes: 946a25274c46ffff46323c62f567ae7e753aa921 Tested-by: Andrea Bolognani 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 = (virEventGLibFDSource *)source; - ssource->condition = condition; + ssource->condition = condition | G_IO_HUP | G_IO_ERR; ssource->fd = fd; ssource->pollfd.fd = fd; - ssource->pollfd.events = condition; + ssource->pollfd.events = condition | G_IO_HUP | G_IO_ERR; g_source_add_poll(source, &ssource->pollfd);