Blame SOURCES/libvirt-conf-backup-Store-incremental-backup-checkpoint-name-per-disk.patch

fbe740
From 7f5c44bfd2b6290e142380775b6a6205ccc43840 Mon Sep 17 00:00:00 2001
fbe740
Message-Id: <7f5c44bfd2b6290e142380775b6a6205ccc43840@dist-git>
fbe740
From: Peter Krempa <pkrempa@redhat.com>
fbe740
Date: Tue, 23 Jun 2020 12:23:37 +0200
fbe740
Subject: [PATCH] conf: backup: Store incremental backup checkpoint name
fbe740
 per-disk
fbe740
MIME-Version: 1.0
fbe740
Content-Type: text/plain; charset=UTF-8
fbe740
Content-Transfer-Encoding: 8bit
fbe740
fbe740
In preparation to allow heterogenous backups store the 'incremental'
fbe740
field per-disk and fill it by default from the per-backup field.
fbe740
fbe740
Having this will be important once we'll want to allow incremental
fbe740
backup working while hotplugging a new disk.
fbe740
fbe740
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
fbe740
Reviewed-by: Eric Blake <eblake@redhat.com>
fbe740
(cherry picked from commit b8295160c36e555d8bcaef5015d0c1e3ae85fb17)
fbe740
https://bugzilla.redhat.com/show_bug.cgi?id=1804593
fbe740
Message-Id: <ee6c31ce5f3400523559793fe40e789656068f7c.1592906423.git.pkrempa@redhat.com>
fbe740
Reviewed-by: Ján Tomko <jtomko@redhat.com>
fbe740
---
fbe740
 src/conf/backup_conf.c | 8 ++++++++
fbe740
 src/conf/backup_conf.h | 1 +
fbe740
 2 files changed, 9 insertions(+)
fbe740
fbe740
diff --git a/src/conf/backup_conf.c b/src/conf/backup_conf.c
fbe740
index 64c8f6cc09..58fb3ec759 100644
fbe740
--- a/src/conf/backup_conf.c
fbe740
+++ b/src/conf/backup_conf.c
fbe740
@@ -71,6 +71,7 @@ virDomainBackupDefFree(virDomainBackupDefPtr def)
fbe740
         virDomainBackupDiskDefPtr disk = def->disks + i;
fbe740
 
fbe740
         g_free(disk->name);
fbe740
+        g_free(disk->incremental);
fbe740
         g_free(disk->exportname);
fbe740
         g_free(disk->exportbitmap);
fbe740
         virObjectUnref(disk->store);
fbe740
@@ -503,5 +504,12 @@ virDomainBackupAlignDisks(virDomainBackupDefPtr def,
fbe740
         }
fbe740
     }
fbe740
 
fbe740
+    for (i = 0; i < def->ndisks; i++) {
fbe740
+        virDomainBackupDiskDefPtr backupdisk = &def->disks[i];
fbe740
+
fbe740
+        if (def->incremental && !backupdisk->incremental)
fbe740
+            backupdisk->incremental = g_strdup(def->incremental);
fbe740
+    }
fbe740
+
fbe740
     return 0;
fbe740
 }
fbe740
diff --git a/src/conf/backup_conf.h b/src/conf/backup_conf.h
fbe740
index 672fd52ee7..7ce7a46ad4 100644
fbe740
--- a/src/conf/backup_conf.h
fbe740
+++ b/src/conf/backup_conf.h
fbe740
@@ -51,6 +51,7 @@ typedef virDomainBackupDiskDef *virDomainBackupDiskDefPtr;
fbe740
 struct _virDomainBackupDiskDef {
fbe740
     char *name;     /* name matching the 
fbe740
     virTristateBool backup; /* whether backup is requested */
fbe740
+    char *incremental; /* name of the starting point checkpoint of an incremental backup */
fbe740
     char *exportname; /* name of the NBD export for pull mode backup */
fbe740
     char *exportbitmap; /* name of the bitmap exposed in NBD for pull mode backup */
fbe740
 
fbe740
-- 
fbe740
2.27.0
fbe740