vm-virtio: Add virtio-rng implementation

Most of the code is taken from crosvm(bbd24c5) but is modified to
be adapted to the current VirtioDevice definition and epoll
implementation.

A new command option '--rng' is provided and it gives one the option
to override the entropy source which is /dev/urandom by default.

Signed-off-by: Chao Peng <chao.p.peng@linux.intel.com>
This commit is contained in:
Chao Peng
2019-05-09 05:01:48 +00:00
committed by Samuel Ortiz
parent 97865b605f
commit 8e7579b20e
4 changed files with 323 additions and 2 deletions
Regular → Executable
+2
View File
@@ -24,6 +24,7 @@ mod block;
mod device;
pub mod net;
mod queue;
mod rng;
pub mod transport;
@@ -31,6 +32,7 @@ pub use self::block::*;
pub use self::device::*;
pub use self::net::*;
pub use self::queue::*;
pub use self::rng::*;
const DEVICE_INIT: u32 = 0x00;
const DEVICE_ACKNOWLEDGE: u32 = 0x01;