Skip to contentSkip to conversation

virtio-input: move sys/ioctl.h include

PATCH New Gerd Hoffmann 1 participant 2 messages Jul 14, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 virtio-input: move sys/ioctl.h include

Drop from include/standard-headers/linux/input.h
Add to hw/input/virtio-input-host.c instead.

That allows to build virtio-input (except pass-through) on windows.

---
 hw/input/virtio-input-host.c           | 1 +
 include/standard-headers/linux/input.h | 1 -
 scripts/update-linux-headers.sh        | 1 +
 3 files changed, 2 insertions(+), 1 deletion(-)
hw/input/virtio-input-host.c +1 -0
index f7e3d84..8978f16 100644
@@ -11,6 +11,7 @@
 #include "hw/virtio/virtio.h"
 #include "hw/virtio/virtio-input.h"
 
+#include <sys/ioctl.h>
 #include "standard-headers/linux/input.h"
 
 /* ----------------------------------------------------------------- */
include/standard-headers/linux/input.h +0 -1
index a459dd2..b003c67 100644
@@ -10,7 +10,6 @@
 
 
 #include <sys/time.h>
-#include <sys/ioctl.h>
 #include <sys/types.h>
 #include "standard-headers/linux/types.h"
 
scripts/update-linux-headers.sh +1 -0
index 47378d9..f0e830c 100755
@@ -56,6 +56,7 @@ cp_virtio() {
                 -e 's/__bitwise__//' \
                 -e 's/__attribute__((packed))/QEMU_PACKED/' \
                 -e 's/__inline__/inline/' \
+                -e '/sys\/ioctl.h/d' \
                 "$f" > "$to/$header";
         done
     fi
Signature · 1 line
1.8.3.1
#1 lore raw

PATCH 2/2 virtio-input: enable on non-linux hosts

As we include a copy of the linux input layer header file in the qemu source tree (include/standard-headers/linux/input.h) the virtio-input bits (except pass-through) should build and work just fine on non-linux hosts too. Tweak Makefile accordingly.

---
 hw/input/Makefile.objs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/input/Makefile.objs +1 -1
index 624ba7e..7715d72 100644
@@ -8,9 +8,9 @@ common-obj-$(CONFIG_STELLARIS_INPUT) += stellaris_input.o
 common-obj-$(CONFIG_TSC2005) += tsc2005.o
 common-obj-$(CONFIG_VMMOUSE) += vmmouse.o
 
-ifeq ($(CONFIG_LINUX),y)
 common-obj-$(CONFIG_VIRTIO) += virtio-input.o
 common-obj-$(CONFIG_VIRTIO) += virtio-input-hid.o
+ifeq ($(CONFIG_LINUX),y)
 common-obj-$(CONFIG_VIRTIO) += virtio-input-host.o
 endif
 
Signature · 1 line
1.8.3.1