memory: pass EventNotifier, not eventfd

Under Win32, EventNotifiers will not have event_notifier_get_fd, so we
cannot call it in common code such as hw/virtio-pci.c.  Pass a pointer to
the notifier, and only retrieve the file descriptor in kvm-specific code.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
This commit is contained in:
Paolo Bonzini 2012-07-05 17:16:27 +02:00 committed by Avi Kivity
parent b6a1f3a569
commit 753d5e14c4
9 changed files with 42 additions and 32 deletions

View file

@ -174,10 +174,10 @@ static int virtio_pci_set_host_notifier_internal(VirtIOPCIProxy *proxy,
return r;
}
memory_region_add_eventfd(&proxy->bar, VIRTIO_PCI_QUEUE_NOTIFY, 2,
true, n, event_notifier_get_fd(notifier));
true, n, notifier);
} else {
memory_region_del_eventfd(&proxy->bar, VIRTIO_PCI_QUEUE_NOTIFY, 2,
true, n, event_notifier_get_fd(notifier));
true, n, notifier);
/* Handle the race condition where the guest kicked and we deassigned
* before we got around to handling the kick.
*/