[PATCH 9/9] qemu: backup: Add partial validation of incremental backup checkpoint

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Verify that the checkpoint requested by an incremental backup exists.
Unfortunately validating whether the checkpoint configuration actually
matches the disk may not be reasonably feasible as the disk may have
been renamed/snapshotted/etc. We still rely on bitmap presence.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/qemu/qemu_backup.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/src/qemu/qemu_backup.c b/src/qemu/qemu_backup.c
index d0c852cf80..92cdf34c46 100644
--- a/src/qemu/qemu_backup.c
+++ b/src/qemu/qemu_backup.c
@@ -277,6 +277,17 @@ qemuBackupDiskPrepareDataOne(virDomainObjPtr vm,
         return -1;

     if (dd->backupdisk->incremental) {
+        /* We deliberately don't check the config of the disk in the checkpoint
+         * definition as it's not guaranteed that the disks still correspond.
+         * We just verify that a checkpoint exists and later on that the disk
+         * has corresponding bitmap. */
+        if (!virDomainCheckpointFindByName(vm->checkpoints, dd->backupdisk->incremental)) {
+            virReportError(VIR_ERR_NO_DOMAIN_CHECKPOINT,
+                           _("Checkpoint '%s' for incremental backup of disk '%s' not found"),
+                           dd->backupdisk->incremental, dd->backupdisk->name);
+            return -1;
+        }
+
         if (dd->backupdisk->exportbitmap)
             dd->incrementalBitmap = g_strdup(dd->backupdisk->exportbitmap);
         else
-- 
2.26.2




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux