mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
event_notifier: Make event_notifier_init_fd() #ifdef CONFIG_EVENTFD
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>
This commit is contained in:
parent
ad4929384b
commit
330b58368c
3 changed files with 8 additions and 2 deletions
|
@ -20,11 +20,17 @@
|
|||
#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)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue