diff --git a/virtweb_backend/src/actors/libvirt_actor.rs b/virtweb_backend/src/actors/libvirt_actor.rs index 6a782e2..13cf627 100644 --- a/virtweb_backend/src/actors/libvirt_actor.rs +++ b/virtweb_backend/src/actors/libvirt_actor.rs @@ -148,7 +148,14 @@ impl Handler for LibVirtActor { false => sys::VIR_DOMAIN_UNDEFINE_NVRAM, })?; - // TODO : delete files, if requested + if !msg.keep_files { + log::info!("Delete storage associated with the domain"); + let path = AppConfig::get().vm_storage_path(msg.id); + if path.exists() { + std::fs::remove_dir_all(path)?; + } + } + Ok(()) } }