Commit 3793b99
committed
refactor: Get rid of
This struct is almost a 1:1 duplication of `struct MachineConfig`, with
only a single deviation when it comes to CPU template handling (see
below). This makes it very annoying to add new fields to the
/machine-config endpoint, because counter-intuitively we have to
hand-edit at least 3 structs to add new fields to.
We can get rid of this duplication by merging VmConfig and MachineConfig
into just `MachineConfig` (that's what the endpoint is called, so having
the struct be the same makes sense). We now need to handle a bit of
nasty-ness when it comes to CPU templates, because /machine-config can
only be used for specifying static cpu templates, while a VmConfig is
used to hold whatever CPU template is stored, in whatever way. However,
we can handle this at the serde layer, by making serialize/deserialize
ignore the field if it doesnt contain a static template. This is ugly,
but since static templates are deprecated, we have line of sight to
getting rid of this weirdness when we release 2.0.
While we're at it, opportunistically rename functions etc to uniformly
call this thing a "machine config" instead of a "vm config".
Signed-off-by: Patrick Roy <[email protected]>VmConfig
1 parent 9cf1e6d commit 3793b99
File tree
11 files changed
+234
-166
lines changed- src
- cpu-template-helper/src
- firecracker/src/api_server
- request
- vmm
- benches
- src
- test_utils/mock_resources
- vmm_config
- tests
11 files changed
+234
-166
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
164 | | - | |
| 164 | + | |
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
166 | | - | |
167 | | - | |
| 166 | + | |
| 167 | + | |
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
| |||
Lines changed: 9 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| |||
60 | 61 | | |
61 | 62 | | |
62 | 63 | | |
63 | | - | |
| 64 | + | |
| 65 | + | |
64 | 66 | | |
65 | 67 | | |
66 | 68 | | |
| |||
124 | 126 | | |
125 | 127 | | |
126 | 128 | | |
127 | | - | |
| 129 | + | |
128 | 130 | | |
129 | 131 | | |
130 | 132 | | |
| |||
143 | 145 | | |
144 | 146 | | |
145 | 147 | | |
146 | | - | |
| 148 | + | |
147 | 149 | | |
148 | 150 | | |
149 | 151 | | |
| |||
162 | 164 | | |
163 | 165 | | |
164 | 166 | | |
165 | | - | |
| 167 | + | |
166 | 168 | | |
167 | 169 | | |
168 | 170 | | |
| |||
185 | 187 | | |
186 | 188 | | |
187 | 189 | | |
188 | | - | |
| 190 | + | |
189 | 191 | | |
190 | 192 | | |
191 | 193 | | |
| |||
210 | 212 | | |
211 | 213 | | |
212 | 214 | | |
213 | | - | |
| 215 | + | |
214 | 216 | | |
215 | 217 | | |
216 | 218 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
| 50 | + | |
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
| 70 | + | |
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
127 | | - | |
| 127 | + | |
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
| |||
274 | 274 | | |
275 | 275 | | |
276 | 276 | | |
277 | | - | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
278 | 281 | | |
279 | 282 | | |
280 | 283 | | |
281 | 284 | | |
282 | 285 | | |
283 | 286 | | |
284 | | - | |
285 | | - | |
| 287 | + | |
| 288 | + | |
286 | 289 | | |
287 | 290 | | |
288 | 291 | | |
| |||
338 | 341 | | |
339 | 342 | | |
340 | 343 | | |
341 | | - | |
| 344 | + | |
342 | 345 | | |
343 | 346 | | |
344 | 347 | | |
| |||
348 | 351 | | |
349 | 352 | | |
350 | 353 | | |
351 | | - | |
| 354 | + | |
352 | 355 | | |
353 | 356 | | |
354 | 357 | | |
| |||
429 | 432 | | |
430 | 433 | | |
431 | 434 | | |
432 | | - | |
| 435 | + | |
433 | 436 | | |
434 | 437 | | |
435 | 438 | | |
| |||
471 | 474 | | |
472 | 475 | | |
473 | 476 | | |
474 | | - | |
475 | | - | |
| 477 | + | |
| 478 | + | |
476 | 479 | | |
477 | 480 | | |
478 | 481 | | |
| |||
750 | 753 | | |
751 | 754 | | |
752 | 755 | | |
753 | | - | |
| 756 | + | |
754 | 757 | | |
755 | 758 | | |
756 | 759 | | |
| |||
793 | 796 | | |
794 | 797 | | |
795 | 798 | | |
796 | | - | |
797 | | - | |
| 799 | + | |
| 800 | + | |
798 | 801 | | |
799 | 802 | | |
800 | 803 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
65 | | - | |
66 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
67 | 67 | | |
68 | | - | |
| 68 | + | |
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| |||
422 | 422 | | |
423 | 423 | | |
424 | 424 | | |
425 | | - | |
| 425 | + | |
426 | 426 | | |
427 | 427 | | |
428 | 428 | | |
429 | | - | |
| 429 | + | |
430 | 430 | | |
431 | 431 | | |
432 | 432 | | |
| |||
450 | 450 | | |
451 | 451 | | |
452 | 452 | | |
453 | | - | |
| 453 | + | |
454 | 454 | | |
455 | 455 | | |
456 | 456 | | |
| |||
462 | 462 | | |
463 | 463 | | |
464 | 464 | | |
465 | | - | |
| 465 | + | |
466 | 466 | | |
467 | 467 | | |
468 | 468 | | |
| |||
0 commit comments