rust-vmm / vm-virtio

virtio implementation
Apache License 2.0
370 stars 89 forks source link

virtio-bindings: drop bindings for older kernels #192

Closed alyssais closed 2 years ago

alyssais commented 2 years ago

Summary of the PR

As pointed out by @sboeuf, the kernel headers are backwards compatible, so there's no need to maintain the bindings for multiple kernel versions. And doing so will make updating the bindings easier, as it won't require adding a new feature each time.

But before we can do that, we actually have to re-add the kernel version features to the Cargo.toml, because they were lost when virtio-bindings was imported into vm-virtio, and this would break existing users of the crate next time a release is made.

It's unfortunately not possible for us to emit a deprecation warning for the features, as in Rust deprecation warnings have to be applied to functions/constants/etc. (not modules or re-exports](https://github.com/rust-lang/rust/issues/30827)), so any deprecation warning in this crate would mean editing the generated bindings files. But it doesn't really do any harm to keep the feature declarations in the Cargo.toml around indefinitely.

Requirements

Before submitting your PR, please make sure you addressed the following requirements:

alyssais commented 2 years ago

The CI failures seem to be due to the bindings being from a very old bindgen. That will be one of my next PRs, but it's not related to this one. I could add that onto the end of this PR to make CI happy if that's required.