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