rust-vmm / vmm-sys-util

Helpers and utilities used by multiple rust-vmm components and VMMs
BSD 3-Clause "New" or "Revised" License
78 stars 64 forks source link

Make `as_mut_fam_struct()` public and unsafe #215

Closed bchalios closed 8 months ago

bchalios commented 8 months ago

Summary of the PR

We previously made as_mut_fam_struct() of FamStructWrapper private so that we avoid that users modify the length of the header under our feet. However, this disallows callers to modify other parts of the header (which is totally safe to do).

Make as_mut_fam_struct() public again, but also mark it as unsafe, asking users to guarantee that they will not change the length stored within the header directly, via the mutable reference.

Also, prepare for release v0.12.1

Requirements

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