Skip to content

Commit 9cf1e6d

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 3afaf94 commit 9cf1e6d

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ and this project adheres to
3131
- [#4916](https://github.com/firecracker-microvm/firecracker/pull/4916): Fixed
3232
`IovDeque` implementation to work with any host page size. This fixes
3333
virtio-net device on non 4K host kernels.
34+
- [#4991](https://github.com/firecracker-microvm/firecracker/pull/4991): Fixed
35+
`mem_size_mib` and `track_dirty_pages` being mandatory for all
36+
`PATCH /machine-config` requests. Now, they can be omitted which leaves these
37+
parts of the machine configuration unchanged.
3438

3539
## [1.10.1]
3640

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)