| Name | Date | Size | #Lines | LOC | ||
|---|---|---|---|---|---|---|
| .. | - | - | ||||
| device/ | 03-May-2024 | - | 8,227 | 6,288 | ||
| vmm/ | 03-May-2024 | - | 1,638 | 1,296 | ||
| README.md | D | 03-May-2024 | 1 KiB | 31 | 20 | |
| mod.rs | D | 03-May-2024 | 4.9 KiB | 148 | 104 | |
| proxy.rs | D | 03-May-2024 | 71 KiB | 1,958 | 1,461 | 
README.md
1# Vhost-user devices 2 3This directory contains the implementation of [vhost-user] devices and [virtio vhost-user] devices. 4 5## Code Locations 6 7- [`vmm`](./vmm/) - Implements vhost-user vmm device; i.e. vhost-user master. 8- [`device`](./device/) - Implements vhost-user device backend; i.e. vhost-user slave. 9- [`proxy.rs`](./proxy.rs) - Implements [virtio vhost-user] device, which works like a proxy 10 forwarding vhost-user messages to the guest via virtqueues. 11 12## Usage 13 14### Vhost-user 15 16First, start a vhost-user device with the `crosvm devices` command. Here we use the block device as 17an example, but the basic usage is same for all of devices. 18 19```bash 20$ crosvm devices --block vhost=/path/to/socket,path=/path/to/block.img 21``` 22 23Then start a VM with a vhost-user block device by specifying the same socket path. 24 25```bash 26$ crosvm run -r rootfs.img --vhost-user-blk /path/to/socket <crosvm arguments> 27``` 28 29[vhost-user]: https://qemu.readthedocs.io/en/latest/interop/vhost-user.html 30[virtio vhost-user]: https://wiki.qemu.org/Features/VirtioVhostUser 31