Automatically backup source network and VM configuration

This commit is contained in:
2023-12-23 18:12:46 +01:00
parent d053490a47
commit d8a6b58c52
7 changed files with 106 additions and 51 deletions

View File

@ -240,6 +240,18 @@ impl AppConfig {
pub fn vm_storage_path(&self, id: XMLUuid) -> PathBuf {
self.disks_storage_path().join(id.as_string())
}
pub fn definitions_path(&self) -> PathBuf {
self.storage_path().join("definitions")
}
pub fn vm_definition_path(&self, name: &str) -> PathBuf {
self.definitions_path().join(format!("vm-{name}.json"))
}
pub fn net_definition_path(&self, name: &str) -> PathBuf {
self.definitions_path().join(format!("net-{name}.json"))
}
}
#[derive(Debug, Clone, serde::Serialize)]