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

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