6 releases (breaking)

0.5.0 Jan 29, 2020
0.4.0 Nov 28, 2019
0.3.0 Oct 28, 2019
0.2.0 Jun 25, 2019
0.0.1 Feb 28, 2019

#2 in #kvm

Download history 494/week @ 2019-11-08 488/week @ 2019-11-15 600/week @ 2019-11-22 819/week @ 2019-11-29 900/week @ 2019-12-06 586/week @ 2019-12-13 265/week @ 2019-12-20 283/week @ 2019-12-27 658/week @ 2020-01-03 706/week @ 2020-01-10 700/week @ 2020-01-17 873/week @ 2020-01-24 723/week @ 2020-01-31 759/week @ 2020-02-07 664/week @ 2020-02-14

2,496 downloads per month
Used in uhyve

Apache-2.0 OR MIT

180KB
2.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 and aarch64. Right now the aarch64 support is considered experimental. For a production ready version, please check the progress in the corresponding GitHub issue.

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 both x86 and arm64.

docker run --device=/dev/kvm \
           -it \
           --security-opt seccomp=unconfined \
           --volume $(pwd)/kvm-ioctls:/kvm-ioctls \
           rustvmm/dev:v2
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
~54K SLoC