Skip to content
This repository was archived by the owner on Nov 6, 2024. It is now read-only.

Commit 84d39fe

Browse files
lauraltandreeaflorescu
authored andcommitted
document potential undefined behavior
Mentioned in README about potential undefined behavior with incompatible versions. Signed-off-by: Alexandru Agache <aagch@amazon.com>
1 parent e3a8248 commit 84d39fe

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,23 @@
22
[![Crates.io](https://img.shields.io/crates/v/kvm-bindings.svg)](https://crates.io/crates/kvm-bindings)
33
![](https://img.shields.io/crates/l/kvm-bindings.svg)
44
# kvm-bindings
5-
Rust FFI bindings to KVM generated using
5+
Rust FFI bindings to KVM, generated using
66
[bindgen](https://crates.io/crates/bindgen). It currently has support for the
77
following target architectures:
88
- x86
99
- x86_64
1010
- arm
1111
- arm64
1212

13+
The bindings exported by this crate are statically generated using header files
14+
associated with a specific kernel version, and are not automatically synced with
15+
the kernel version running on a particular host. The user must ensure that
16+
specific structures, members, or constants are supported and valid for the
17+
kernel version they are using. For example, the `immediate_exit` field from the
18+
`kvm_run` structure is only meaningful if the `KVM_CAP_IMMEDIATE_EXIT`
19+
capability is available. Using invalid fields or features may lead to undefined
20+
behaviour.
21+
1322
# Usage
1423
First, add the following to your `Cargo.toml`:
1524
```toml

src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
// SPDX-License-Identifier: Apache-2.0
33

4+
//! Rust FFI bindings to KVM, generated using [bindgen](https://crates.io/crates/bindgen).
5+
46
#![allow(non_upper_case_globals)]
57
#![allow(non_camel_case_types)]
68
#![allow(non_snake_case)]

0 commit comments

Comments
 (0)