From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 405B77C64C for ; Fri, 5 Nov 2021 13:27:48 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 30D09B86C for ; Fri, 5 Nov 2021 13:27:48 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id 61687B863 for ; Fri, 5 Nov 2021 13:27:46 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id AE8C646030; Fri, 5 Nov 2021 13:19:14 +0100 (CET) From: Dietmar Maurer To: pve-devel@lists.proxmox.com Date: Fri, 5 Nov 2021 13:19:09 +0100 Message-Id: <20211105121909.2957236-1-dietmar@proxmox.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.394 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment KAM_LOTSOFHASH 0.25 Emails with lots of hash-like gibberish SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pve-devel] [proxmox-backup-qemu] update dependencies to latest proxmox-backup git version X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Nov 2021 12:27:48 -0000 Signed-off-by: Dietmar Maurer --- Cargo.toml | 15 +++++++++++---- src/backup.rs | 11 +++++++---- src/commands.rs | 15 +++++++++------ src/lib.rs | 11 ++++++----- src/restore.rs | 13 ++++++++++--- src/shared_cache.rs | 2 +- src/upload_queue.rs | 6 ++++-- 7 files changed, 48 insertions(+), 25 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 5dbe483..d9a7de1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,10 +27,17 @@ lazy_static = "1.4" libc = "0.2" once_cell = "1.5" openssl = "0.10" -proxmox = { version = "0.11.5", features = [ "sortable-macro", "api-macro" ] } -#proxmox = { path = "../proxmox/proxmox" } -proxmox-backup = { git = "git://git.proxmox.com/git/proxmox-backup.git", commit = "74a4f9efc95794acb3ea1e8d72ef9ead8f78e250" } -#proxmox-backup = { path = "../proxmox-backup" } +proxmox = { version = "0.15.0", features = [ "sortable-macro"] } +proxmox-schema = { version = "1", features = [ "api-macro" ] } +proxmox-lang = "1" + +pbs-runtime = { git = "git://git.proxmox.com/git/proxmox-backup.git", rev = "2bc1250c28de0ecf595b9933af9f900cbee52fdc" } +pbs-api-types = { git = "git://git.proxmox.com/git/proxmox-backup.git", rev = "2bc1250c28de0ecf595b9933af9f900cbee52fdc" } +pbs-tools = { git = "git://git.proxmox.com/git/proxmox-backup.git", rev = "2bc1250c28de0ecf595b9933af9f900cbee52fdc" } +pbs-config = { git = "git://git.proxmox.com/git/proxmox-backup.git", rev = "2bc1250c28de0ecf595b9933af9f900cbee52fdc" } +pbs-datastore = { git = "git://git.proxmox.com/git/proxmox-backup.git", rev = "2bc1250c28de0ecf595b9933af9f900cbee52fdc" } +pbs-client = { git = "git://git.proxmox.com/git/proxmox-backup.git" , rev = "2bc1250c28de0ecf595b9933af9f900cbee52fdc" } + serde_json = "1.0" tokio = { version = "1.6", features = [ "fs", "io-util", "macros", "net", "rt-multi-thread", "signal", "time" ] } tokio-stream = "0.1.1" diff --git a/src/backup.rs b/src/backup.rs index 8f64979..186730f 100644 --- a/src/backup.rs +++ b/src/backup.rs @@ -7,12 +7,15 @@ use std::os::raw::c_int; use futures::future::{Future, Either, FutureExt}; use tokio::runtime::Runtime; -use proxmox_backup::tools::runtime::get_runtime_with_builder; -use proxmox_backup::backup::{CryptConfig, CryptMode, BackupDir, BackupManifest, KeyConfig, load_and_decrypt_key, rsa_encrypt_key_config}; -use proxmox_backup::client::{HttpClient, HttpClientOptions, BackupWriter}; - use proxmox::tools::fs::file_get_contents; +use pbs_runtime::get_runtime_with_builder; +use pbs_api_types::CryptMode; +use pbs_tools::crypt_config::CryptConfig; +use pbs_config::key_config::{KeyConfig, load_and_decrypt_key, rsa_encrypt_key_config}; +use pbs_datastore::{BackupDir, BackupManifest,}; +use pbs_client::{HttpClient, HttpClientOptions, BackupWriter}; + use super::BackupSetup; use crate::capi_types::*; use crate::registry::Registry; diff --git a/src/commands.rs b/src/commands.rs index 5fdf318..c2a1abb 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -6,12 +6,16 @@ use std::os::raw::c_int; use futures::future::{Future, TryFutureExt}; use serde_json::json; -use proxmox_backup::backup::*; -use proxmox_backup::client::*; +use pbs_api_types::CryptMode; +use pbs_tools::crypt_config::CryptConfig; +use pbs_datastore::index::IndexFile; +use pbs_datastore::data_blob::DataChunkBuilder; +use pbs_datastore::manifest::{BackupManifest, MANIFEST_BLOB_NAME, ENCRYPTED_KEY_BLOB_NAME}; +use pbs_client::{BackupWriter, H2Client, UploadOptions}; use crate::registry::Registry; -use crate::capi_types::*; -use crate::upload_queue::*; +use crate::capi_types::DataPointer; +use crate::upload_queue::{ChunkUploadInfo, UploadQueueSender, UploadResultReceiver, create_upload_queue}; use lazy_static::lazy_static; @@ -160,7 +164,7 @@ pub(crate) fn check_last_encryption_key( let fingerprint_guard = PREVIOUS_KEY_FINGERPRINT.lock().unwrap(); match (*fingerprint_guard, config) { (Some(last_fingerprint), Some(current_config)) => { - current_config.fingerprint().bytes() == &last_fingerprint + current_config.fingerprint() == last_fingerprint || crypt_config_digest(current_config) == last_fingerprint }, (None, None) => true, @@ -462,7 +466,6 @@ pub(crate) async fn finish_backup( Some(current_config) => { let fp = current_config .fingerprint() - .bytes() .to_owned(); Some(fp) }, diff --git a/src/lib.rs b/src/lib.rs index aa167f7..436a592 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -6,10 +6,11 @@ use std::ptr; use std::os::raw::{c_uchar, c_char, c_int, c_void, c_long}; use std::sync::{Arc, Mutex, Condvar}; -use proxmox::try_block; -use proxmox_backup::api2::types::Authid; -use proxmox_backup::backup::{CryptMode, BackupDir}; -use proxmox_backup::client::BackupRepository; +use proxmox_lang::try_block; + +use pbs_api_types::{Authid, CryptMode}; +use pbs_datastore::BackupDir; +use pbs_client::BackupRepository; mod capi_types; use capi_types::*; @@ -841,7 +842,7 @@ pub extern "C" fn proxmox_restore_image( callback(callback_data, offset, std::ptr::null(), len) }; - proxmox_backup::tools::runtime::block_on( + pbs_runtime::block_on( restore_task.restore_image(archive_name, write_data_callback, write_zero_callback, verbose) )?; diff --git a/src/restore.rs b/src/restore.rs index 33959d9..e034aa2 100644 --- a/src/restore.rs +++ b/src/restore.rs @@ -5,9 +5,16 @@ use anyhow::{format_err, bail, Error}; use once_cell::sync::OnceCell; use tokio::runtime::Runtime; -use proxmox_backup::tools::runtime::get_runtime_with_builder; -use proxmox_backup::backup::*; -use proxmox_backup::client::{HttpClient, HttpClientOptions, BackupReader, RemoteChunkReader}; +use pbs_runtime::get_runtime_with_builder; +use pbs_tools::crypt_config::CryptConfig; +use pbs_config::key_config::load_and_decrypt_key; +use pbs_datastore::BackupManifest; +use pbs_datastore::index::IndexFile; +use pbs_datastore::cached_chunk_reader::CachedChunkReader; +use pbs_datastore::fixed_index::FixedIndexReader; +use pbs_datastore::data_blob::DataChunkBuilder; +use pbs_datastore::read_chunk::ReadChunk; +use pbs_client::{HttpClient, HttpClientOptions, BackupReader, RemoteChunkReader}; use super::BackupSetup; use crate::registry::Registry; diff --git a/src/shared_cache.rs b/src/shared_cache.rs index 32ac430..6941cfe 100644 --- a/src/shared_cache.rs +++ b/src/shared_cache.rs @@ -1,5 +1,5 @@ use once_cell::sync::OnceCell; -use proxmox_backup::tools::async_lru_cache::AsyncLruCache; +use pbs_tools::async_lru_cache::AsyncLruCache; use std::sync::{Arc, Mutex}; type ChunkCache = AsyncLruCache<[u8; 32], Arc>>; diff --git a/src/upload_queue.rs b/src/upload_queue.rs index bc1d991..e513784 100644 --- a/src/upload_queue.rs +++ b/src/upload_queue.rs @@ -5,8 +5,10 @@ use std::sync::{Mutex, Arc}; use futures::future::Future; use serde_json::json; use tokio::sync::{mpsc, oneshot}; -use proxmox_backup::backup::*; -use proxmox_backup::client::*; + +use pbs_datastore::index::IndexFile; +use pbs_datastore::fixed_index::FixedIndexReader; +use pbs_client::*; pub(crate) struct ChunkUploadInfo { pub digest: [u8; 32], -- 2.30.2