From: Peter Krempa Date: Fri, 22 May 2020 07:32:23 +0000 (+0200) Subject: conf: backup: Store incremental backup checkpoint name per-disk X-Git-Tag: v6.5.0-rc1~116 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b8295160c36e555d8bcaef5015d0c1e3ae85fb17;p=thirdparty%2Flibvirt.git conf: backup: Store incremental backup checkpoint name per-disk 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 --- diff --git a/src/conf/backup_conf.c b/src/conf/backup_conf.c index c0c6f25d10..92106d8aaa 100644 --- a/src/conf/backup_conf.c +++ b/src/conf/backup_conf.c @@ -72,6 +72,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); @@ -505,5 +506,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 b5685317c5..172eb1cf1c 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