Skip to content

Commit 466ed8c

Browse files
committed
refactor(vmm): Remove code for restoring old major version snapshots
The snapshot versioning follows the semantic versioning (i.e. snapshot restore is allowed only if the restore major version is same as the snapshot major version and the restore minor version is greater than or equal to the snapshot minor version). We already bumped the major version up multiple times since we added `mmds_version` state. That means snapshots taken when `mmds_version` didn't exist are not able to be restored in the current version. The code to restore such snapshots is no longer needed. Signed-off-by: Takahiro Itazuri <[email protected]>
1 parent 70745e1 commit 466ed8c

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

src/vmm/src/device_manager/persist.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -556,20 +556,11 @@ impl<'a> Persist<'a> for MMIODeviceManager {
556556
)?;
557557
}
558558

559-
// If the snapshot has the mmds version persisted, initialise the data store with it.
559+
// Initialize MMDS if MMDS state is included.
560560
if let Some(mmds_version) = &state.mmds_version {
561561
constructor_args
562562
.vm_resources
563563
.set_mmds_version(mmds_version.clone().into(), constructor_args.instance_id)?;
564-
} else if state
565-
.net_devices
566-
.iter()
567-
.any(|dev| dev.device_state.mmds_ns.is_some())
568-
{
569-
// If there's at least one network device having an mmds_ns, it means
570-
// that we are restoring from a version that did not persist the `MmdsVersionState`.
571-
// Init with the default.
572-
constructor_args.vm_resources.mmds_or_default()?;
573564
}
574565

575566
for net_state in &state.net_devices {

0 commit comments

Comments
 (0)