[pbs-devel] [PATCH proxmox-backup-qemu 1/2] use UploadOptions for uploading Blobs

Fabian Grünbichler f.gruenbichler at proxmox.com
Mon Jan 25 14:43:01 CET 2021


Signed-off-by: Fabian Grünbichler <f.gruenbichler at proxmox.com>
---

Notes:
    needs corresponding proxmox-backup commit

 src/commands.rs | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/src/commands.rs b/src/commands.rs
index 2f6eb0f..c63c4f7 100644
--- a/src/commands.rs
+++ b/src/commands.rs
@@ -93,7 +93,13 @@ pub(crate) async fn add_config(
 
     let blob_name = format!("{}.blob", name);
 
-    let stats = client.upload_blob_from_data(data, &blob_name, compress, crypt_mode == CryptMode::Encrypt).await?;
+    let options = UploadOptions {
+        compress,
+        encrypt: crypt_mode == CryptMode::Encrypt,
+        ..UploadOptions::default()
+    };
+
+    let stats = client.upload_blob_from_data(data, &blob_name, options).await?;
 
     let mut guard = manifest.lock().unwrap();
     guard.add_file(blob_name, stats.size, stats.csum, crypt_mode)?;
@@ -457,8 +463,13 @@ pub(crate) async fn finish_backup(
         *key_fingerprint_guard = key_fingerprint;
     }
 
+    let options = UploadOptions {
+        compress: true,
+        ..UploadOptions::default()
+    };
+
     client
-        .upload_blob_from_data(manifest.into_bytes(), MANIFEST_BLOB_NAME, true, false)
+        .upload_blob_from_data(manifest.into_bytes(), MANIFEST_BLOB_NAME, options)
         .await?;
 
     client.finish().await?;
-- 
2.20.1






More information about the pbs-devel mailing list