• Home
Name Date Size #Lines LOC

..--

device/03-May-2024-8,2276,288

vmm/03-May-2024-1,6381,296

README.mdD03-May-20241 KiB3120

mod.rsD03-May-20244.9 KiB148104

proxy.rsD03-May-202471 KiB1,9581,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