1
1
# vm-memory
2
2
3
- A library to access the physical memory of a virtual machine.
3
+ ## Design
4
4
5
5
In a typical Virtual Machine Monitor (VMM) there are several components, such
6
6
as boot loader, virtual device drivers, virtio backend drivers and vhost
@@ -11,14 +11,27 @@ memory of the VM without knowing the implementation details of the VM memory
11
11
provider. Thus VMM components based on these traits can be shared and reused by
12
12
multiple virtualization solutions.
13
13
14
- ## Platform Support
14
+ The detailed design of the ` vm-memory ` crate can be found [ here] ( DESIGN.md ) .
15
+
16
+ ### Platform Support
15
17
16
18
- Arch: x86, AMD64, ARM64
17
19
- OS: Linux/Unix/Windows
18
20
19
- ## Example
21
+ ## Usage
22
+
23
+ Add ` vm-memory ` as a dependency in ` Cargo.toml `
24
+
25
+ ``` toml
26
+ [dependencies ]
27
+ vm-memory = " *"
28
+ ```
29
+
30
+ Then add ` extern crate vm-memory; ` to your crate root.
31
+
32
+ ## Examples
20
33
21
- - Create a VM physical memory objects in hypervisor specific ways using the
34
+ - Creating a VM physical memory object in hypervisor specific ways using the
22
35
` GuestMemoryMmap ` implementation of the ` GuestMemory ` trait:
23
36
24
37
``` rust
@@ -31,7 +44,7 @@ fn provide_mem_to_virt_dev() {
31
44
}
32
45
```
33
46
34
- - Consumers access VM's physical memory
47
+ - Consumers accessing the VM's physical memory:
35
48
36
49
``` rust
37
50
fn virt_device_io <T : GuestMemory >(mem : & T ) {
@@ -43,12 +56,6 @@ fn virt_device_io<T: GuestMemory>(mem: &T) {
43
56
}
44
57
```
45
58
46
- ## Documentations & References
47
-
48
- - [ Design of The ` vm-memory ` Crate] ( DESIGN.md )
49
- - [ TODO List] ( TODO.md )
50
- - [ The rust-vmm Project] ( https://github.com/rust-vmm/ )
51
-
52
59
## License
53
60
54
61
This project is licensed under either of
0 commit comments