update to proxmox-sys 0.2 crate
- imported pbs-api-types/src/common_regex.rs from old proxmox crate - use hex crate to generate/parse hex digest - remove all reference to proxmox crate (use proxmox-sys and proxmox-serde instead) Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
This commit is contained in:
@ -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(),
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ use std::sync::Arc;
|
||||
use anyhow::{bail, format_err, Error};
|
||||
use serde_json::{json, Value};
|
||||
|
||||
use proxmox::tools::fs::{create_path, CreateOptions};
|
||||
use proxmox_sys::fs::{create_path, CreateOptions};
|
||||
use proxmox_router::cli::{
|
||||
complete_file_name, default_table_format_options,
|
||||
format_and_print_result_full, get_output_format,
|
||||
|
@ -11,8 +11,8 @@ use tokio::time;
|
||||
use nix::sys::signal::{kill, Signal};
|
||||
use nix::unistd::Pid;
|
||||
|
||||
use proxmox::tools::fs::{create_path, file_read_string, make_tmp_file, CreateOptions};
|
||||
use proxmox::tools::fd::fd_change_cloexec;
|
||||
use proxmox_sys::fs::{create_path, file_read_string, make_tmp_file, CreateOptions};
|
||||
use proxmox_sys::fd::fd_change_cloexec;
|
||||
use proxmox_sys::logrotate::LogRotate;
|
||||
|
||||
use pbs_client::{VsockClient, DEFAULT_VSOCK_PORT};
|
||||
|
Reference in New Issue
Block a user