]> git.proxmox.com Git - proxmox-backup.git/commitdiff
use proxmox::tools::fd::fd_change_cloexec from proxmox 0.15.3
authorDietmar Maurer <dietmar@proxmox.com>
Thu, 18 Nov 2021 12:43:41 +0000 (13:43 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 18 Nov 2021 12:43:41 +0000 (13:43 +0100)
Depend on proxmox 0.15.3

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
18 files changed:
Cargo.toml
pbs-api-types/Cargo.toml
pbs-client/Cargo.toml
pbs-config/Cargo.toml
pbs-datastore/Cargo.toml
pbs-tape/Cargo.toml
pbs-tools/Cargo.toml
pbs-tools/src/fd.rs [deleted file]
pbs-tools/src/lib.rs
proxmox-backup-client/Cargo.toml
proxmox-file-restore/Cargo.toml
proxmox-file-restore/src/qemu_helper.rs
proxmox-rest-server/Cargo.toml
proxmox-rest-server/src/daemon.rs
proxmox-restore-daemon/Cargo.toml
proxmox-rrd/Cargo.toml
pxar-bin/Cargo.toml
src/api2/node/mod.rs

index 05f0811c728b0c2a874b0f21ede41a57df6b24f9..e3cb972bbb62ee5ee55788a75cfac16d4097e7d7 100644 (file)
@@ -95,7 +95,7 @@ zstd = { version = "0.6", features = [ "bindgen" ] }
 pathpatterns = "0.1.2"
 pxar = { version = "0.10.1", features = [ "tokio-io" ] }
 
-proxmox = { version = "0.15.0", features = [ "sortable-macro" ] }
+proxmox = { version = "0.15.3", features = [ "sortable-macro" ] }
 proxmox-http = { version = "0.5.4", features = [ "client", "http-helpers", "websocket" ] }
 proxmox-io = "1"
 proxmox-lang = "1"
index 4b188c0709a736ad8491dea5e31806eebe2fb650..925207e8603009a273ae4972416447aa9850657d 100644 (file)
@@ -15,7 +15,7 @@ openssl = "0.10"
 regex = "1.2"
 serde = { version = "1.0", features = ["derive"] }
 
-proxmox = "0.15.0"
+proxmox = "0.15.3"
 proxmox-lang = "1.0.0"
 proxmox-schema = { version = "1.0.1", features = [ "api-macro" ] }
 proxmox-time = "1.1"
index 2fb05ca4a05648b2d97ef59e372aa38ed559a32c..135e4045ba8da627e178f9680cd59ce53ea9a05b 100644 (file)
@@ -28,7 +28,7 @@ tower-service = "0.3.0"
 xdg = "2.2"
 
 pathpatterns = "0.1.2"
-proxmox = "0.15.0"
+proxmox = "0.15.3"
 proxmox-fuse = "0.1.1"
 proxmox-http = { version = "0.5.4", features = [ "client", "http-helpers", "websocket" ] }
 proxmox-io = { version = "1", features = [ "tokio" ] }
index 0ea62d9ee803c3b4eed4d66e2281fab78f5e4c64..9424e95b0ff3fd3113891f7251dcc274673b71c0 100644 (file)
@@ -17,7 +17,7 @@ regex = "1.2"
 serde = { version = "1.0", features = ["derive"] }
 serde_json = "1.0"
 
-proxmox = "0.15.0"
+proxmox = "0.15.3"
 proxmox-lang = "1"
 proxmox-router = { version = "1.1", default-features = false }
 proxmox-schema = "1"
index 01c5ee005cd2b9189556e07c8a74350d1644db9d..072fa1d4ee9486983bf7804ecd8a5ffa35b1ea28 100644 (file)
@@ -25,7 +25,7 @@ zstd = { version = "0.6", features = [ "bindgen" ] }
 pathpatterns = "0.1.2"
 pxar = "0.10.1"
 
-proxmox = "0.15.0"
+proxmox = "0.15.3"
 proxmox-borrow = "1"
 proxmox-io = "1"
 proxmox-lang = "1"
index c3e8b0afefe76f7dd99823fffc186baefd49e354..e11a835ab283f117bdbe38a0562297efd226c683 100644 (file)
@@ -18,7 +18,7 @@ bitflags = "1.2.1"
 regex = "1.2"
 udev = "0.4"
 
-proxmox = "0.15.0"
+proxmox = "0.15.3"
 proxmox-io = "1"
 proxmox-lang = "1"
 # api-macro is only used by the binaries, so maybe we should split them out
index 635933e1b2035cb4ebbb2f5145f38d4b066d3a8e..e72591e59c1d6f448312781a44455b6a1d5fd036 100644 (file)
@@ -32,7 +32,7 @@ url = "2.1"
 walkdir = "2"
 zstd = { version = "0.6", features = [ "bindgen" ] }
 
-proxmox = { version = "0.15.0", default-features = false, features = [ "tokio" ] }
+proxmox = { version = "0.15.3", default-features = false, features = [ "tokio" ] }
 proxmox-borrow = "1"
 proxmox-io = { version = "1", features = [ "tokio" ] }
 proxmox-lang = { version = "1" }
diff --git a/pbs-tools/src/fd.rs b/pbs-tools/src/fd.rs
deleted file mode 100644 (file)
index 6f866bf..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-//! Raw file descriptor related utilities.
-
-use std::os::unix::io::RawFd;
-
-use anyhow::Error;
-use nix::fcntl::{fcntl, FdFlag, F_GETFD, F_SETFD};
-
-/// Change the `O_CLOEXEC` flag of an existing file descriptor.
-pub fn fd_change_cloexec(fd: RawFd, on: bool) -> Result<(), Error> {
-    let mut flags = unsafe { FdFlag::from_bits_unchecked(fcntl(fd, F_GETFD)?) };
-    flags.set(FdFlag::FD_CLOEXEC, on);
-    fcntl(fd, F_SETFD(flags))?;
-    Ok(())
-}
index f36cc17534e3508cedbc2c5b39ec861c57ea655e..e257fe32f234eb461580b3730f96e4c21c4ced6b 100644 (file)
@@ -7,7 +7,6 @@ pub mod compression;
 pub mod crypt;
 pub mod crypt_config;
 pub mod format;
-pub mod fd;
 pub mod fs;
 pub mod io;
 pub mod json;
index 235baca94ef1b165cab8381debc7ce52f6ead5b7..d83c07a9498c24045dfc44710f946866b826ea12 100644 (file)
@@ -22,7 +22,7 @@ zstd = { version = "0.6", features = [ "bindgen" ] }
 pathpatterns = "0.1.2"
 pxar = { version = "0.10.1", features = [ "tokio-io" ] }
 
-proxmox = { version = "0.15.0", features = [ "sortable-macro" ] }
+proxmox = { version = "0.15.3", features = [ "sortable-macro" ] }
 proxmox-router = { version = "1.1", features = [ "cli" ] }
 proxmox-schema = { version = "1", features = [ "api-macro" ] }
 proxmox-time = "1"
index 1ca91f9fbc86fc34fa209e70249872b0d64a7a5b..a64665b3d3518a44b0439dbc9ae880cffa7f8bf9 100644 (file)
@@ -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.15.0" }
+proxmox = { version = "0.15.3" }
 proxmox-lang = "1"
 proxmox-router = { version = "1.1", features = [ "cli" ] }
 proxmox-schema = { version = "1", features = [ "api-macro" ] }
index 377788d9b92520b57591e7f865995e5d721e429d..a49fc6bf479f8400bbf68f1163a30d81dc4b58a2 100644 (file)
@@ -12,6 +12,7 @@ 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 pbs_client::{VsockClient, DEFAULT_VSOCK_PORT};
 
@@ -86,7 +87,7 @@ async fn create_temp_initramfs(ticket: &str, debug: bool) -> Result<(File, Strin
     let (tmp_file, tmp_path) =
         make_tmp_file("/tmp/file-restore-qemu.initramfs.tmp", CreateOptions::new())?;
     nix::unistd::unlink(&tmp_path)?;
-    pbs_tools::fd::fd_change_cloexec(tmp_file.as_raw_fd(), false)?;
+    fd_change_cloexec(tmp_file.as_raw_fd(), false)?;
 
     let initramfs = if debug {
         pbs_buildcfg::PROXMOX_BACKUP_INITRAMFS_DBG_FN
@@ -142,7 +143,7 @@ pub async fn start_vm(
     let pid;
     let (mut pid_file, pid_path) = make_tmp_file("/tmp/file-restore-qemu.pid.tmp", CreateOptions::new())?;
     nix::unistd::unlink(&pid_path)?;
-    pbs_tools::fd::fd_change_cloexec(pid_file.as_raw_fd(), false)?;
+    fd_change_cloexec(pid_file.as_raw_fd(), false)?;
 
     let (_ramfs_pid, ramfs_path) = create_temp_initramfs(ticket, debug).await?;
 
@@ -159,7 +160,7 @@ pub async fn start_vm(
         .append(true)
         .create_new(true)
         .open(logfile)?;
-    pbs_tools::fd::fd_change_cloexec(logfd.as_raw_fd(), false)?;
+    fd_change_cloexec(logfd.as_raw_fd(), false)?;
 
     // preface log file with start timestamp so one can see how long QEMU took to start
     writeln!(logfd, "[{}] PBS file restore VM log", {
index b88e5d12eb12bff5b1adfd4f2847cdd0e8fb4902..f0c0c65ee52b84128b33c85e489d7c6eadcabec9 100644 (file)
@@ -30,7 +30,7 @@ tokio-openssl = "0.6.1"
 tower-service = "0.3.0"
 url = "2.1"
 
-proxmox = "0.15.0"
+proxmox = "0.15.3"
 proxmox-io = "1"
 proxmox-lang = "1"
 proxmox-http = { version = "0.5.0", features = [ "client" ] }
index cbaaaa7b4cc552f206621a1e54fb151e1bf9b66c..c533b0f4e0f18ec0348e192daa61fa13de099f37 100644 (file)
@@ -13,11 +13,9 @@ use anyhow::{bail, format_err, Error};
 use futures::future::{self, Either};
 use nix::unistd::{fork, ForkResult};
 
-use proxmox::tools::fd::Fd;
+use proxmox::tools::fd::{fd_change_cloexec, Fd};
 use proxmox_io::{ReadExt, WriteExt};
 
-use pbs_tools::fd::fd_change_cloexec;
-
 // Unfortunately FnBox is nightly-only and Box<FnOnce> is unusable, so just use Box<Fn>...
 type BoxedStoreFunc = Box<dyn FnMut() -> Result<String, Error> + UnwindSafe + Send>;
 
index 94e5fccd15e6436cd2cb1101dc0ad212dfa0dd32..08107101d1cd1fee34a1f5edebacd3389abbfe62 100644 (file)
@@ -26,7 +26,7 @@ tokio-util = { version = "0.6", features = [ "codec", "io" ] }
 pathpatterns = "0.1.2"
 pxar = { version = "0.10.1", features = [ "tokio-io" ] }
 
-proxmox = { version = "0.15.0", features = [ "sortable-macro" ] }
+proxmox = { version = "0.15.3", features = [ "sortable-macro" ] }
 proxmox-router = { version = "1.1", features = [ "cli" ] }
 proxmox-schema = { version = "1", features = [ "api-macro" ] }
 proxmox-time = "1"
index 7e1b2cb6b96d0edf2439a17e121c3c22a96581bf..8e9d1b77122f53e264530bf0dc197618740dc024 100644 (file)
@@ -19,6 +19,6 @@ serde = { version = "1.0", features = ["derive"] }
 serde_json = "1.0"
 serde_cbor = "0.11.1"
 
-proxmox = { version = "0.15.0" }
+proxmox = { version = "0.15.3" }
 proxmox-time = "1"
 proxmox-schema = { version = "1", features = [ "api-macro" ] }
index 195ef1a217115e3af6bdb9c7331e02aa4042fa6e..d44a3ffd837af7aa3c6f599df4c15ff5c265ffc0 100644 (file)
@@ -16,7 +16,7 @@ serde_json = "1.0"
 tokio = { version = "1.6", features = [ "rt", "rt-multi-thread" ] }
 
 pathpatterns = "0.1.2"
-proxmox = "0.15.0"
+proxmox = "0.15.3"
 proxmox-schema = { version = "1", features = [ "api-macro" ] }
 proxmox-router = "1.1"
 pxar = { version = "0.10.1", features = [ "tokio-io" ] }
index 5e7a09e2280ffa56b93a37a0645109943431c038..ec6ff18616babf0e7f98a9f81d4b0fcd90273fc3 100644 (file)
@@ -13,6 +13,8 @@ use serde_json::{json, Value};
 use tokio::io::{AsyncBufReadExt, BufReader};
 
 use proxmox::{identity, sortable};
+use proxmox::tools::fd::fd_change_cloexec;
+
 use proxmox_router::{
     ApiHandler, ApiMethod, ApiResponseFuture, Permission, RpcEnvironment, Router, SubdirMap,
 };
@@ -152,7 +154,7 @@ async fn termproxy(cmd: Option<String>, rpcenv: &mut dyn RpcEnvironment) -> Resu
         move |worker| async move {
             // move inside the worker so that it survives and does not close the port
             // remove CLOEXEC from listenere so that we can reuse it in termproxy
-            pbs_tools::fd::fd_change_cloexec(listener.as_raw_fd(), false)?;
+            fd_change_cloexec(listener.as_raw_fd(), false)?;
 
             let mut arguments: Vec<&str> = Vec::new();
             let fd_string = listener.as_raw_fd().to_string();