Skip to content

Commit

Permalink
Allow upgrade in 'exited' state
Browse files Browse the repository at this point in the history
  • Loading branch information
kvinwang committed Dec 18, 2024
1 parent 5c6f092 commit 3201723
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions tdxctl/src/fde_setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@ impl SetupFdeArgs {
let hash_file = self.rootfs_dir.join(".rootfs_hash");
let existing_rootfs_hash = fs::read(&hash_file).unwrap_or_default();
if existing_rootfs_hash != host_shared.vm_config.rootfs_hash {
info!("Rootfs hash changed, upgrading the rootfs");
fs::remove_file(&hash_file).context("Failed to remove old rootfs hash file")?;
nc.notify_q("boot.progress", "upgrading rootfs").await;
self.extract_rootfs(&host_shared.vm_config.rootfs_hash)
Expand Down
2 changes: 1 addition & 1 deletion teepod/src/main_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ impl TeepodRpc for RpcHandler {
.vm_info(&request.id)
.await?
.context("vm not found")?;
if vm.status != "stopped" {
if !["stopped", "exited"].contains(&vm.status.as_str()) {
return Err(anyhow!(
"vm should be stopped before resize: {}",
request.id
Expand Down

0 comments on commit 3201723

Please sign in to comment.