pve-qemu/debian/patches/pve/0063-PVE-backup-clean-up-directly-in-setup_snapshot_acces.patch
Thomas Lamprecht cb662eb2c1 pve backup: implement features for external backup providers
This series of patches extends our existing QEMU backup integration
for PVE such that it can be used for a in-development external-backup
plugin API.

This includes among other things an API for backup access and teardown
as well as dirty-bitmap management. See the separate patches for more
details and check [v7] and [v8] of this series on the list. The former
is the last revision by Fiona which was already very advanced,
Wolfgang picked that up and extended/adapted it slightly to match
needs that he found during implementation of a test provider and from
feedback of (future) external backup provider like Bareos and Veritas.
This was mainly done to get the QEMU build out for broad QA, we can
still change things here as long as the rest of the series is not yet
applied.

[v7]: https://lore.proxmox.com/pve-devel/20250401173435.221892-1-f.ebner@proxmox.com/
[v8]: https://lore.proxmox.com/pve-devel/20250403123118.264974-1-w.bumiller@proxmox.com/

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-04-03 16:48:42 +02:00

42 lines
1.8 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Fiona Ebner <f.ebner@proxmox.com>
Date: Thu, 3 Apr 2025 14:30:41 +0200
Subject: [PATCH] PVE backup: clean up directly in setup_snapshot_access() when
it fails
The only thing that might need to be cleaned up after
setup_snapshot_access() failed is dropping the cbw filter. Do so in
the single branch it matters inside setup_snapshot_access() itself.
This avoids the need that callers of setup_snapshot_access() use
cleanup_snapshot_access() when the call failed.
Suggested-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Reviewed-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
---
pve-backup.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/pve-backup.c b/pve-backup.c
index 32352fb5ec..2408f182bc 100644
--- a/pve-backup.c
+++ b/pve-backup.c
@@ -576,6 +576,9 @@ static int setup_snapshot_access(PVEBackupDevInfo *di, Error **errp)
di->fleecing.snapshot_access =
bdrv_open(NULL, NULL, snapshot_access_opts, BDRV_O_RDWR | BDRV_O_UNMAP, &local_err);
if (!di->fleecing.snapshot_access) {
+ bdrv_cbw_drop(di->fleecing.cbw);
+ di->fleecing.cbw = NULL;
+
error_setg(errp, "setting up snapshot access for fleecing failed: %s",
local_err ? error_get_pretty(local_err) : "unknown error");
return -1;
@@ -629,7 +632,6 @@ static void create_backup_jobs_bh(void *opaque) {
error_setg(errp, "%s - setting up snapshot access for fleecing failed: %s",
di->device_name,
local_err ? error_get_pretty(local_err) : "unknown error");
- cleanup_snapshot_access(di);
bdrv_drained_end(di->bs);
break;
}