]> git.proxmox.com Git - pve-qemu.git/blame - debian/patches/pve/0040-PVE-fixup-pbs-restore-API.patch
Fix dirty-bitmap PBS backup with multiple drives
[pve-qemu.git] / debian / patches / pve / 0040-PVE-fixup-pbs-restore-API.patch
CommitLineData
3ab149cc
TL
1From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2From: Stefan Reiter <s.reiter@proxmox.com>
3Date: Mon, 6 Jul 2020 14:40:12 +0200
4Subject: [PATCH] PVE: fixup pbs-restore API
5
6Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
7---
8 pbs-restore.c | 10 ++++++++--
9 1 file changed, 8 insertions(+), 2 deletions(-)
10
11diff --git a/pbs-restore.c b/pbs-restore.c
12index 4bf37ef1fa..ff3fc38e8a 100644
13--- a/pbs-restore.c
14+++ b/pbs-restore.c
15@@ -161,13 +161,19 @@ int main(int argc, char **argv)
16 fprintf(stderr, "connecting to repository '%s'\n", repository);
17 }
18 char *pbs_error = NULL;
19- ProxmoxRestoreHandle *conn = proxmox_restore_connect(
20+ ProxmoxRestoreHandle *conn = proxmox_restore_new(
21 repository, snapshot, password, keyfile, key_password, fingerprint, &pbs_error);
22 if (conn == NULL) {
23 fprintf(stderr, "restore failed: %s\n", pbs_error);
24 return -1;
25 }
26
27+ int res = proxmox_restore_connect(conn, &pbs_error);
28+ if (res < 0 || pbs_error) {
29+ fprintf(stderr, "restore failed (connection error): %s\n", pbs_error);
30+ return -1;
31+ }
32+
33 QDict *options = qdict_new();
34
35 if (format) {
36@@ -198,7 +204,7 @@ int main(int argc, char **argv)
37 fprintf(stderr, "starting to restore snapshot '%s'\n", snapshot);
38 fflush(stderr); // ensure we do not get printed after the progress log
39 }
40- int res = proxmox_restore_image(
41+ res = proxmox_restore_image(
42 conn,
43 archive_name,
44 write_callback,