libvirt/SOURCES/libvirt-qemu-backup-Implement-support-for-backup-disk-export-name-configuration.patch
2021-10-08 13:11:20 +00:00

47 lines
1.8 KiB
Diff

From ca5b0a17880bd76c2965e86fa6b6ee93dec204b9 Mon Sep 17 00:00:00 2001
Message-Id: <ca5b0a17880bd76c2965e86fa6b6ee93dec204b9@dist-git>
From: Peter Krempa <pkrempa@redhat.com>
Date: Tue, 4 Feb 2020 15:07:41 +0100
Subject: [PATCH] qemu: backup: Implement support for backup disk export name
configuration
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Pass the exportname as configured when exporting the image via NBD and
fill it with the default if it's not configured.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
(cherry picked from commit bce4ac55f8d3df9d649c74d2f35feeaad4422028)
https://bugzilla.redhat.com/show_bug.cgi?id=1207659
Message-Id: <de4d8ed67fa09ec4016bcafb818f9ab704afb305.1580824112.git.pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
---
src/qemu/qemu_backup.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_backup.c b/src/qemu/qemu_backup.c
index c47de2f4a8..2cc0e6ab07 100644
--- a/src/qemu/qemu_backup.c
+++ b/src/qemu/qemu_backup.c
@@ -548,9 +548,12 @@ qemuBackupBeginPullExportDisks(virDomainObjPtr vm,
for (i = 0; i < ndisks; i++) {
struct qemuBackupDiskData *dd = disks + i;
+ if (!dd->backupdisk->exportname)
+ dd->backupdisk->exportname = g_strdup(dd->domdisk->dst);
+
if (qemuMonitorNBDServerAdd(priv->mon,
dd->store->nodeformat,
- dd->domdisk->dst,
+ dd->backupdisk->exportname,
false,
dd->incrementalBitmap) < 0)
return -1;
--
2.25.0