Skip to content

Commit da5eea4

Browse files
committed
doc: Adjust READMEs after repository merge
Create a shallow top-level README in the style of the rust-vmm/vhost README. Leave the individual repository READMEs alone mostly (as these will appear on crates.io), but do slight adjustments to reflect the new repository structure: - move "how to run tests" section to top level and adjust URLs with new name - Cleanup kvm-bindings README slightly to drop instruction for how to add it to your project, because crates.io already provides that info. Signed-off-by: Patrick Roy <[email protected]>
1 parent 5c0a837 commit da5eea4

File tree

3 files changed

+42
-48
lines changed

3 files changed

+42
-48
lines changed

README.md

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
[![Build Status](https://badge.buildkite.com/9e0e6c88972a3248a0908506d6946624da84e4e18c0870c4d0.svg)](https://buildkite.com/rust-vmm/kvm-ioctls-ci)
2+
3+
# kvm
4+
5+
The `kvm` workspace hosts libraries related to Rust bindings to the Kernel Virtual Machine (KVM). It currently consists of the following crates:
6+
7+
- `kvm-bindings` -> Rust FFI bindings to KVM
8+
- `kvm-ioctls` -> Safe wrappers over the KVM API
9+
10+
## Running the tests
11+
12+
Our Continuous Integration (CI) pipeline is implemented on top of
13+
[Buildkite](https://buildkite.com/).
14+
For the complete list of tests, check our
15+
[CI pipeline](https://buildkite.com/rust-vmm/kvm-ci).
16+
17+
Each individual test runs in a container. To reproduce a test locally, you can
18+
use the dev-container on x86_64, arm64 and riscv64.
19+
20+
```bash
21+
# For running riscv64 tests, replace v47 with v47-riscv. This provides an
22+
# emulated riscv64 environment on a x86_64 host.
23+
docker run --device=/dev/kvm \
24+
-it \
25+
--security-opt seccomp=unconfined \
26+
--volume $(pwd)/kvm:/kvm \
27+
rustvmm/dev:v47
28+
cd kvm-ioctls/
29+
cargo test
30+
```
31+
32+
For more details about the integration tests that are run for `kvm`,
33+
check the [rust-vmm-ci](https://github.com/rust-vmm/rust-vmm-ci) readme.

kvm-bindings/README.md

+9-24
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
[![Crates.io](https://img.shields.io/crates/v/kvm-bindings.svg)](https://crates.io/crates/kvm-bindings)
2-
![](https://img.shields.io/crates/l/kvm-bindings.svg)
1+
[![Crates.io](https://img.shields.io/crates/v/kvm-bindings.svg)]
32
# kvm-bindings
43
Rust FFI bindings to KVM, generated using
54
[bindgen](https://crates.io/crates/bindgen). It currently has support for the
@@ -17,30 +16,16 @@ kernel version they are using. For example, the `immediate_exit` field from the
1716
capability is available. Using invalid fields or features may lead to undefined
1817
behaviour.
1918

20-
## Usage
21-
First, add the following to your `Cargo.toml`:
22-
```toml
23-
kvm-bindings = "0.3"
24-
```
25-
Next, add this to your crate root:
26-
```rust
27-
extern crate kvm_bindings;
28-
```
19+
### Flexible Array Members (FAM structs)
2920

30-
This crate also offers safe wrappers over FAM structs - FFI structs that have
31-
a Flexible Array Member in their definition.
32-
These safe wrappers can be used if the `fam-wrappers` feature is enabled for
33-
this crate. Example:
34-
```toml
35-
kvm-bindings = { version = "0.3", features = ["fam-wrappers"]}
36-
```
21+
This crate optionally offers safe wrappers over FAM structs - FFI structs that
22+
have a Flexible Array Member in their definition. These safe wrappers can be
23+
used if the `fam-wrappers` feature is enabled for this crate. Note that
24+
enabling the `fam-wrappers` feature enables the `vmm-sys-util` dependency.
3725

38-
## Dependencies
39-
The crate has an `optional` dependency to
40-
[vmm-sys-util](https://crates.io/crates/vmm-sys-util) when enabling the
41-
`fam-wrappers` feature.
26+
## Serialization
4227

43-
It also has an optional dependency on [`serde`](serde.rs) when enabling the
28+
It has an optional dependency on [`serde`](serde.rs) when enabling the
4429
`serde` feature, to allow serialization of bindings. Serialization of
4530
bindings happens as opaque binary blobs via [`zerocopy`](https://google.github.io/comprehensive-rust/bare-metal/useful-crates/zerocopy.html).
4631
Due to the kernel's ABI compatibility, this means that bindings serialized
@@ -50,4 +35,4 @@ crate, even if the bindings have had been regenerated in the meantime.
5035
## Regenerating Bindings
5136

5237
Please see [`CONTRIBUTING.md`](CONTRIBUTING.md) for details on how to generate the bindings
53-
or add support for new architectures.
38+
or add support for new architectures.

kvm-ioctls/README.md

-24
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
[![Build Status](https://badge.buildkite.com/9e0e6c88972a3248a0908506d6946624da84e4e18c0870c4d0.svg)](https://buildkite.com/rust-vmm/kvm-ioctls-ci)
21
[![crates.io](https://img.shields.io/crates/v/kvm-ioctls.svg)](https://crates.io/crates/kvm-ioctls)
32

43
# kvm-ioctls
@@ -20,27 +19,4 @@ as the code documentation.
2019

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

23-
## Running the tests
2422

25-
Our Continuous Integration (CI) pipeline is implemented on top of
26-
[Buildkite](https://buildkite.com/).
27-
For the complete list of tests, check our
28-
[CI pipeline](https://buildkite.com/rust-vmm/kvm-ioctls-ci).
29-
30-
Each individual test runs in a container. To reproduce a test locally, you can
31-
use the dev-container on x86_64, arm64 and riscv64.
32-
33-
```bash
34-
# For running riscv64 tests, replace v47 with v47-riscv. This provides an
35-
# emulated riscv64 environment on a x86_64 host.
36-
docker run --device=/dev/kvm \
37-
-it \
38-
--security-opt seccomp=unconfined \
39-
--volume $(pwd)/kvm-ioctls:/kvm-ioctls \
40-
rustvmm/dev:v47
41-
cd kvm-ioctls/
42-
cargo test
43-
```
44-
45-
For more details about the integration tests that are run for `kvm-ioctls`,
46-
check the [rust-vmm-ci](https://github.com/rust-vmm/rust-vmm-ci) readme.

0 commit comments

Comments
 (0)