render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
a41c76
From fc87d33beca46597b7d413752a07f50af8579a6a Mon Sep 17 00:00:00 2001
a41c76
Message-Id: <fc87d33beca46597b7d413752a07f50af8579a6a@dist-git>
a41c76
From: Peter Krempa <pkrempa@redhat.com>
a41c76
Date: Tue, 4 Feb 2020 15:07:42 +0100
a41c76
Subject: [PATCH] qemu: backup: Implement support for backup disk bitmap name
a41c76
 configuration
a41c76
MIME-Version: 1.0
a41c76
Content-Type: text/plain; charset=UTF-8
a41c76
Content-Transfer-Encoding: 8bit
a41c76
a41c76
Use the user-configured name of the bitmap when merging the appropriate
a41c76
bitmaps for an incremental backup so that the user can see it as
a41c76
configured. Additionally expose the default bitmap name if nothing is
a41c76
configured.
a41c76
a41c76
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
a41c76
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
a41c76
(cherry picked from commit 0c3792a155d79ecf39221b9856fa14fde183af91)
a41c76
a41c76
https://bugzilla.redhat.com/show_bug.cgi?id=1207659
a41c76
Message-Id: <0071b6d1293859c700344434e71e3b2f75ce6ffd.1580824112.git.pkrempa@redhat.com>
a41c76
Reviewed-by: Ján Tomko <jtomko@redhat.com>
a41c76
---
a41c76
 src/qemu/qemu_backup.c | 9 ++++++++-
a41c76
 1 file changed, 8 insertions(+), 1 deletion(-)
a41c76
a41c76
diff --git a/src/qemu/qemu_backup.c b/src/qemu/qemu_backup.c
a41c76
index 2cc0e6ab07..23518a5d40 100644
a41c76
--- a/src/qemu/qemu_backup.c
a41c76
+++ b/src/qemu/qemu_backup.c
a41c76
@@ -322,7 +322,10 @@ qemuBackupDiskPrepareDataOne(virDomainObjPtr vm,
a41c76
         return -1;
a41c76
 
a41c76
     if (incremental) {
a41c76
-        dd->incrementalBitmap = g_strdup_printf("backup-%s", dd->domdisk->dst);
a41c76
+        if (dd->backupdisk->exportbitmap)
a41c76
+            dd->incrementalBitmap = g_strdup(dd->backupdisk->exportbitmap);
a41c76
+        else
a41c76
+            dd->incrementalBitmap = g_strdup_printf("backup-%s", dd->domdisk->dst);
a41c76
 
a41c76
         if (qemuBackupDiskPrepareOneBitmaps(dd, actions, incremental,
a41c76
                                             blockNamedNodeData) < 0)
a41c76
@@ -368,6 +371,10 @@ static int
a41c76
 qemuBackupDiskPrepareDataOnePull(virJSONValuePtr actions,
a41c76
                                  struct qemuBackupDiskData *dd)
a41c76
 {
a41c76
+    if (!dd->backupdisk->exportbitmap &&
a41c76
+        dd->incrementalBitmap)
a41c76
+        dd->backupdisk->exportbitmap = g_strdup(dd->incrementalBitmap);
a41c76
+
a41c76
     if (qemuMonitorTransactionBackup(actions,
a41c76
                                      dd->domdisk->src->nodeformat,
a41c76
                                      dd->blockjob->name,
a41c76
-- 
a41c76
2.25.0
a41c76