]> xenbits.xensource.com Git - libvirt.git/commitdiff
conf: backup: Store incremental backup checkpoint name per-disk
authorPeter Krempa <pkrempa@redhat.com>
Fri, 22 May 2020 07:32:23 +0000 (09:32 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 22 Jun 2020 14:04:29 +0000 (16:04 +0200)
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 <pkrempa@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
src/conf/backup_conf.c
src/conf/backup_conf.h

index c0c6f25d10e3e4cf2911aa1bbfcc6f96e890ea80..92106d8aaa797b46cdb1094dae31e5de5c710f39 100644 (file)
@@ -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;
 }
index b5685317c56c2c9f1d04bd1d51eeb7971ec27654..172eb1cf1cc51ca4ad5807166fd86fb0bc973dd8 100644 (file)
@@ -51,6 +51,7 @@ typedef virDomainBackupDiskDef *virDomainBackupDiskDefPtr;
 struct _virDomainBackupDiskDef {
     char *name;     /* name matching the <target dev='...' of the domain */
     virTristateBool backup; /* whether backup is requested */
+    char *incremental; /* name of the starting point checkpoint of an incremental backup */
     char *exportname; /* name of the NBD export for pull mode backup */
     char *exportbitmap; /* name of the bitmap exposed in NBD for pull mode backup */