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

Florescu, Andreea fandree at amazon.com
Sun May 19 10:54:05 UTC 2019

Hey everyone,

Since we are going to have the bindings as a separate repository and also since we agreed (I think) on supporting bindings from multiple kernel versions, we should probably re-export the kernel versions from which the bindings are generated so that people using kvm-ioctls or vm-virtio can also specify the kernel version of the bindings.

In kvm-bindings you can select the Linux kernel version using Rust features. By default the latest available bindings are used:
kvm-bindings = "0.1" -> use the bindings generated from Linux Kernel 4.20. This will always point to the latest kernel version for which we have bindings.
kvm-bindings = { version = "0.1", features = ["kvm_v4_14_0"]} -> use the bindings generated from Linux Kernel version 0.14.0

But in kvm-ioctls the versions are ignored and we are always using the latest generated bindings. 

I honestly didn't completely understand the usecase for using bindings from older kernel versions, but since this seems to be the case, should we allow choosing the kernel version from higher level crates like kvm-ioctls and vm-virtio? How are people currently working around this problem? One thing to keep in mind is that this approach can become hard to maintain because all crates using kvm-ioctls and vm-virtio will also have to re-export the versions if said crates are not so high-level that no other crate is using them.

From: Sergio Lopez <slp at redhat.com>
Sent: Wednesday, May 15, 2019 2:13 PM
To: Samuel Ortiz
Cc: rust-vmm at lists.opendev.org
Subject: Re: [Rust-VMM] Including a virtio-bindings crate in rust-vmm

Samuel Ortiz <samuel.ortiz at intel.com> writes:

> Hi Sergio,
> On Wed, May 08, 2019 at 02:18:18PM +0200, 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?
> It would make a lot of sense, yes.
> I created a virtio-bindings repo:
> https://github.com/rust-vmm/virtio-bindings
> Please send a PR with your changes there.

Done, thanks!


Amazon Development Center (Romania) S.R.L. registered office: 27A Sf. Lazar Street, UBC5, floor 2, Iasi, Iasi County, 700045, Romania. Registered in Romania. Registration number J22/2621/2005.

More information about the Rust-vmm mailing list