use UPID and systemd helpers from proxmox 0.13.4
This commit is contained in:
@ -16,7 +16,7 @@ tokio = { version = "1.6", features = [ "io-std", "rt", "rt-multi-thread", "time
|
||||
|
||||
pxar = { version = "0.10.1", features = [ "tokio-io" ] }
|
||||
|
||||
proxmox = { version = "0.13.3", features = [ "api-macro", "cli" ] }
|
||||
proxmox = { version = "0.13.4", features = [ "api-macro", "cli" ] }
|
||||
|
||||
pbs-api-types = { path = "../pbs-api-types" }
|
||||
pbs-buildcfg = { path = "../pbs-buildcfg" }
|
||||
@ -24,5 +24,4 @@ pbs-config = { path = "../pbs-config" }
|
||||
pbs-client = { path = "../pbs-client" }
|
||||
pbs-datastore = { path = "../pbs-datastore" }
|
||||
pbs-runtime = { path = "../pbs-runtime" }
|
||||
proxmox-systemd = { path = "../proxmox-systemd" }
|
||||
pbs-tools = { path = "../pbs-tools" }
|
||||
|
@ -80,7 +80,7 @@ impl VMStateMap {
|
||||
|
||||
fn make_name(repo: &BackupRepository, snap: &BackupDir) -> String {
|
||||
let full = format!("qemu_{}/{}", repo, snap);
|
||||
proxmox_systemd::escape_unit(&full, false)
|
||||
proxmox::tools::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_systemd::unescape_unit(n)
|
||||
let name = proxmox::tools::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_systemd::escape_unit(&id, false);
|
||||
let name = proxmox::tools::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_systemd::unescape_unit(&name).ok())
|
||||
.filter_map(|(name, _)| proxmox::tools::systemd::unescape_unit(&name).ok())
|
||||
.collect(),
|
||||
Err(_) => Vec::new(),
|
||||
}
|
||||
|
Reference in New Issue
Block a user