17 breaking releases

new 0.17.0 Apr 23, 2024
0.16.0 Jan 3, 2024
0.15.0 Aug 8, 2023
0.14.0 May 29, 2023
0.0.1 Feb 28, 2019

#1 in Emulators

Download history 11792/week @ 2024-01-02 13559/week @ 2024-01-09 18748/week @ 2024-01-16 19506/week @ 2024-01-23 16385/week @ 2024-01-30 23316/week @ 2024-02-06 21829/week @ 2024-02-13 15481/week @ 2024-02-20 15506/week @ 2024-02-27 15988/week @ 2024-03-05 16294/week @ 2024-03-12 20388/week @ 2024-03-19 9820/week @ 2024-03-26 15741/week @ 2024-04-02 11445/week @ 2024-04-09 8825/week @ 2024-04-16

48,376 downloads per month
Used in 14 crates (8 directly)

Apache-2.0 OR MIT

300KB
4K 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:v16
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
~36K SLoC