vhost-device/vhost-device-input
dependabot[bot] e9013f4735 build(deps): bump the vhost-device group with 11 updates
Bumps the vhost-device group with 11 updates:

| Package | From | To |
| --- | --- | --- |
| [clap](https://github.com/clap-rs/clap) | `4.4.11` | `4.4.12` |
| [thiserror](https://github.com/dtolnay/thiserror) | `1.0.50` | `1.0.56` |
| [tempfile](https://github.com/Stebalien/tempfile) | `3.8.1` | `3.9.0` |
| [nix](https://github.com/nix-rust/nix) | `0.26.4` | `0.27.1` |
| [async-trait](https://github.com/dtolnay/async-trait) | `0.1.74` | `0.1.77` |
| [clang-sys](https://github.com/KyleMayes/clang-sys) | `1.6.1` | `1.7.0` |
| [home](https://github.com/rust-lang/cargo) | `0.5.5` | `0.5.9` |
| [is-terminal](https://github.com/sunfishcode/is-terminal) | `0.4.9` | `0.4.10` |
| [memchr](https://github.com/BurntSushi/memchr) | `2.6.4` | `2.7.1` |
| [pkg-config](https://github.com/rust-lang/pkg-config-rs) | `0.3.27` | `0.3.28` |
| [winnow](https://github.com/winnow-rs/winnow) | `0.5.26` | `0.5.31` |

Updates `clap` from 4.4.11 to 4.4.12
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/v4.4.11...v4.4.12)

Updates `thiserror` from 1.0.50 to 1.0.56
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](https://github.com/dtolnay/thiserror/compare/1.0.50...1.0.56)

Updates `tempfile` from 3.8.1 to 3.9.0
- [Changelog](https://github.com/Stebalien/tempfile/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Stebalien/tempfile/compare/v3.8.1...v3.9.0)

Updates `nix` from 0.26.4 to 0.27.1
- [Changelog](https://github.com/nix-rust/nix/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nix-rust/nix/compare/v0.26.4...v0.27.1)

Updates `async-trait` from 0.1.74 to 0.1.77
- [Release notes](https://github.com/dtolnay/async-trait/releases)
- [Commits](https://github.com/dtolnay/async-trait/commits)

Updates `clang-sys` from 1.6.1 to 1.7.0
- [Release notes](https://github.com/KyleMayes/clang-sys/releases)
- [Changelog](https://github.com/KyleMayes/clang-sys/blob/master/CHANGELOG.md)
- [Commits](https://github.com/KyleMayes/clang-sys/compare/v1.6.1...v1.7.0)

Updates `home` from 0.5.5 to 0.5.9
- [Changelog](https://github.com/rust-lang/cargo/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/cargo/commits)

Updates `is-terminal` from 0.4.9 to 0.4.10
- [Commits](https://github.com/sunfishcode/is-terminal/compare/v0.4.9...v0.4.10)

Updates `memchr` from 2.6.4 to 2.7.1
- [Commits](https://github.com/BurntSushi/memchr/compare/2.6.4...2.7.1)

Updates `pkg-config` from 0.3.27 to 0.3.28
- [Changelog](https://github.com/rust-lang/pkg-config-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/pkg-config-rs/compare/0.3.27...0.3.28)

Updates `winnow` from 0.5.26 to 0.5.31
- [Changelog](https://github.com/winnow-rs/winnow/blob/main/CHANGELOG.md)
- [Commits](https://github.com/winnow-rs/winnow/compare/v0.5.26...v0.5.31)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: vhost-device
- dependency-name: thiserror
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: vhost-device
- dependency-name: tempfile
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: vhost-device
- dependency-name: nix
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: vhost-device
- dependency-name: async-trait
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: vhost-device
- dependency-name: clang-sys
  dependency-type: indirect
  update-type: version-update:semver-minor
  dependency-group: vhost-device
- dependency-name: home
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: vhost-device
- dependency-name: is-terminal
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: vhost-device
- dependency-name: memchr
  dependency-type: indirect
  update-type: version-update:semver-minor
  dependency-group: vhost-device
- dependency-name: pkg-config
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: vhost-device
- dependency-name: winnow
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: vhost-device
...

Signed-off-by: dependabot[bot] <support@github.com>
[sgarzare] vhost-device-input: enabled `ioctl` feature of `nix` crate
to fix a build issue since it is now needed to use ioctl's macro like
`ioctl_read_buf`, etc.
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
2024-01-02 09:42:42 +01:00
..
src input: Add test cases 2023-12-07 17:35:26 +02:00
Cargo.toml build(deps): bump the vhost-device group with 11 updates 2024-01-02 09:42:42 +01:00
CHANGELOG.md input: Initial support for input emulation 2023-12-07 17:35:26 +02:00
LICENSE-APACHE input: Initial support for input emulation 2023-12-07 17:35:26 +02:00
LICENSE-BSD-3-Clause input: Initial support for input emulation 2023-12-07 17:35:26 +02:00
README.md input: Initial support for input emulation 2023-12-07 17:35:26 +02:00

vhost-device-input

Synopsis

vhost-device-input --socket-path <SOCKET_PATH> --event-list <EVENT_LIST>

Description

This program is a vhost-user backend that emulates a VirtIO input event. It polls on a host's input event device (/dev/input/eventX) and passes the input event data to guests.

This program is tested with QEMU's vhost-user-input-pci. The implemenation is based on the vhost-user protocol and as such should be interoperable with other virtual machine managers. Please see below for working examples.

Options

    -h, --help
        Print help.

    -s, --socket-path <SOCKET_PATH>
        Location of vhost-user Unix domain sockets, this path will be suffixed with
        0,1,2..event_count-1.

    -e, --event-list <EVENT_LIST>
        Input event device list in the format: event_device1,event_device2,...
        Example: --event-list /dev/input/event14,/dev/input/event15

Examples

The daemon should be started first:

host# vhost-device-input --socket-path /some/path/input.sock    \
      --event-list /dev/input/event14,/dev/input/event15

Note that from the above command the socket path "/some/path/input.sock0" and "/some/path/input.sock1" will be created for input events "event14" and "event15" respectively. This in turn needs to be communicated as chardev sockets to QEMU in order for the backend daemon and access the Virtio queues with the guest over the shared memory.

host# qemu-system -M virt                                                   \
      -object memory-backend-file,id=mem,size=4G,mem-path=/dev/shm,share=on \
      -chardev socket,path=/some/path/input.sock0,id=kbd0                   \
      -device vhost-user-input-pci,chardev=kdb0                             \
      -chardev socket,path=/some/path/input.sock1,id=mouse0                 \
      -device vhost-user-input-pci,chardev=mouse0                           \
      -numa node,memdev=mem                                                 \
      ...

License

This project is licensed under either of