42 lines
1.4 KiB
Diff
42 lines
1.4 KiB
Diff
--- a/contrib/vhost-user-input/main.c 2020-12-08 17:59:44.000000000 +0100
|
|
+++ b/contrib/vhost-user-input/main.c 2020-12-12 20:59:04.316996648 +0100
|
|
@@ -114,14 +114,17 @@
|
|
|
|
static void vi_handle_status(VuInput *vi, virtio_input_event *event)
|
|
{
|
|
+ struct timeval tv;
|
|
struct input_event evdev;
|
|
int rc;
|
|
|
|
- if (gettimeofday(&evdev.time, NULL)) {
|
|
+ if (gettimeofday(&tv, NULL)) {
|
|
perror("vi_handle_status: gettimeofday");
|
|
return;
|
|
}
|
|
|
|
+ evdev.input_event_sec = tv.tv_sec;
|
|
+ evdev.input_event_usec = tv.tv_usec;
|
|
evdev.type = le16toh(event->type);
|
|
evdev.code = le16toh(event->code);
|
|
evdev.value = le32toh(event->value);
|
|
--- a/hw/input/virtio-input-host.c 2020-12-08 17:59:44.000000000 +0100
|
|
+++ b/hw/input/virtio-input-host.c 2020-12-12 21:33:44.750471890 +0100
|
|
@@ -192,14 +192,17 @@
|
|
virtio_input_event *event)
|
|
{
|
|
VirtIOInputHost *vih = VIRTIO_INPUT_HOST(vinput);
|
|
+ struct timeval tv;
|
|
struct input_event evdev;
|
|
int rc;
|
|
|
|
- if (gettimeofday(&evdev.time, NULL)) {
|
|
+ if (gettimeofday(&tv, NULL)) {
|
|
perror("virtio_input_host_handle_status: gettimeofday");
|
|
return;
|
|
}
|
|
|
|
+ evdev.input_event_sec = tv.tv_sec;
|
|
+ evdev.input_event_usec = tv.tv_usec;
|
|
evdev.type = le16_to_cpu(event->type);
|
|
evdev.code = le16_to_cpu(event->code);
|
|
evdev.value = le32_to_cpu(event->value);
|