]> git.proxmox.com Git - proxmox-backup.git/blobdiff - proxmox-file-restore/src/block_driver_qemu.rs
update to proxmox-sys 0.2 crate
[proxmox-backup.git] / proxmox-file-restore / src / block_driver_qemu.rs
index 74296ab64ad243a52b70405d48ebea3708b1fab4..25a9b3fe444616afa51db12f546f2747f8ea1605 100644 (file)
@@ -8,7 +8,7 @@ use futures::FutureExt;
 use serde::{Deserialize, Serialize};
 use serde_json::json;
 
-use proxmox::tools::fs::lock_file;
+use proxmox_sys::fs::lock_file;
 
 use pbs_client::{DEFAULT_VSOCK_PORT, BackupRepository, VsockClient};
 use pbs_datastore::backup_info::BackupDir;
@@ -80,7 +80,7 @@ impl VMStateMap {
 
 fn make_name(repo: &BackupRepository, snap: &BackupDir) -> String {
     let full = format!("qemu_{}/{}", repo, snap);
-    proxmox::tools::systemd::escape_unit(&full, false)
+    proxmox_sys::systemd::escape_unit(&full, false)
 }
 
 /// remove non-responsive VMs from given map, returns 'true' if map was modified
@@ -257,7 +257,7 @@ impl BlockRestoreDriver for QemuBlockDriver {
                 let resp = client
                     .get("api2/json/status", Some(json!({"keep-timeout": true})))
                     .await;
-                let name = proxmox::tools::systemd::unescape_unit(n)
+                let name = proxmox_sys::systemd::unescape_unit(n)
                     .unwrap_or_else(|_| "<invalid name>".to_owned());
                 let mut extra = json!({"pid": s.pid, "cid": s.cid});
 
@@ -295,7 +295,7 @@ impl BlockRestoreDriver for QemuBlockDriver {
 
     fn stop(&self, id: String) -> Async<Result<(), Error>> {
         async move {
-            let name = proxmox::tools::systemd::escape_unit(&id, false);
+            let name = proxmox_sys::systemd::escape_unit(&id, false);
             let mut map = VMStateMap::load()?;
             let map_mod = cleanup_map(&mut map.map).await;
             match map.map.get(&name) {
@@ -325,7 +325,7 @@ impl BlockRestoreDriver for QemuBlockDriver {
         match VMStateMap::load_read_only() {
             Ok(state) => state
                 .iter()
-                .filter_map(|(name, _)| proxmox::tools::systemd::unescape_unit(&name).ok())
+                .filter_map(|(name, _)| proxmox_sys::systemd::unescape_unit(&name).ok())
                 .collect(),
             Err(_) => Vec::new(),
         }