Skip to content

fix(vmm): write instance info atomically - #1553

Merged
kvinwang merged 2 commits into
nextfrom
fix/vmm-atomic-instance-info
Nov 10, 2026
Merged

kvinwang merged 2 commits into
nextfrom
fix/vmm-atomic-instance-info

Conversation

@kvinwang

Copy link
Copy Markdown
Collaborator

prepare_mr_config_v3() rewrites .instance_info on every launch with a truncating fs::write. A failed write (e.g. disk full) or power loss leaves the file empty, which drops instance_id_seed; the regenerated seed yields a different instance ID and the VM can no longer derive its existing disk key.

Switch to safe_write, which the guest-reported instance.info path in app.rs already uses.

prepare_mr_config_v3() rewrites .instance_info on every launch with a
truncating fs::write. A failed write or power loss leaves the file empty,
losing instance_id_seed and with it the instance ID that keys the VM's
persistent disk. Use safe_write, as the guest-reported instance info
path already does.

Signed-off-by: Kevin Wang <wy721@qq.com>
@kvinwang
kvinwang merged commit c88f60e into next Nov 10, 2026
12 checks passed
@kvinwang
kvinwang deleted the fix/vmm-atomic-instance-info branch November 10, 2026 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant