Regenerate bindgen files and partially automate the process
Reason for This PR
Fixes #361
Description of Changes
Partially automate the bindings generation process and regenerate them to avoid compiler warnings and errors when upgrading the rust toolchain version.
- [ ] This functionality can be added in
rust-vmm.
License Acceptance
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
PR Checklist
[Author TODO: Meet these criteria.]
[Reviewer TODO: Verify that these criteria are met. Request changes if not]
- [X] All commits in this PR are signed (
git commit -s). - [X] The issue which led to this PR has a clear conclusion.
- [ ] This PR follows the solution outlined in the related issue.
- [X] The description of changes is clear and encompassing.
- [ ] Any required documentation changes (code and docs) are included in this PR.
- [ ] Any newly added
unsafecode is properly documented. - [ ] Any API changes follow the Runbook for Firecracker API changes.
- [ ] Any user-facing changes are mentioned in
CHANGELOG.md. - [ ] All added/changed functionality is tested.
We may be able to avoid having to manually generate these bindings by using https://github.com/rust-vmm/vm-virtio (e.g. specifically https://github.com/rust-vmm/vm-virtio/tree/main/crates/virtio-bindings/src/bindings_v5_0_0), I think the rest of what we manually generate is covered by https://crates.io/crates/libc.
We may be able to avoid having to manually generate these bindings by using https://github.com/rust-vmm/vm-virtio (e.g. specifically https://github.com/rust-vmm/vm-virtio/tree/main/crates/virtio-bindings/src/bindings_v5_0_0), I think the rest of what we manually generate is covered by https://crates.io/crates/libc.
We are also going to regenerate the virtio bindings soon using the latest bindgen version which generates safer code. For now, it would be indeed better to just use virtio-bindings from crates.io.