Can create networks

This commit is contained in:
2023-10-31 09:26:42 +01:00
parent 335aec788e
commit f2237d4f2f
12 changed files with 328 additions and 65 deletions

View File

@ -1,6 +1,6 @@
use crate::app_config::AppConfig;
use crate::constants;
use crate::libvirt_lib_structures::DomainXMLUuid;
use crate::libvirt_lib_structures::XMLUuid;
use crate::utils::files_utils;
use lazy_regex::regex;
use std::os::linux::fs::MetadataExt;
@ -78,13 +78,13 @@ impl Disk {
}
/// Get disk path
pub fn disk_path(&self, id: DomainXMLUuid) -> PathBuf {
pub fn disk_path(&self, id: XMLUuid) -> PathBuf {
let domain_dir = AppConfig::get().vm_storage_path(id);
domain_dir.join(&self.name)
}
/// Apply disk configuration
pub fn apply_config(&self, id: DomainXMLUuid) -> anyhow::Result<()> {
pub fn apply_config(&self, id: XMLUuid) -> anyhow::Result<()> {
self.check_config()?;
let file = self.disk_path(id);