[Rust-VMM] VMM related bindings

Paolo Bonzini pbonzini at redhat.com
Thu Apr 11 09:31:48 UTC 2019


On 11/04/19 10:25, Samuel Ortiz wrote:
> In several cases, we need to generate kernel bindings for some of our
> crates (kvm, vhost, virtio), through rust-bindgen.
> There's been discussions about whether we should have those bindings as
> part of the related crate (e.g. a virtio/src/bindings.rs module for the
> virtio bindings) or as a separate crate (virtio-bindings,
> vhost-bindings, kvm-bindings).
> 
> We (Andreea and myself) believe it makes more sense to have them as
> separate crates, and clearly distinguish generated bindings from actual
> code consuming them. It generates a few more repos, but that's a minor
> burden after all.
> 
> Does anyone have strong opinions against that pattern?

No objections for kvm-bindings and vhost-bindings; however, for virtio
and vhost-user I would just write everything by hand (or clean up
bindgen-generated code to actually be readable, and include it in the
same crate) since there is a public specification rather than
"/usr/include is the spec".

Paolo



More information about the Rust-vmm mailing list