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 <clalance@redhat.com>
This commit is contained in:
Chris Lalancette 2009-09-10 11:36:35 +02:00
parent f238709304
commit 100cae7359

View 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;