[Rust-VMM] Including a virtio-bindings crate in rust-vmm
slp at redhat.com
Wed May 8 14:17:07 UTC 2019
Paolo Bonzini <pbonzini at redhat.com> writes:
> On 08/05/19 07:18, Sergio Lopez wrote:
>> I think it'd be useful having a crate providing virtio bindgen-generated
>> bindings, similar to Firecracker's virtio_gen. I wrote one that provides
>> the same functionality, but with multiple versions mapped as features,
>> as kvm-bindings does:
>> Do you think we could make this a project under rust-vmm's umbrella?
> Yes, I think so! However, what is the reason to have anything but the
> last version? Headers from a newer kernel should be
> backwards-compatible with code written for an older kernel.
The main reason is for that is allowing crate users to be able to do
strict size checks on structs.
As an example, virtio_blk_config was extended from 4.14 to 5.0 with new
fields. This structure may come as the payload a VhostUserConfig
message, and while you are able to just use the latest version and
accept any payload the same size or smaller, I think some users may want
to be more strict and just allow the expected size.
Given that the cost of maintaining the bindings is very small, I think
that's a use case we can afford supporting (and I volunteer for doing so
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 832 bytes
Desc: not available
More information about the Rust-vmm