<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none"><!--P{margin-top:0;margin-bottom:0;} p
        {margin-top:0;
        margin-bottom:0}--></style>
</head>
<body dir="ltr" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<p>P.S. The bindgen issue by which you couldn't generate the bindings for structures containing zero sized arrays is fixed in the bindgen version 0.46.0.</p>
<p>There are still some issues with adding derive Debug and PartialEq to structures containing long arrays that might be related to this issue [1], but this doesn't seem like a big issue. Other than that it should be very smooth to generate bindings.<br>
</p>
<p><br>
</p>
<p>[1] <a href="https://github.com/rust-lang/rust-bindgen/issues/372">https://github.com/rust-lang/rust-bindgen/issues/372</a><br>
</p>
<div dir="ltr" style="font-size:12pt; color:#000000; background-color:#FFFFFF; font-family:Calibri,Arial,Helvetica,sans-serif">
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>From:</b> Florescu, Andreea<br>
<b>Sent:</b> Monday, January 7, 2019 7:13 PM<br>
<b>To:</b> Jiang Liu<br>
<b>Cc:</b> rust-vmm@lists.opendev.org<br>
<b>Subject:</b> Re: [Rust-VMM] KVM bindings as independent crate</font>
<div> </div>
</div>
<div>
<p>Hey,</p>
<p><br>
</p>
<p>I must shamefully confess that I did the generating part manually, but in the process I documented it here [1]. I also plan to add a script for generating the bindings as I mentioned in the last section of CONTRIBUTING.md, but didn't really got the time
 to do that.</p>
<p>Can you also submit a PR please if you generate the bindings for another version/architecture just in case some other people would like to use it?</p>
<p><br>
</p>
<p>Andreea<br>
</p>
<p><br>
</p>
<p>[1] <a href="https://github.com/andreeaflorescu/kvm_wrapper/blob/master/CONTRIBUTING.md">
https://github.com/andreeaflorescu/kvm_wrapper/blob/master/CONTRIBUTING.md</a><br>
</p>
<div style="word-wrap:break-word; line-break:after-white-space">
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>From:</b> Jiang Liu <liuj97@gmail.com><br>
<b>Sent:</b> Monday, January 7, 2019 6:53 PM<br>
<b>To:</b> Florescu, Andreea<br>
<b>Cc:</b> rust-vmm@lists.opendev.org<br>
<b>Subject:</b> Re: [Rust-VMM] KVM bindings as independent crate</font>
<div> </div>
</div>
<div>Hi Andreea,
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>Any plan to share the bindgen script so we could generate the binding again any kernel version if needed?</div>
<div class="">Thanks!</div>
<div class="">Gerry<br class="">
<div><br class="">
<blockquote type="cite" class="">
<div class="">On Jan 8, 2019, at 12:41 AM, Florescu, Andreea <<a href="mailto:fandree@amazon.com" class="">fandree@amazon.com</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div class="" style="margin-top:0px; margin-bottom:0px; font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; background-color:rgb(255,255,255); text-decoration:none">
Hey everyone,</div>
<div class="" style="margin-top:0px; margin-bottom:0px; font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; background-color:rgb(255,255,255); text-decoration:none">
<br class="">
</div>
<div class="" style="margin-top:0px; margin-bottom:0px; font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; background-color:rgb(255,255,255); text-decoration:none">
I published the KVM bindings on<span class="Apple-converted-space"> </span><a href="http://crates.io/" class="">crates.io</a><span class="Apple-converted-space"> </span>[1] under the name "kvm_wrapper". The bindings are available for arm, arm64, x86 and x86_64.
 The kernel version can be selected by using features. For now I only added bindings for linux-4.14.0 and linux-4.20.0, but others can be added if needed. The version can be selected using features:</div>
<pre class=" language-undefined" style="font-size:16px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; word-spacing:0px; background-color:rgb(255,255,255); text-decoration:none"><code class=" language-undefined">kvm_wrapper = { version = "0.1.0", features = ["kvm_v4_14_0"]}</code></pre>
<div class="" style="margin-top:0px; margin-bottom:0px; font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; background-color:rgb(255,255,255); text-decoration:none">
and by default the latest kernel version is used.</div>
<div class="" style="margin-top:0px; margin-bottom:0px; font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; background-color:rgb(255,255,255); text-decoration:none">
<br class="">
</div>
<div class="" style="margin-top:0px; margin-bottom:0px; font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; background-color:rgb(255,255,255); text-decoration:none">
We cannot use the crate right away in Firecracker because in the kvm_gen crate (previously named kvm_sys) we also have code that is not auto-generated so the first step for us is to move that code to somewhere else. This step is currently in review [2].</div>
<div class="" style="margin-top:0px; margin-bottom:0px; font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; background-color:rgb(255,255,255); text-decoration:none">
We still have to figure out some loose-ends and I created some issues for them [3], but it would be nice to get your feedback on this.<br class="">
</div>
<div class="" style="margin-top:0px; margin-bottom:0px; font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; background-color:rgb(255,255,255); text-decoration:none">
<br class="">
</div>
<div class="" style="margin-top:0px; margin-bottom:0px; font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; background-color:rgb(255,255,255); text-decoration:none">
Thanks,</div>
<div class="" style="margin-top:0px; margin-bottom:0px; font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; background-color:rgb(255,255,255); text-decoration:none">
Andreea<br class="">
</div>
<div class="" style="margin-top:0px; margin-bottom:0px; font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; background-color:rgb(255,255,255); text-decoration:none">
<br class="">
</div>
<div class="" style="margin-top:0px; margin-bottom:0px; font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; background-color:rgb(255,255,255); text-decoration:none">
[1]<span class="Apple-converted-space"> </span><a href="https://crates.io/crates/kvm_wrapper" class="">https://crates.io/crates/kvm_wrapper</a></div>
<div class="" style="margin-top:0px; margin-bottom:0px; font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; background-color:rgb(255,255,255); text-decoration:none">
[2]<span class="Apple-converted-space"> </span><a href="https://github.com/firecracker-microvm/firecracker/pull/816" class="">https://github.com/firecracker-microvm/firecracker/pull/816</a><br class="">
</div>
<div class="" style="margin-top:0px; margin-bottom:0px; font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; background-color:rgb(255,255,255); text-decoration:none">
[3]<span class="Apple-converted-space"> </span><a href="https://github.com/andreeaflorescu/kvm_wrapper/issues" class="">https://github.com/andreeaflorescu/kvm_wrapper/issues</a><br class="">
</div>
<p class="" style="margin-top:0px; margin-bottom:0px; font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; background-color:rgb(255,255,255); text-decoration:none">
</p>
<div class="" style="margin-top:0px; margin-bottom:0px; font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; background-color:rgb(255,255,255); text-decoration:none">
<br class="">
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.</div>
<span class="" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; background-color:rgb(255,255,255); text-decoration:none; float:none; display:inline!important">_______________________________________________</span><br class="" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; background-color:rgb(255,255,255); text-decoration:none">
<span class="" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; background-color:rgb(255,255,255); text-decoration:none; float:none; display:inline!important">Rust-vmm
 mailing list</span><br class="" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; background-color:rgb(255,255,255); text-decoration:none">
<a href="mailto:Rust-vmm@lists.opendev.org" class="" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px; font-style:normal; font-weight:normal; letter-spacing:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px; background-color:rgb(255,255,255)">Rust-vmm@lists.opendev.org</a><br class="" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; background-color:rgb(255,255,255); text-decoration:none">
<a href="http://lists.opendev.org/cgi-bin/mailman/listinfo/rust-vmm" class="" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px; font-style:normal; font-weight:normal; letter-spacing:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px; background-color:rgb(255,255,255)">http://lists.opendev.org/cgi-bin/mailman/listinfo/rust-vmm</a><br class="" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; background-color:rgb(255,255,255); text-decoration:none">
</div>
</blockquote>
</div>
<br class="">
</div>
</div>
</div>
</div>
</div>
<p></p>

<p><br>
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.</p>
</body>
</html>