From: Chris Lalancette Date: Thu, 10 Sep 2009 09:36:35 +0000 (+0200) Subject: Fix regression from "Avoid polling on FDs with no events" X-Git-Tag: v0.7.1~49 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=100cae73599fd2fc2a0d37dd798ed030f84f5fee;p=thirdparty%2Flibvirt.git 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 --- diff --git a/src/qemu_driver.c b/src/qemu_driver.c index 5217530424..ae112d84f7 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;