]> git.proxmox.com Git - mirror_qemu.git/commitdiff
event_notifier: Make event_notifier_init_fd() #ifdef CONFIG_EVENTFD
authorMarkus Armbruster <armbru@redhat.com>
Tue, 15 Mar 2016 18:34:20 +0000 (19:34 +0100)
committerMarkus Armbruster <armbru@redhat.com>
Mon, 21 Mar 2016 20:28:59 +0000 (21:28 +0100)
Event notifiers are designed for eventfd(2).  They can fall back to
pipes, but according to Paolo, event_notifier_init_fd() really
requires the real thing, and should therefore be under #ifdef
CONFIG_EVENTFD.  Do that.

Its only user is ivshmem, which is currently CONFIG_POSIX.  Narrow it
to CONFIG_EVENTFD.

Cc: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <1458066895-20632-6-git-send-email-armbru@redhat.com>

default-configs/pci.mak
tests/Makefile
util/event_notifier-posix.c

index 4fa9a28ef6679a3241732172e69f825f9e873751..9c8bc68c4cafca135361a43c99b341c9731e924d 100644 (file)
@@ -36,5 +36,5 @@ CONFIG_SDHCI=y
 CONFIG_EDU=y
 CONFIG_VGA=y
 CONFIG_VGA_PCI=y
-CONFIG_IVSHMEM=$(CONFIG_POSIX)
+CONFIG_IVSHMEM=$(CONFIG_EVENTFD)
 CONFIG_ROCKER=y
index cd4bbd41adc1ab2adeecf70a2443135856953f7d..3cb951dcc6ce666e5295c534d1ce28e994eede9b 100644 (file)
@@ -161,7 +161,7 @@ gcov-files-pci-y += hw/display/virtio-gpu-pci.c
 gcov-files-pci-$(CONFIG_VIRTIO_VGA) += hw/display/virtio-vga.c
 check-qtest-pci-y += tests/intel-hda-test$(EXESUF)
 gcov-files-pci-y += hw/audio/intel-hda.c hw/audio/hda-codec.c
-check-qtest-pci-$(CONFIG_POSIX) += tests/ivshmem-test$(EXESUF)
+check-qtest-pci-$(CONFIG_EVENTFD) += tests/ivshmem-test$(EXESUF)
 gcov-files-pci-y += hw/misc/ivshmem.c
 
 check-qtest-i386-y = tests/endianness-test$(EXESUF)
index 2e30e74bd63f800dbd520b37cbf64d1ca016d08f..c9657a61ae32689c1135687747d42abdbc394267 100644 (file)
 #include <sys/eventfd.h>
 #endif
 
+#ifdef CONFIG_EVENTFD
+/*
+ * Initialize @e with existing file descriptor @fd.
+ * @fd must be a genuine eventfd object, emulation with pipe won't do.
+ */
 void event_notifier_init_fd(EventNotifier *e, int fd)
 {
     e->rfd = fd;
     e->wfd = fd;
 }
+#endif
 
 int event_notifier_init(EventNotifier *e, int active)
 {