<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;} --></style>
</head>
<body dir="ltr" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<p>Hey,</p>
<p><br>
</p>
<p>As I said in the meeting yesterday, I start working on a kvm ioctls crate. But while working on this I noticed that I can't just merge the functionality of the two kvm crates in CrosVM and Firecracker because I first need to adjust the code a bit to make
 it more generic.</p>
<p><br>
</p>
<p>Some examples of things that need to be changed in order to have one crate that accommodates both projects:</p>
<p>-  in the Kvm constructor we should pass the open flags as parameters. In CrosVM the KVM fd is open with close on exec (O_CLOEXEC). In Firecracker we can't use that flag because when Firecracker is started using the jailer, the jailer is responsible for
 opening /dev/kvm. The file descriptor is passed on to the firecracker process.</p>
<p>- in Firecracker we have a hardcoded configuration of the pit in the create_pit method.</p>
<p><br>
</p>
<p>There are probably some other small nits here and there, but I didn't got the chance to look at all the code.</p>
<p><br>
</p>
<p>I would also like to use std::io::Error instead of the implementation of raw errors from sys_util/src/errno.rs because the io::Error has a to_string implementation that is mapping the raw os error number to a human readable text. Is there a reason why you
 decided to go for a custom implementation of io::Error in crosvm? </p>
<p><br>
</p>
<p>Also an ultra ultra nit: I am making create_vm a method of Kvm instead of having a Vm constructor which has as parameter the Kvm file descriptor. Same for create_vcpu.</p>
<p><br>
</p>
<p>Andreea<br>
</p>
<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>