microvmi 0.4.0

A cross-platform, unified, low-level VM introspection API supporting multiple hypervisors
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use super::kvm::KVM;
use microvmi::api::Introspectable;

pub trait Context: Send {
    fn setup(&self) -> ();
    fn init_driver(&self) -> Box<dyn Introspectable>;
    fn teardown(&self) -> ();
}

pub fn init_context() -> Box<dyn Context> {
    if cfg!(feature = "kvm") {
        Box::new(KVM {})
    } else {
        panic!("Integration tests need to be run with a specific driver enabled")
    }
}