From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Stefan Reiter Date: Mon, 6 Jul 2020 14:40:14 +0200 Subject: [PATCH] PVE: use proxmox_backup_check_incremental Signed-off-by: Stefan Reiter Signed-off-by: Thomas Lamprecht --- pve-backup.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/pve-backup.c b/pve-backup.c index bda1635b82..46191bb328 100644 --- a/pve-backup.c +++ b/pve-backup.c @@ -728,17 +728,22 @@ static void coroutine_fn pvebackup_co_prepare(void *opaque) BdrvDirtyBitmap *bitmap = bdrv_find_dirty_bitmap(di->bs, PBS_BITMAP_NAME); if (use_dirty_bitmap) { + use_dirty_bitmap = proxmox_backup_check_incremental(pbs, devname, di->size) != 0; + if (bitmap == NULL) { bitmap = bdrv_create_dirty_bitmap(di->bs, dump_cb_block_size, PBS_BITMAP_NAME, task->errp); if (!bitmap) { goto err; } - /* mark entire bitmap as dirty to make full backup first */ use_dirty_bitmap = false; + } + + if (use_dirty_bitmap) { + dirty += bdrv_get_dirty_count(bitmap); + } else { + /* mark entire bitmap as dirty to make full backup */ bdrv_set_dirty_bitmap(bitmap, 0, di->size); dirty += di->size; - } else { - dirty += bdrv_get_dirty_count(bitmap); } di->bitmap = bitmap; } else {