Skip to content

Commit 3c627cb

Browse files
Merge branch 'main' into main
2 parents 662d049 + f72ca02 commit 3c627cb

File tree

202 files changed

+52898
-2452
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

202 files changed

+52898
-2452
lines changed

virtio-bindings/CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# Upcoming Release
22

3+
# v0.2.6
4+
5+
## Changed
6+
7+
- Bindings are now once again distributed with the crate, rather than
8+
generated at build time.
9+
- Regenerate bindings with Linux 6.15.
10+
- Remove unused feature flags and build dependencies.
11+
312
# v0.2.5
413

514
## Changed

virtio-bindings/CONTRIBUTING.md

Lines changed: 13 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,28 @@
11
# Contributing to virtio-bindings
22

3-
## Overview
3+
## Dependencies
44

5-
virtio-bindings is periodically updated with imported virtio headers from the
6-
Linux kernel. The Linux header files have kernel header dependencies that are
7-
removed during import so that bindgen can process them in isolation without a
8-
full set of kernel headers. This is also necessary because the licenses of
9-
individual kernel header files varies and we only want to distribute
10-
BSD-licensed virtio headers.
5+
### Bindgen
6+
The bindings are currently generated using
7+
[bindgen](https://rust-lang.github.io/rust-bindgen/) version 0.71.1:
8+
```bash
9+
cargo install bindgen-cli --vers 0.71.1
10+
```
1111

12-
## Importing kernel headers
12+
### Linux Kernel
1313
Generating bindings depends on the Linux kernel, so you need to have the
1414
repository on your machine:
1515

1616
```bash
1717
git clone https://github.com/torvalds/linux.git
1818
```
1919

20-
Install the headers so they can be used for import:
21-
```bash
22-
cd linux
23-
git checkout <linux-version>
24-
make headers_install INSTALL_HDR_PATH=headers-<linux-version>
25-
```
20+
## Example for updating to a new kernel version
2621

27-
Import kernel headers into `include/`:
28-
```bash
29-
cd ~/vm-virtio/virtio-bindings
30-
./import-linux-headers.sh path/to/headers-<linux-version>
31-
```
22+
For this example we assume that you have both linux and virtio-bindings
23+
repositories in your home directory.
3224

33-
Test that the build still works:
3425
```bash
35-
cargo build
26+
cd ~/vm-virtio/virtio-bindings
27+
scripts/generate-bindings.sh ~/linux
3628
```
37-
38-
## Adding bindings for new header files
39-
New kernel headers can be added as follows:
40-
1. Add the new file to import-linux-headers.sh so it is imported from the Linux
41-
kernel header directory into include/.
42-
2. Add the new file to build.rs so bindgen generates bindings.
43-
3. Add the new module to src/lib.rs so the generated bindings are exposed in
44-
the crate.
45-
4. Check if `cargo build` still succeeds. If the header has new kernel header
46-
dependencies then you need to add them (if they are BSD licensed) or stub
47-
them out (if they are not BSD licensed).

virtio-bindings/Cargo.toml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "virtio-bindings"
3-
version = "0.2.5"
3+
version = "0.2.6"
44
authors = ["Sergio Lopez <[email protected]>"]
55
description = "Rust FFI bindings to virtio generated using bindgen."
66
repository = "https://github.com/rust-vmm/vm-virtio"
@@ -10,12 +10,5 @@ keywords = ["virtio"]
1010
license = "BSD-3-Clause OR Apache-2.0"
1111

1212
[features]
13-
# Kernel version features are deprecated and no longer have any effect,
14-
# as the kernel headers are backwards compatible.
15-
virtio-v4_14_0 = []
16-
virtio-v5_0_0 = []
17-
18-
[build-dependencies]
19-
bindgen = "0.72.0"
2013

2114
[dependencies]

virtio-bindings/build.rs

Lines changed: 0 additions & 39 deletions
This file was deleted.

virtio-bindings/include/linux/if_ether.h

Lines changed: 0 additions & 5 deletions
This file was deleted.

virtio-bindings/include/linux/types.h

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)