summary refs log tree commit diff stats
path: root/include/hw/virtio/virtio-input.h
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2019-05-13 12:46:47 +0100
committerPeter Maydell <peter.maydell@linaro.org>2019-05-13 12:46:48 +0100
commit082b4061a4a28549bcb22ba3bab8e477e4fca018 (patch)
tree4dc5d995a1a4106ad79d7153cad25510cd8e4c83 /include/hw/virtio/virtio-input.h
parent04d6556c5c91d6b00c70df7b85e1715a7c7870df (diff)
parent503591cb6c28c3ddbe38ea50cab2f0dd3d6cd929 (diff)
downloadfocaccia-qemu-082b4061a4a28549bcb22ba3bab8e477e4fca018.tar.gz
focaccia-qemu-082b4061a4a28549bcb22ba3bab8e477e4fca018.zip
Merge remote-tracking branch 'remotes/kraxel/tags/input-20190513-v2-pull-request' into staging
input: add vhost-user-input, virtio-input fixes.

# gpg: Signature made Mon 13 May 2019 07:52:39 BST
# gpg:                using RSA key 4CB6D8EED3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" [full]
# gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>" [full]
# gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>" [full]
# Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138

* remotes/kraxel/tags/input-20190513-v2-pull-request:
  virtio-input: fix Kconfig dependency and Makefile
  virtio-input-host-pci: cleanup types
  util: simplify unix_listen()
  Add vhost-user-input-pci
  Add vhost-user-backend
  libvhost-user: add PROTOCOL_F_CONFIG if {set, get}_config
  libvhost-user: fix -Waddress-of-packed-member

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'include/hw/virtio/virtio-input.h')
-rw-r--r--include/hw/virtio/virtio-input.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/hw/virtio/virtio-input.h b/include/hw/virtio/virtio-input.h
index 054c38836f..4fca03e796 100644
--- a/include/hw/virtio/virtio-input.h
+++ b/include/hw/virtio/virtio-input.h
@@ -2,6 +2,7 @@
 #define QEMU_VIRTIO_INPUT_H
 
 #include "ui/input.h"
+#include "sysemu/vhost-user-backend.h"
 
 /* ----------------------------------------------------------------- */
 /* virtio input protocol                                             */
@@ -42,11 +43,18 @@ typedef struct virtio_input_event virtio_input_event;
 #define VIRTIO_INPUT_HOST_GET_PARENT_CLASS(obj) \
         OBJECT_GET_PARENT_CLASS(obj, TYPE_VIRTIO_INPUT_HOST)
 
+#define TYPE_VHOST_USER_INPUT   "vhost-user-input"
+#define VHOST_USER_INPUT(obj)                              \
+    OBJECT_CHECK(VHostUserInput, (obj), TYPE_VHOST_USER_INPUT)
+#define VHOST_USER_INPUT_GET_PARENT_CLASS(obj)             \
+    OBJECT_GET_PARENT_CLASS(obj, TYPE_VHOST_USER_INPUT)
+
 typedef struct VirtIOInput VirtIOInput;
 typedef struct VirtIOInputClass VirtIOInputClass;
 typedef struct VirtIOInputConfig VirtIOInputConfig;
 typedef struct VirtIOInputHID VirtIOInputHID;
 typedef struct VirtIOInputHost VirtIOInputHost;
+typedef struct VHostUserInput VHostUserInput;
 
 struct VirtIOInputConfig {
     virtio_input_config               config;
@@ -98,6 +106,12 @@ struct VirtIOInputHost {
     int                               fd;
 };
 
+struct VHostUserInput {
+    VirtIOInput                       parent_obj;
+
+    VhostUserBackend                  *vhost;
+};
+
 void virtio_input_send(VirtIOInput *vinput, virtio_input_event *event);
 void virtio_input_init_config(VirtIOInput *vinput,
                               virtio_input_config *config);