render / rpms / libvirt

Forked from rpms/libvirt 10 months ago
Clone
fbe740
From dc4997ee498486135e46ca0e121835935bbf26db Mon Sep 17 00:00:00 2001
fbe740
Message-Id: <dc4997ee498486135e46ca0e121835935bbf26db@dist-git>
fbe740
From: Peter Krempa <pkrempa@redhat.com>
fbe740
Date: Tue, 4 Feb 2020 15:07:53 +0100
fbe740
Subject: [PATCH] qemu: checkpoint: Use disk definition directly when creating
fbe740
 checkpoint
fbe740
MIME-Version: 1.0
fbe740
Content-Type: text/plain; charset=UTF-8
fbe740
Content-Transfer-Encoding: 8bit
fbe740
fbe740
Lookup the whole disk definition rather than just the node name.
fbe740
fbe740
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
fbe740
Reviewed-by: Eric Blake <eblake@redhat.com>
fbe740
(cherry picked from commit 7973f7d7926ac9dbc5464e6be6eb2aaacecc2251)
fbe740
fbe740
https://bugzilla.redhat.com/show_bug.cgi?id=1207659
fbe740
Message-Id: <d4ad0d55d36cfc8c1af9a997930936364e94648c.1580824112.git.pkrempa@redhat.com>
fbe740
Reviewed-by: Ján Tomko <jtomko@redhat.com>
fbe740
---
fbe740
 src/qemu/qemu_checkpoint.c | 16 +++++++++++-----
fbe740
 1 file changed, 11 insertions(+), 5 deletions(-)
fbe740
fbe740
diff --git a/src/qemu/qemu_checkpoint.c b/src/qemu/qemu_checkpoint.c
fbe740
index 0aa854324b..03a8321135 100644
fbe740
--- a/src/qemu/qemu_checkpoint.c
fbe740
+++ b/src/qemu/qemu_checkpoint.c
fbe740
@@ -320,12 +320,16 @@ qemuCheckpointAddActions(virDomainObjPtr vm,
fbe740
 
fbe740
     for (i = 0; i < def->ndisks; i++) {
fbe740
         virDomainCheckpointDiskDef *chkdisk = &def->disks[i];
fbe740
-        const char *node;
fbe740
+        virDomainDiskDefPtr domdisk = virDomainDiskByTarget(vm->def, chkdisk->name);
fbe740
 
fbe740
-        if (chkdisk->type != VIR_DOMAIN_CHECKPOINT_TYPE_BITMAP)
fbe740
+        /* checkpoint definition validator mandates that the corresponding
fbe740
+         * domdisk should exist */
fbe740
+        if (!domdisk ||
fbe740
+            chkdisk->type != VIR_DOMAIN_CHECKPOINT_TYPE_BITMAP)
fbe740
             continue;
fbe740
-        node = qemuDomainDiskNodeFormatLookup(vm, chkdisk->name);
fbe740
-        if (qemuMonitorTransactionBitmapAdd(actions, node, chkdisk->bitmap, true, false, 0) < 0)
fbe740
+
fbe740
+        if (qemuMonitorTransactionBitmapAdd(actions, domdisk->src->nodeformat,
fbe740
+                                            chkdisk->bitmap, true, false, 0) < 0)
fbe740
             return -1;
fbe740
 
fbe740
         /* We only want one active bitmap for a disk along the
fbe740
@@ -348,7 +352,9 @@ qemuCheckpointAddActions(virDomainObjPtr vm,
fbe740
                 if (STRNEQ(chkdisk->name, disk2->name) ||
fbe740
                     disk2->type != VIR_DOMAIN_CHECKPOINT_TYPE_BITMAP)
fbe740
                     continue;
fbe740
-                if (qemuMonitorTransactionBitmapDisable(actions, node, disk2->bitmap) < 0)
fbe740
+                if (qemuMonitorTransactionBitmapDisable(actions,
fbe740
+                                                        domdisk->src->nodeformat,
fbe740
+                                                        disk2->bitmap) < 0)
fbe740
                     return -1;
fbe740
                 search_parents = false;
fbe740
                 break;
fbe740
-- 
fbe740
2.25.0
fbe740