19 breaking releases

new 0.19.1 Dec 10, 2024
0.19.0 Oct 23, 2024
0.18.0 Aug 2, 2024
0.17.0 Apr 23, 2024
0.0.1 Feb 28, 2019

#98 in Unix APIs

Download history 7278/week @ 2024-08-23 9346/week @ 2024-08-30 7698/week @ 2024-09-06 8304/week @ 2024-09-13 7884/week @ 2024-09-20 8602/week @ 2024-09-27 8498/week @ 2024-10-04 9420/week @ 2024-10-11 10908/week @ 2024-10-18 8817/week @ 2024-10-25 9711/week @ 2024-11-01 7810/week @ 2024-11-08 7182/week @ 2024-11-15 6695/week @ 2024-11-22 9446/week @ 2024-11-29 9554/week @ 2024-12-06

34,463 downloads per month
Used in 11 crates (9 directly)

Apache-2.0 OR MIT

330KB
4.5K SLoC

Build Status crates.io

kvm-ioctls

The kvm-ioctls crate provides safe wrappers over the KVM API, a set of ioctls used for creating and configuring Virtual Machines (VMs) on Linux. The ioctls are accessible through four structures:

  • Kvm - wrappers over system ioctls
  • VmFd - wrappers over VM ioctls
  • VcpuFd - wrappers over vCPU ioctls
  • DeviceFd - wrappers over device ioctls

For further details check the KVM API as well as the code documentation.

Supported Platforms

The kvm-ioctls can be used on x86_64, aarch64 and riscv64 (experimental).

Running the tests

Our Continuous Integration (CI) pipeline is implemented on top of Buildkite. For the complete list of tests, check our CI pipeline.

Each individual test runs in a container. To reproduce a test locally, you can use the dev-container on x86_64, arm64 and riscv64.

# For running riscv64 tests, replace v47 with v47-riscv. This provides an
# emulated riscv64 environment on a x86_64 host.
docker run --device=/dev/kvm \
           -it \
           --security-opt seccomp=unconfined \
           --volume $(pwd)/kvm-ioctls:/kvm-ioctls \
           rustvmm/dev:v47
cd kvm-ioctls/
cargo test

For more details about the integration tests that are run for kvm-ioctls, check the rust-vmm-ci readme.

Dependencies

~1.5MB
~38K SLoC