Delete files associated to VM
This commit is contained in:
		@@ -148,7 +148,14 @@ impl Handler<DeleteDomainReq> for LibVirtActor {
 | 
				
			|||||||
            false => sys::VIR_DOMAIN_UNDEFINE_NVRAM,
 | 
					            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(())
 | 
					        Ok(())
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user