summaryrefslogtreecommitdiffstats
path: root/hw/virtio/virtio-pci.h
diff options
context:
space:
mode:
authorGerd Hoffmann2015-06-04 12:34:42 +0200
committerMichael S. Tsirkin2015-06-10 18:15:06 +0200
commit710e2d90da1a16807f7885d37b203ce739fdc53a (patch)
tree28650f197254ed8d8263ddf035c2a41905f5c5ae /hw/virtio/virtio-pci.h
parentvirtio-input: core code & base class [pci] (diff)
downloadqemu-710e2d90da1a16807f7885d37b203ce739fdc53a.tar.gz
qemu-710e2d90da1a16807f7885d37b203ce739fdc53a.tar.xz
qemu-710e2d90da1a16807f7885d37b203ce739fdc53a.zip
virtio-input: emulated devices [pci]
This patch adds virtio-pci support for the emulated virtio-input devices. Using them is as simple as adding "-device virtio-tablet-pci" to your command line. If you want add multiple devices but don't want waste a pci slot for each you can compose a multifunction device this way: qemu -device virtio-keyboard-pci,addr=0d.0,multifunction=on \ -device virtio-tablet-pci,addr=0d.1,multifunction=on Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/virtio/virtio-pci.h')
-rw-r--r--hw/virtio/virtio-pci.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/hw/virtio/virtio-pci.h b/hw/virtio/virtio-pci.h
index 754971f720..d962125351 100644
--- a/hw/virtio/virtio-pci.h
+++ b/hw/virtio/virtio-pci.h
@@ -41,6 +41,7 @@ typedef struct VirtIONetPCI VirtIONetPCI;
typedef struct VHostSCSIPCI VHostSCSIPCI;
typedef struct VirtIORngPCI VirtIORngPCI;
typedef struct VirtIOInputPCI VirtIOInputPCI;
+typedef struct VirtIOInputHIDPCI VirtIOInputHIDPCI;
/* virtio-pci-bus */
@@ -248,6 +249,18 @@ struct VirtIOInputPCI {
VirtIOInput vdev;
};
+#define TYPE_VIRTIO_INPUT_HID_PCI "virtio-input-hid-pci"
+#define TYPE_VIRTIO_KEYBOARD_PCI "virtio-keyboard-pci"
+#define TYPE_VIRTIO_MOUSE_PCI "virtio-mouse-pci"
+#define TYPE_VIRTIO_TABLET_PCI "virtio-tablet-pci"
+#define VIRTIO_INPUT_HID_PCI(obj) \
+ OBJECT_CHECK(VirtIOInputHIDPCI, (obj), TYPE_VIRTIO_INPUT_HID_PCI)
+
+struct VirtIOInputHIDPCI {
+ VirtIOPCIProxy parent_obj;
+ VirtIOInputHID vdev;
+};
+
/* Virtio ABI version, if we increment this, we break the guest driver. */
#define VIRTIO_PCI_ABI_VERSION 0