firecracker
firecracker copied to clipboard
Fix bindgen.sh and solve TODO
Changes
- Fix
bindgen.sh - Generates Rust code from
prctl.hand solve TODO
Reason
bindgen.sh is broken for the following reasons:
--size_t-is-usizewas removed since it became default behavior.*_gencrates were moved undervmmcrate and patchingiff.rsno longer works.
Additional Info
ABI is compatbile.
# python3 tools/test_bindings.py firecracker_old firecracker_new
INFO:__main__:struct 'b'<serde::de::impls::ArrayVisitor<[kvm_bindings::x86_64::bindings::kvm_xcr; 16]> as serde::de::Expected>::'' matches
INFO:__main__:struct 'b'<&kvm_bindings::x86_64::bindings::kvm_cpuid2 as core::fmt::Debug>::'' matches
INFO:__main__:struct 'b'<&kvm_bindings::x86_64::bindings::kvm_pit_channel_state as core::fmt::Debug>::'' matches
INFO:__main__:struct 'b'<&kvm_bindings::x86_64::bindings::kvm_msrs as core::fmt::Debug>::'' matches
INFO:__main__:struct 'b'<&kvm_bindings::x86_64::bindings::kvm_msr_list as core::fmt::Debug>::'' matches
INFO:__main__:struct 'b'<&kvm_bindings::x86_64::bindings::kvm_xcr as core::fmt::Debug>::'' matches
INFO:__main__:struct 'b'<&kvm_bindings::x86_64::bindings::kvm_debug_exit_arch as core::fmt::Debug>::'' matches
INFO:__main__:struct 'b'<&kvm_bindings::x86_64::bindings::__IncompleteArrayField<kvm_bindings::x86_64::bindings::kvm_msr_entry> as core::fmt::Debug>::'' matches
INFO:__main__:struct 'b'<[kvm_bindings::x86_64::bindings::kvm_xcr; 16] as core::fmt::Debug>::'' matches
INFO:__main__:struct 'b'<kvm_bindings::x86_64::bindings::kvm_segment as core::fmt::Debug>::'' matches
INFO:__main__:struct 'b'<kvm_bindings::x86_64::bindings::kvm_dtable as core::fmt::Debug>::'' matches
INFO:__main__:struct 'b'<&kvm_bindings::x86_64::bindings::__IncompleteArrayField<u32> as core::fmt::Debug>::'' matches
INFO:__main__:struct 'b'<&kvm_bindings::x86_64::bindings::__IncompleteArrayField<kvm_bindings::x86_64::bindings::kvm_cpuid_entry2> as core::fmt::Debug>::'' matches
INFO:__main__:struct 'b'<&alloc::vec::Vec<kvm_bindings::x86_64::bindings::kvm_msr_list, alloc::alloc::Global> as core::fmt::Debug>::'' matches
INFO:__main__:struct 'b'<&alloc::vec::Vec<kvm_bindings::x86_64::bindings::kvm_cpuid2, alloc::alloc::Global> as core::fmt::Debug>::'' matches
INFO:__main__:struct 'b'<[kvm_bindings::x86_64::bindings::kvm_pit_channel_state; 3] as core::fmt::Debug>::'' matches
INFO:__main__:struct 'b'<kvm_bindings::x86_64::bindings::kvm_vcpu_events__bindgen_ty_1 as core::fmt::Debug>::'' matches
INFO:__main__:struct 'b'<kvm_bindings::x86_64::bindings::kvm_vcpu_events__bindgen_ty_2 as core::fmt::Debug>::'' matches
INFO:__main__:struct 'b'<kvm_bindings::x86_64::bindings::kvm_vcpu_events__bindgen_ty_3 as core::fmt::Debug>::'' matches
INFO:__main__:struct 'b'<kvm_bindings::x86_64::bindings::kvm_vcpu_events__bindgen_ty_4 as core::fmt::Debug>::'' matches
INFO:__main__:struct 'b'<kvm_bindings::x86_64::bindings::kvm_vcpu_events__bindgen_ty_5 as core::fmt::Debug>::'' matches
INFO:__main__:struct 'b'<serde::de::impls::ArrayVisitor<[kvm_bindings::x86_64::bindings::kvm_pit_channel_state; 3]> as serde::de::Expected>::'' matches
INFO:__main__:struct 'b'<vmm_sys_util::fam::FamStructWrapper<kvm_bindings::x86_64::bindings::kvm_cpuid2> as core::fmt::Debug>::'' matches
INFO:__main__:struct 'b'<alloc::vec::Vec<kvm_bindings::x86_64::bindings::kvm_msrs, alloc::alloc::Global> as core::fmt::Debug>::'' matches
INFO:__main__:struct 'b'<kvm_bindings::x86_64::bindings::kvm_debugregs as core::fmt::Debug>::'' matches
INFO:__main__:struct 'b'<kvm_bindings::x86_64::bindings::kvm_lapic_state as core::fmt::Debug>::'' matches
INFO:__main__:struct 'b'<kvm_bindings::x86_64::bindings::kvm_mp_state as core::fmt::Debug>::'' matches
INFO:__main__:struct 'b'<kvm_bindings::x86_64::bindings::kvm_regs as core::fmt::Debug>::'' matches
INFO:__main__:struct 'b'<kvm_bindings::x86_64::bindings::kvm_sregs as core::fmt::Debug>::'' matches
INFO:__main__:struct 'b'<kvm_bindings::x86_64::bindings::kvm_vcpu_events as core::fmt::Debug>::'' matches
INFO:__main__:struct 'b'<kvm_bindings::x86_64::bindings::kvm_xcrs as core::fmt::Debug>::'' matches
INFO:__main__:struct 'b'<kvm_bindings::x86_64::bindings::kvm_xsave as core::fmt::Debug>::'' matches
INFO:__main__:struct 'b'<kvm_bindings::x86_64::bindings::kvm_pit_state2 as core::fmt::Debug>::'' matches
INFO:__main__:struct 'b'<kvm_bindings::x86_64::bindings::kvm_clock_data as core::fmt::Debug>::'' matches
INFO:__main__:struct 'b'<&vmm_sys_util::fam::FamStructWrapper<kvm_bindings::x86_64::bindings::kvm_msr_list> as core::fmt::Debug>::'' matches
INFO:__main__:struct 'b'*mut [kvm_bindings::x86_64::bindings::kvm_msrs] '' matches
INFO:__main__:struct 'b'&mut [kvm_bindings::x86_64::bindings::kvm_cpuid_entry2] '' matches
INFO:__main__:struct 'b'&mut [kvm_bindings::x86_64::bindings::kvm_msr_entry] '' matches
INFO:__main__:struct 'b'&[kvm_bindings::x86_64::bindings::kvm_cpuid_entry2] '' matches
INFO:__main__:struct 'b'&[kvm_bindings::x86_64::bindings::kvm_msr_entry] '' matches
INFO:__main__:struct 'b'&[vmm::io_uring::bindings::io_uring_probe_op] '' matches
INFO:__main__:struct 'b'&[kvm_bindings::x86_64::bindings::kvm_pit_channel_state] '' matches
INFO:__main__:struct 'b'&[kvm_bindings::x86_64::bindings::kvm_xcr] '' matches
INFO:__main__:struct 'b'&[kvm_bindings::x86_64::bindings::kvm_msr_list] '' matches
INFO:__main__:struct 'b'&[kvm_bindings::x86_64::bindings::kvm_msrs] '' matches
INFO:__main__:struct 'b'&[kvm_bindings::x86_64::bindings::kvm_cpuid2] '' matches
INFO:__main__:struct 'b'&[vmm_sys_util::fam::FamStructWrapper<kvm_bindings::x86_64::bindings::kvm_msrs>] '' matches
INFO:__main__:struct 'b'&mut [kvm_bindings::x86_64::bindings::kvm_msrs] '' matches
INFO:__main__:struct 'b'*const [vmm::io_uring::bindings::io_uring_probe_op] '' matches
INFO:__main__:struct 'b'*mut [vmm::io_uring::bindings::io_uring_probe_op] '' matches
INFO:__main__:struct 'b'*const [kvm_bindings::x86_64::bindings::kvm_msrs] '' matches
INFO:__main__:struct 'b'&mut [vmm::io_uring::bindings::io_uring_restriction] '' matches
INFO:__main__:struct 'b'*mut [vmm::io_uring::bindings::io_uring_restriction] '' matches
INFO:__main__:struct 'b'*const [kvm_bindings::x86_64::bindings::kvm_cpuid_entry2] '' matches
INFO:__main__:struct 'b'*const [kvm_bindings::x86_64::bindings::kvm_msr_entry] '' matches
INFO:__main__:struct 'b'*mut [kvm_bindings::x86_64::bindings::kvm_msr_entry] '' matches
INFO:__main__:struct 'b'(*mut [kvm_bindings::x86_64::bindings::kvm_msr_entry], alloc::alloc::Global) '' matches
INFO:__main__:struct 'b'alloc::boxed::Box<[kvm_bindings::x86_64::bindings::kvm_msr_entry], alloc::alloc::Global> '' matches
INFO:__main__:struct 'b'(core::ptr::unique::Unique<[kvm_bindings::x86_64::bindings::kvm_msr_entry]>, alloc::alloc::Global) '' matches
INFO:__main__:struct 'b'*const [kvm_bindings::x86_64::bindings::kvm_cpuid2] '' matches
INFO:__main__:struct 'b'*const [kvm_bindings::x86_64::bindings::kvm_msr_list] '' matches
INFO:__main__:struct 'b'*mut [kvm_bindings::x86_64::bindings::kvm_cpuid_entry2] '' matches
INFO:__main__:struct 'b'*mut [vmm_sys_util::fam::FamStructWrapper<kvm_bindings::x86_64::bindings::kvm_msrs>] '' matches
INFO:__main__:struct 'b'*mut [vmm::io_uring::bindings::io_uring_probe] '' matches
INFO:__main__:struct 'b'*const [vmm_sys_util::fam::FamStructWrapper<kvm_bindings::x86_64::bindings::kvm_msrs>] '' matches
INFO:__main__:struct 'b'&[vmm::io_uring::bindings::io_uring_probe] '' matches
INFO:__main__:struct 'b'*const [vmm::io_uring::bindings::io_uring_probe] '' matches
INFO:__main__:struct 'b'&mut [vmm::io_uring::bindings::io_uring_probe] '' matches
INFO:__main__:struct 'b'&mut [vmm::io_uring::bindings::io_uring_probe_op] '' matches
INFO:__main__:struct 'b'*mut [kvm_bindings::x86_64::bindings::kvm_msr_list] '' matches
INFO:__main__:struct 'b'*mut [kvm_bindings::x86_64::bindings::kvm_cpuid2] '' matches
INFO:__main__:struct 'b'&mut [kvm_bindings::x86_64::bindings::kvm_msr_list] '' matches
INFO:__main__:struct 'b'&mut [kvm_bindings::x86_64::bindings::kvm_cpuid2] '' matches
INFO:__main__:struct 'b'<&kvm_bindings::x86_64::bindings::kvm_ioapic_state__bindgen_ty_1 as core::fmt::Debug>::'' matches
INFO:__main__:struct 'b'&[kvm_bindings::x86_64::bindings::kvm_ioapic_state__bindgen_ty_1] '' matches
INFO:__main__:Structure layout matches
License Acceptance
By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache 2.0 license. For more information on following Developer
Certificate of Origin and signing off your commits, please check
CONTRIBUTING.md.
PR Checklist
- ~~[ ] If a specific issue led to this PR, this PR closes the issue.~~
- [x] The description of changes is clear and encompassing.
- ~~[ ] Any required documentation changes (code and docs) are included in this PR.~~
- ~~[ ] API changes follow the Runbook for Firecracker API changes.~~
- ~~[ ] User-facing changes are mentioned in
CHANGELOG.md.~~ - [x] All added/changed functionality is tested.
- ~~[ ] New
TODOs link to an issue.~~ - [x] Commits meet contribution quality standards.
- [x] This functionality cannot be added in
rust-vmm.
Codecov Report
Attention: Patch coverage is 29.86340% with 1489 lines in your changes missing coverage. Please review.
Project coverage is 79.92%. Comparing base (
7025008) to head (c3f6504).
Additional details and impacted files
@@ Coverage Diff @@
## main #4520 +/- ##
==========================================
- Coverage 82.00% 79.92% -2.08%
==========================================
Files 254 254
Lines 31195 29930 -1265
==========================================
- Hits 25581 23923 -1658
- Misses 5614 6007 +393
| Flag | Coverage Δ | |
|---|---|---|
| 5.10-c5n.metal | 79.74% <29.90%> (-2.28%) |
:arrow_down: |
| 5.10-m5n.metal | 79.72% <29.90%> (-2.29%) |
:arrow_down: |
| 5.10-m6a.metal | 78.91% <29.90%> (-2.40%) |
:arrow_down: |
| 5.10-m6g.metal | 77.04% <30.47%> (-2.01%) |
:arrow_down: |
| 5.10-m6i.metal | 79.72% <29.90%> (-2.28%) |
:arrow_down: |
| 5.10-m7g.metal | 77.04% <30.47%> (-2.01%) |
:arrow_down: |
| 6.1-c5n.metal | 79.74% <29.90%> (-2.28%) |
:arrow_down: |
| 6.1-m5n.metal | 79.72% <29.90%> (?) |
|
| 6.1-m6a.metal | 78.91% <29.90%> (-2.40%) |
:arrow_down: |
| 6.1-m6g.metal | 77.03% <30.47%> (-2.01%) |
:arrow_down: |
| 6.1-m6i.metal | 79.71% <29.90%> (-2.29%) |
:arrow_down: |
| 6.1-m7g.metal | 77.04% <30.47%> (-2.01%) |
:arrow_down: |
Flags with carried forward coverage won't be shown. Click here to find out more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Huh, I didn't realize the bindings are included in the coverage reports. Should we exclude them? The bindgen generated unit tests are not a inside of test modules, so their lines are included in coverage reports, but since they have assert!s, all the assertion messages are considered "uncovered", which is nonsense.
Closing this in favor of PR #4729.