1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
//! This module describes initialization parameters for all libmicrovmi drivers
//!
//! The [`DriverInitParams`](struct.DriverInitParams.html) is used to pass additional driver initialization parameters.
//! You might want to check it's documentation for examples on how to initialize your driver.
/// Xen initialization parameters
/// KVM initialization parameters
/// Memflow connector parameters
///
/// This enumeration reflects the possibilities to initialize Memflow
/// - default: will simply forward the string arguments to the connector
// TODO
// - [`qemu`](https://github.com/memflow/memflow-qemu)
// - [`kvm`](https://github.com/memflow/memflow-kvm)
// - [`pcileech`](https://github.com/memflow/memflow-pcileech)
// - [`coredump`](https://github.com/memflow/memflow-coredump)
/// Memflow initialization parameters
/// VirtualBox initialization parameters
/// Common initialization parameters
///
/// These parameters are shared by two or more drivers, and are stored in this struct
/// to avoid duplication and simplify the API
/// This struct is used to specify the initialization parameters for all drivers
///
/// # Examples
///
/// ```no_run
/// // Xen
/// // common.vm_name: mandatory
/// use microvmi::api::params::{DriverInitParams, CommonInitParams, KVMInitParams, MemflowInitParams};
/// let init_params = DriverInitParams {
/// common: Some(CommonInitParams { vm_name: String::from("windows10")}),
/// ..Default::default()
/// };
/// // KVM
/// // common.vm_name: mandatory
/// // kvm.unix_socket: mandatory
/// let init_params = DriverInitParams {
/// common: Some(CommonInitParams { vm_name: String::from("windows10")}),
/// kvm: Some(KVMInitParams::UnixSocket { path: String::from("/tmp/introspector")}),
/// ..Default::default()
/// };
/// // VirtualBox
/// // common.vm_name: mandatory
/// let init_params = DriverInitParams {
/// common: Some(CommonInitParams { vm_name: String::from("windows10")}),
/// ..Default::default()
/// };
/// // Memflow
/// // memflow.connector_name: mandatory
/// // memflow.connector_args: optional
/// let init_params = DriverInitParams {
/// memflow: Some(MemflowInitParams { connector_name: String::from("qemu"), ///
/// ..Default::default()}),
/// ..Default::default()
/// };
/// ```