]>
Commit | Line | Data |
---|---|---|
887d5775 LY |
1 | .. _vhost_user_input: |
2 | ||
3 | QEMU vhost-user-input - Input emulation | |
4 | ======================================= | |
5 | ||
6 | This document describes the setup and usage of the Virtio input device. | |
7 | The Virtio input device is a paravirtualized device for input events. | |
8 | ||
9 | Description | |
10 | ----------- | |
11 | ||
12 | The vhost-user-input device implementation was designed to work with a daemon | |
13 | polling on input devices and passes input events to the guest. | |
14 | ||
15 | QEMU provides a backend implementation in contrib/vhost-user-input. | |
16 | ||
17 | Linux kernel support | |
18 | -------------------- | |
19 | ||
20 | Virtio input requires a guest Linux kernel built with the | |
21 | ``CONFIG_VIRTIO_INPUT`` option. | |
22 | ||
23 | Examples | |
24 | -------- | |
25 | ||
26 | The backend daemon should be started first: | |
27 | ||
28 | :: | |
29 | ||
30 | host# vhost-user-input --socket-path=input.sock \ | |
31 | --evdev-path=/dev/input/event17 | |
32 | ||
33 | The QEMU invocation needs to create a chardev socket to communicate with the | |
34 | backend daemon and access the VirtIO queues with the guest over the | |
35 | :ref:`shared memory <shared_memory_object>`. | |
36 | ||
37 | :: | |
38 | ||
39 | host# qemu-system \ | |
40 | -chardev socket,path=/tmp/input.sock,id=mouse0 \ | |
41 | -device vhost-user-input-pci,chardev=mouse0 \ | |
42 | -m 4096 \ | |
43 | -object memory-backend-file,id=mem,size=4G,mem-path=/dev/shm,share=on \ | |
44 | -numa node,memdev=mem \ | |
45 | ... |