Skip to content

Commit d34f6d7

Browse files
Sudan Landgewearyzen
authored andcommitted
doc(snapshot-editor): Add steps to use vm-states subcommand
Add steps on how to use the new subcommand to print vmstate in human readable format. Improve readability of subcommand sections. Signed-off-by: Sudan Landge <[email protected]>
1 parent 597d2e4 commit d34f6d7

File tree

1 file changed

+109
-88
lines changed

1 file changed

+109
-88
lines changed

docs/snapshotting/snapshot-editor.md

Lines changed: 109 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -16,104 +16,125 @@ Firecracker snapshot consists of 2 files:
1616

1717
#### `rebase` subcommand
1818

19-
This command is used to merge a `diff` snapshot memory file on
20-
top of a base memory file.
21-
22-
**Note**
23-
You can also use `rebase-snap` (deprecated) tool for this.
24-
25-
Arguments:
26-
27-
- `MEMORY_PATH` - path to the `memory` file
28-
- `DIFF_PATH` - path to the `diff` file
29-
30-
Usage:
31-
32-
```bash
33-
snapshot-editor edit-memory rebase \
34-
--memory-path <MEMORY_PATH> \
35-
--diff-path <DIFF_PATH>
36-
```
37-
38-
Example:
39-
40-
```bash
41-
snapshot-editor edit-memory rebase \
42-
--memory-path ./memory_file \
43-
--diff-path ./diff_file
44-
```
19+
> This command is used to merge a `diff` snapshot memory file on
20+
> top of a base memory file.
21+
>
22+
> **Note**
23+
> You can also use `rebase-snap` (deprecated) tool for this.
24+
>
25+
> Arguments:
26+
>
27+
> - `MEMORY_PATH` - path to the `memory` file
28+
> - `DIFF_PATH` - path to the `diff` file
29+
>
30+
> Usage:
31+
>
32+
> ```bash
33+
> snapshot-editor edit-memory rebase \
34+
> --memory-path <MEMORY_PATH> \
35+
> --diff-path <DIFF_PATH>
36+
> ```
37+
>
38+
> Example:
39+
>
40+
> ```bash
41+
> snapshot-editor edit-memory rebase \
42+
> --memory-path ./memory_file \
43+
> --diff-path ./diff_file
44+
> ```
4545
4646
### `edit-vmstate` command
4747
4848
#### `remove-regs` subcommand (aarch64 only)
4949
50-
This command is used to remove specified registers from vcpu states inside
51-
vmstate snapshot file.
52-
53-
Arguments:
54-
55-
- `VMSTATE_PATH` - path to the `vmstate` file
56-
- `OUTPUT_PATH` - path to the file where the output will be placed
57-
- `[REGS]` - set of u32 values representing registers ids as they are defined
58-
in KVM. Can be both in decimal and in hex formats.
59-
60-
Usage:
61-
62-
```bash
63-
snapshot-editor edit-vmstate remove-regs \
64-
--vmstate-path <VMSTATE_PATH> \
65-
--output-path <OUTPUT_PATH> \
66-
[REGS]...
67-
```
68-
69-
Example:
70-
71-
```bash
72-
./snapshot-editor edit-vmstate remove-regs \
73-
--vmstate-path ./vmstate_file \
74-
--output-path ./new_vmstate_file \
75-
0x1 0x2
76-
```
50+
> This command is used to remove specified registers from vcpu states inside
51+
> vmstate snapshot file.
52+
>
53+
> Arguments:
54+
>
55+
> - `VMSTATE_PATH` - path to the `vmstate` file
56+
> - `OUTPUT_PATH` - path to the file where the output will be placed
57+
> - `[REGS]` - set of u32 values representing registers ids as they are defined
58+
> in KVM. Can be both in decimal and in hex formats.
59+
>
60+
> Usage:
61+
>
62+
> ```bash
63+
> snapshot-editor edit-vmstate remove-regs \
64+
> --vmstate-path <VMSTATE_PATH> \
65+
> --output-path <OUTPUT_PATH> \
66+
> [REGS]...
67+
> ```
68+
>
69+
> Example:
70+
>
71+
> ```bash
72+
> ./snapshot-editor edit-vmstate remove-regs \
73+
> --vmstate-path ./vmstate_file \
74+
> --output-path ./new_vmstate_file \
75+
> 0x1 0x2
76+
> ```
7777
7878
### `info-vmstate` command
7979
8080
#### `version` subcommand
8181
82-
This command is used to print version of the provided
83-
vmstate file.
84-
85-
Arguments:
86-
87-
- `VMSTATE_PATH` - path to the `vmstate` file
88-
89-
Usage:
90-
91-
```bash
92-
snapshot-editor info-vmstate version --vmstate-path <VMSTATE_PATH>
93-
```
94-
95-
Example:
96-
97-
```bash
98-
./snapshot-editor info-vmstate version --vmstate-path ./vmstate_file
99-
```
82+
> This command is used to print version of the provided
83+
> vmstate file.
84+
>
85+
> Arguments:
86+
>
87+
> - `VMSTATE_PATH` - path to the `vmstate` file
88+
>
89+
> Usage:
90+
>
91+
> ```bash
92+
> snapshot-editor info-vmstate version --vmstate-path <VMSTATE_PATH>
93+
> ```
94+
>
95+
> Example:
96+
>
97+
> ```bash
98+
> ./snapshot-editor info-vmstate version --vmstate-path ./vmstate_file
99+
> ```
100100
101101
#### `vcpu-states` subcommand (aarch64 only)
102102
103-
This command is used to print the vCPU states inside vmstate snapshot file.
104-
105-
Arguments:
106-
107-
- `VMSTATE_PATH` - path to the `vmstate` file
108-
109-
Usage:
110-
111-
```bash
112-
snapshot-editor info-vmstate vcpu-states --vmstate-path <VMSTATE_PATH>
113-
```
114-
115-
Example:
116-
117-
```bash
118-
./snapshot-editor info-vmstate vcpu-states --vmstate-path ./vmstate_file
119-
```
103+
> This command is used to print the vCPU states inside vmstate snapshot file.
104+
>
105+
> Arguments:
106+
>
107+
> - `VMSTATE_PATH` - path to the `vmstate` file
108+
>
109+
> Usage:
110+
>
111+
> ```bash
112+
> snapshot-editor info-vmstate vcpu-states --vmstate-path <VMSTATE_PATH>
113+
> ```
114+
>
115+
> Example:
116+
>
117+
> ```bash
118+
> ./snapshot-editor info-vmstate vcpu-states --vmstate-path ./vmstate_file
119+
> ```
120+
121+
#### `vm-state` subcommand
122+
123+
> This command is used to print the vmstate of snapshot file in
124+
> readable format thus, making it easier to compare vmstate of 2 snapshots.
125+
>
126+
> Arguments:
127+
>
128+
> - `VMSTATE_PATH` - path to the `vmstate` file
129+
>
130+
> Usage:
131+
>
132+
> ```bash
133+
> snapshot-editor info-vmstate vm-state --vmstate-path <VMSTATE_PATH>
134+
> ```
135+
>
136+
> Example:
137+
>
138+
> ```bash
139+
> ./snapshot-editor info-vmstate vm-state --vmstate-path ./vmstate_file
140+
> ```

0 commit comments

Comments
 (0)