Skip to content

Commit ef63848

Browse files
committed
fix: make mem_size_mib and track_dirty_pages optional
This makes these fields optional in PATCH /machine-config requests. The comment on this structure says that all fields should be optional, and I dont quite see why these two should be different. Thus, add `serde(default)` to avoid forcing customers to explicitly set them to `null` if they do not want to update these parts of the machine config. Signed-off-by: Patrick Roy <[email protected]>
1 parent e391704 commit ef63848

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ and this project adheres to
2828
- [#4916](https://github.com/firecracker-microvm/firecracker/pull/4916): Fixed
2929
`IovDeque` implementation to work with any host page size. This fixes
3030
virtio-net device on non 4K host kernels.
31+
- [#????](<>): Fixed `mem_size_mib` and `track_dirty_pages` being mandatory for
32+
all `PATCH /machine-config` requests. Now, they can be omitted which leaves
33+
these parts of the machine configuration unchanged.
3134

3235
## [1.10.1]
3336

src/vmm/src/vmm_config/machine_config.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ pub struct MachineConfigUpdate {
136136
#[serde(default)]
137137
pub vcpu_count: Option<u8>,
138138
/// The memory size in MiB.
139+
#[serde(default)]
139140
pub mem_size_mib: Option<usize>,
140141
/// Enables or disabled SMT.
141142
#[serde(default)]
@@ -144,6 +145,7 @@ pub struct MachineConfigUpdate {
144145
#[serde(default)]
145146
pub cpu_template: Option<StaticCpuTemplate>,
146147
/// Enables or disables dirty page tracking. Enabling allows incremental snapshots.
148+
#[serde(default)]
147149
pub track_dirty_pages: Option<bool>,
148150
/// Configures what page size Firecracker should use to back guest memory.
149151
#[serde(default)]

0 commit comments

Comments
 (0)