Delete files associated to VM
This commit is contained in:
parent
9371d709a5
commit
f5f4239337
@ -148,7 +148,14 @@ impl Handler<DeleteDomainReq> 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(())
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user