]> git.proxmox.com Git - qemu.git/blobdiff - hw/hid.h
virtio-scsi: factor checks for VIRTIO_SCSI_S_DRIVER_OK when reporting events
[qemu.git] / hw / hid.h
index 9ce03b118c9db127a8397fc728922f95f8c80b3f..5315cf7a31fa4fb2e553b02e0c935a707d48d71a 100644 (file)
--- a/hw/hid.h
+++ b/hw/hid.h
@@ -1,6 +1,8 @@
 #ifndef QEMU_HID_H
 #define QEMU_HID_H
 
+#include "vmstate.h"
+
 #define HID_MOUSE     1
 #define HID_TABLET    2
 #define HID_KEYBOARD  3
@@ -56,4 +58,25 @@ int hid_pointer_poll(HIDState *hs, uint8_t *buf, int len);
 int hid_keyboard_poll(HIDState *hs, uint8_t *buf, int len);
 int hid_keyboard_write(HIDState *hs, uint8_t *buf, int len);
 
+extern const VMStateDescription vmstate_hid_keyboard_device;
+
+#define VMSTATE_HID_KEYBOARD_DEVICE(_field, _state) {                \
+    .name       = (stringify(_field)),                               \
+    .size       = sizeof(HIDState),                                  \
+    .vmsd       = &vmstate_hid_keyboard_device,                      \
+    .flags      = VMS_STRUCT,                                        \
+    .offset     = vmstate_offset_value(_state, _field, HIDState),    \
+}
+
+extern const VMStateDescription vmstate_hid_ptr_device;
+
+#define VMSTATE_HID_POINTER_DEVICE(_field, _state) {                 \
+    .name       = (stringify(_field)),                               \
+    .size       = sizeof(HIDState),                                  \
+    .vmsd       = &vmstate_hid_ptr_device,                           \
+    .flags      = VMS_STRUCT,                                        \
+    .offset     = vmstate_offset_value(_state, _field, HIDState),    \
+}
+
+
 #endif /* QEMU_HID_H */