Skip to content

Commit ecfd37a

Browse files
committed
vmm: Fix vm status after reloading
1 parent 44336df commit ecfd37a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

vmm/src/app.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,7 @@ impl App {
469469
let image_path = self.config.image_path.join(&manifest.image);
470470
let image = Image::load(&image_path).context("Failed to load image")?;
471471
let vm_id = manifest.id.clone();
472+
let already_running = cids_assigned.contains_key(&vm_id);
472473
let app_compose = vm_work_dir
473474
.app_compose()
474475
.context("Failed to read compose file")?;
@@ -517,7 +518,11 @@ impl App {
517518
};
518519

519520
if auto_start && vm_work_dir.started().unwrap_or_default() {
520-
self.start_vm(&vm_id).await?;
521+
if already_running {
522+
info!("Skipping, {vm_id} is already running");
523+
} else {
524+
self.start_vm(&vm_id).await?;
525+
}
521526
}
522527

523528
Ok(is_new)

0 commit comments

Comments
 (0)