Setup development environment for vhost-device
This is a description for how to setup development environment for vhost-virtio. In this documentation, it uses virtio-rng as an example for the building steps and how to launch the QEMU and vhost-virtio programs.
Build vhost-device
Checkout the main branch of the vhost-device package:
$ git clone https://github.com/rust-vmm/vhost-device
Build the dependency libarary libgpiod:
$ git clone --depth 1 --branch v2.0.x https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/ $ cd libgpiod $ ./autogen.sh --prefix="$PWD/install/" $ make install
Build the vhost-device daemons. After building, binaries are located under the folder “target/debug/":
$ cargo build
Build QEMU (v6.0.0)
Download QEMU code base and checkout tag v6.0.0:
Apply three offline patches:
These three patches are placed in the folder
hackbox2:/home/mathieu.poirier/for-leo/patches/qemu
.Build QEMU:
Run virtual machine
Run vhost-device-rng in the vhost-device directory:
Run QEMU for creating Arm64 virtual machine:
The images
efi.img
,varstore.img
,disk.img
, andImage
have been uploaded in the folderhackbox2: /home/mathieu.poirier/for-leo/
.
Notes
In the folder hackbox2: /home/mathieu.poirier/for-leo/patches/debug
, there is a debug patch to apply to the vhost-device-rng to help understand how things work. There are instructions in the changelog to exercise the daemon from the virtualized kernel.