[Rust-VMM] VMM related bindings

Liu Jiang liuj97 at gmail.com
Fri Apr 12 09:47:13 UTC 2019

> On Apr 11, 2019, at 5:31 PM, Paolo Bonzini <pbonzini at redhat.com> wrote:
> 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”.
For the vhost_gen case, I have tried to include the vhost_gen code into the vhost crate, it does generate better code and simplify the maintenance.

> Paolo
> _______________________________________________
> Rust-vmm mailing list
> Rust-vmm at lists.opendev.org
> http://lists.opendev.org/cgi-bin/mailman/listinfo/rust-vmm

More information about the Rust-vmm mailing list