From 100cae73599fd2fc2a0d37dd798ed030f84f5fee Mon Sep 17 00:00:00 2001 From: Chris Lalancette Date: Thu, 10 Sep 2009 11:36:35 +0200 Subject: [PATCH] Fix regression from "Avoid polling on FDs with no events" After the mentioned patch was applied, I noticed that shutting down a kvm guest from inside (i.e. poweroff) caused the guest to shutdown, but not removed from the list of active guests. DanB pointed out that the problem is that the virEventAddHandle() call in the qemu driver was asking to watch for 0 events, not HANGUP | ERROR as it should. Add these events so that shutdown works again. Signed-off-by: Chris Lalancette --- src/qemu_driver.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/qemu_driver.c b/src/qemu_driver.c index 521753042..ae112d84f 100644 --- a/src/qemu_driver.c +++ b/src/qemu_driver.c @@ -977,7 +977,8 @@ qemudOpenMonitorCommon(virConnectPtr conn, if (ret != 0) return ret; - if ((vm->monitorWatch = virEventAddHandle(vm->monitor, 0, + if ((vm->monitorWatch = virEventAddHandle(vm->monitor, + VIR_EVENT_HANDLE_HANGUP | VIR_EVENT_HANDLE_ERROR, qemudDispatchVMEvent, driver, NULL)) < 0) return -1; -- 2.39.5