[Rust-VMM] Including a virtio-bindings crate in rust-vmm

Sergio Lopez 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:
>> Hi,
>> 
>> 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:
>> 
>> https://git.sinrega.org/slp/virtio-bindings
>> 
>> Do you think we could make this a project under rust-vmm's umbrella?
>> 
>> Thanks,
>
> 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
:-).

Thanks,
Sergio.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <http://lists.opendev.org/pipermail/rust-vmm/attachments/20190508/4f7b071e/attachment.sig>


More information about the Rust-vmm mailing list