render / rpms / libvirt

Forked from rpms/libvirt 10 months ago
Clone
Blob Blame History Raw
From fc87d33beca46597b7d413752a07f50af8579a6a Mon Sep 17 00:00:00 2001
Message-Id: <fc87d33beca46597b7d413752a07f50af8579a6a@dist-git>
From: Peter Krempa <pkrempa@redhat.com>
Date: Tue, 4 Feb 2020 15:07:42 +0100
Subject: [PATCH] qemu: backup: Implement support for backup disk bitmap name
 configuration
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Use the user-configured name of the bitmap when merging the appropriate
bitmaps for an incremental backup so that the user can see it as
configured. Additionally expose the default bitmap name if nothing is
configured.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
(cherry picked from commit 0c3792a155d79ecf39221b9856fa14fde183af91)

https://bugzilla.redhat.com/show_bug.cgi?id=1207659
Message-Id: <0071b6d1293859c700344434e71e3b2f75ce6ffd.1580824112.git.pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
---
 src/qemu/qemu_backup.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/qemu/qemu_backup.c b/src/qemu/qemu_backup.c
index 2cc0e6ab07..23518a5d40 100644
--- a/src/qemu/qemu_backup.c
+++ b/src/qemu/qemu_backup.c
@@ -322,7 +322,10 @@ qemuBackupDiskPrepareDataOne(virDomainObjPtr vm,
         return -1;
 
     if (incremental) {
-        dd->incrementalBitmap = g_strdup_printf("backup-%s", dd->domdisk->dst);
+        if (dd->backupdisk->exportbitmap)
+            dd->incrementalBitmap = g_strdup(dd->backupdisk->exportbitmap);
+        else
+            dd->incrementalBitmap = g_strdup_printf("backup-%s", dd->domdisk->dst);
 
         if (qemuBackupDiskPrepareOneBitmaps(dd, actions, incremental,
                                             blockNamedNodeData) < 0)
@@ -368,6 +371,10 @@ static int
 qemuBackupDiskPrepareDataOnePull(virJSONValuePtr actions,
                                  struct qemuBackupDiskData *dd)
 {
+    if (!dd->backupdisk->exportbitmap &&
+        dd->incrementalBitmap)
+        dd->backupdisk->exportbitmap = g_strdup(dd->incrementalBitmap);
+
     if (qemuMonitorTransactionBackup(actions,
                                      dd->domdisk->src->nodeformat,
                                      dd->blockjob->name,
-- 
2.25.0