Skip to contentSkip to conversation

Use existing config check when including eventfd.h

PATCH In review Mike McCormack 2 participants 2 messages Jul 21, 2010 – Jul 22, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Use existing config check when including eventfd.h

---
 hw/vhost.c     |    2 ++
 hw/vhost_net.c |    2 ++
 2 files changed, 4 insertions(+), 0 deletions(-)
hw/vhost.c +2 -0
index d37a66e..e1cd4d2 100644
@@ -11,7 +11,9 @@
  */
 
 #include <sys/ioctl.h>
+#ifdef CONFIG_EVENTFD
 #include <sys/eventfd.h>
+#endif
 #include "vhost.h"
 #include "hw/hw.h"
 /* For range_get_last */
hw/vhost_net.c +2 -0
index 606aa0c..f4bddd4 100644
@@ -20,7 +20,9 @@
 
 #ifdef CONFIG_VHOST_NET
 #include <linux/vhost.h>
+#ifdef CONFIG_EVENTFD
 #include <sys/eventfd.h>
+#endif
 #include <sys/socket.h>
 #include <linux/kvm.h>
 #include <fcntl.h>
Signature · 1 line
1.5.6.5
#1 lore raw
Quoted 25 lines · Mike McCormack

---
 hw/vhost.c     |    2 ++
 hw/vhost_net.c |    2 ++

 2 files changed, 4 insertions(+), 0 deletions(-)
hw/vhost.c +2 -0
index d37a66e..e1cd4d2 100644
@@ -11,7 +11,9 @@
  */
 
  #include <sys/ioctl.h>
+#ifdef CONFIG_EVENTFD
  #include <sys/eventfd.h>
+#endif
  #include "vhost.h"
  #include "hw/hw.h"
  /* For range_get_last */
hw/vhost_net.c +0 -0
index 606aa0c..f4bddd4 100644

hw/vhost_net.c

Quoted 10 lines
hw/vhost_net.c +2 -1
@@ -20,7 +20,9 @@
 
  #ifdef CONFIG_VHOST_NET
  #include <linux/vhost.h>
+#ifdef CONFIG_EVENTFD
  #include <sys/eventfd.h>
+#endif
  #include <sys/socket.h>
  #include <linux/kvm.h>
  #include <fcntl.h>
--

vhost.c and vhost_net.c do not use sys/eventfd.h, please remove the #include instead of #ifdefing it. The only source file that needs to include it is event_notifier.c from what I can tell.

Stefan

Quoted 4 lines

1.5.6.5