]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Fix regression from "Avoid polling on FDs with no events"
authorChris Lalancette <clalance@redhat.com>
Thu, 10 Sep 2009 09:36:35 +0000 (11:36 +0200)
committerChris Lalancette <clalance@redhat.com>
Thu, 10 Sep 2009 11:15:26 +0000 (13:15 +0200)
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 <clalance@redhat.com>
src/qemu_driver.c

index 52175304247012b5e342b0df8b932346ecf3b88f..ae112d84f779a61d0d5972594bbbad748db5ec07 100644 (file)
@@ -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;