[Rust-VMM] kvm ioctls crate - meeting follow-up

Florescu, Andreea fandree at amazon.com
Thu Feb 7 12:28:55 UTC 2019


Hey,


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.


Some examples of things that need to be changed in order to have one crate that accommodates both projects:

-  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.

- in Firecracker we have a hardcoded configuration of the pit in the create_pit method.


There are probably some other small nits here and there, but I didn't got the chance to look at all the code.


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?


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.


Andreea



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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opendev.org/pipermail/rust-vmm/attachments/20190207/7c229718/attachment.html>


More information about the Rust-vmm mailing list