From: Dietmar Maurer <dietmar@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [proxmox-backup-qemu] update dependencies to latest proxmox-backup git version
Date: Fri, 5 Nov 2021 13:19:09 +0100 [thread overview]
Message-ID: <20211105121909.2957236-1-dietmar@proxmox.com> (raw)
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
---
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<Vec<u8>>>;
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
next reply other threads:[~2021-11-05 12:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-05 12:19 Dietmar Maurer [this message]
2021-11-24 8:18 ` [pve-devel] [PATCH proxmox-backup-qemu 1/2] update deps to pbs 2.1.1 Fabian Grünbichler
2021-11-24 8:18 ` [pve-devel] [PATCH proxmox-backup-qemu 2/2] fix clippy warnings Fabian Grünbichler
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211105121909.2957236-1-dietmar@proxmox.com \
--to=dietmar@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.