[pve-devel] [PATCH qemu v5 05/32] PVE backup: backup-access api: indicate situation where a bitmap was recreated
Fiona Ebner
f.ebner at proxmox.com
Fri Mar 21 14:48:25 CET 2025
The backup-access api keeps track of what bitmap names got used for
which devices and thus knows when a bitmap went missing. Propagate
this information to the QMP user with a new 'missing-recreated'
variant for the taken bitmap action.
Signed-off-by: Fiona Ebner <f.ebner at proxmox.com>
---
New in v5.
pve-backup.c | 6 +++++-
qapi/block-core.json | 9 ++++++++-
2 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/pve-backup.c b/pve-backup.c
index bcbb9eeb5b..d616449e5d 100644
--- a/pve-backup.c
+++ b/pve-backup.c
@@ -1036,7 +1036,11 @@ BackupAccessInfoList *coroutine_fn qmp_backup_access_setup(
goto err;
}
bdrv_set_dirty_bitmap(bitmap, 0, di->size);
- action = PBS_BITMAP_ACTION_NEW;
+ if (same_bitmap_name) {
+ action = PBS_BITMAP_ACTION_MISSING_RECREATED;
+ } else {
+ action = PBS_BITMAP_ACTION_NEW;
+ }
} else {
/* track clean chunks as reused */
dirty = MIN(bdrv_get_dirty_count(bitmap), di->size);
diff --git a/qapi/block-core.json b/qapi/block-core.json
index 63a5be0f3f..fa6166ab79 100644
--- a/qapi/block-core.json
+++ b/qapi/block-core.json
@@ -1067,9 +1067,16 @@
# base snapshot did not match the base given for the current job or
# the crypt mode has changed.
#
+# @missing-recreated: A bitmap for incremental backup was expected to be
+# present, but was missing and thus got recreated. For example, this can
+# happen if the drive was re-attached or if the bitmap was deleted for some
+# other reason. PBS does not currently keep track of this; the backup-access
+# mechanism does.
+#
##
{ 'enum': 'PBSBitmapAction',
- 'data': ['not-used', 'not-used-removed', 'new', 'used', 'invalid'] }
+ 'data': ['not-used', 'not-used-removed', 'new', 'used', 'invalid',
+ 'missing-recreated'] }
##
# @PBSBitmapInfo:
--
2.39.5
More information about the pve-devel
mailing list