render / rpms / libvirt

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