diff --git a/proxmox-file-restore/Cargo.toml b/proxmox-file-restore/Cargo.toml index cd92acb32..b8acd1b64 100644 --- a/proxmox-file-restore/Cargo.toml +++ b/proxmox-file-restore/Cargo.toml @@ -24,6 +24,7 @@ proxmox-lang.workspace=true proxmox-router = { workspace = true, features = [ "cli" ] } proxmox-schema = { workspace = true, features = [ "api-macro" ] } proxmox-sys = { workspace = true, features = [ "logrotate" ] } +proxmox-systemd.workspace = true proxmox-time.workspace = true proxmox-uuid.workspace = true diff --git a/proxmox-file-restore/src/block_driver_qemu.rs b/proxmox-file-restore/src/block_driver_qemu.rs index fdaf71df6..adc6ccc7c 100644 --- a/proxmox-file-restore/src/block_driver_qemu.rs +++ b/proxmox-file-restore/src/block_driver_qemu.rs @@ -12,6 +12,7 @@ use serde::{Deserialize, Serialize}; use serde_json::json; use proxmox_sys::fs::lock_file; +use proxmox_systemd; use pbs_api_types::{file_restore::FileRestoreFormat, BackupDir, BackupNamespace}; use pbs_client::{BackupRepository, VsockClient, DEFAULT_VSOCK_PORT}; @@ -88,7 +89,7 @@ fn make_name(repo: &BackupRepository, ns: &BackupNamespace, snap: &BackupDir) -> } else { format!("qemu_{repo}:{ns}/{snap}") }; - proxmox_sys::systemd::escape_unit(full, false) + proxmox_systemd::escape_unit(full, false) } /// remove non-responsive VMs from given map, returns 'true' if map was modified @@ -309,7 +310,7 @@ impl BlockRestoreDriver for QemuBlockDriver { let resp = client .get("api2/json/status", Some(json!({"keep-timeout": true}))) .await; - let name = proxmox_sys::systemd::unescape_unit(n) + let name = proxmox_systemd::unescape_unit(n) .unwrap_or_else(|_| "".to_owned()); let mut extra = json!({"pid": s.pid, "cid": s.cid}); @@ -344,7 +345,7 @@ impl BlockRestoreDriver for QemuBlockDriver { fn stop(&self, id: String) -> Async> { async move { - let name = proxmox_sys::systemd::escape_unit(&id, false); + let name = proxmox_systemd::escape_unit(&id, false); let mut map = VMStateMap::load()?; let map_mod = cleanup_map(&mut map.map).await; match map.map.get(&name) { @@ -374,7 +375,7 @@ impl BlockRestoreDriver for QemuBlockDriver { match VMStateMap::load_read_only() { Ok(state) => state .iter() - .filter_map(|(name, _)| proxmox_sys::systemd::unescape_unit(name).ok()) + .filter_map(|(name, _)| proxmox_systemd::unescape_unit(name).ok()) .collect(), Err(_) => Vec::new(), }