render / rpms / libvirt

Forked from rpms/libvirt 10 months ago
Clone
ad1c90
From 2069251b1f50e1aaec566909478f1443ccfe32e6 Mon Sep 17 00:00:00 2001
ad1c90
Message-Id: <2069251b1f50e1aaec566909478f1443ccfe32e6@dist-git>
ad1c90
From: Peter Krempa <pkrempa@redhat.com>
ad1c90
Date: Tue, 21 Jul 2020 13:56:22 +0200
ad1c90
Subject: [PATCH] qemu: blockjob: Actually delete temporary bitmap on failed
ad1c90
 active commit
ad1c90
ad1c90
Commit 20a7abc2d2d tried to delete the possibly leftover bitmap but
ad1c90
neglected to call the actual monitor to do so.
ad1c90
ad1c90
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
ad1c90
Reviewed-by: Eric Blake <eblake@redhat.com>
ad1c90
(cherry picked from commit 378e4fbc795c607485799cbd060f34483f580544)
ad1c90
ad1c90
rhel-8.3: https://bugzilla.redhat.com/show_bug.cgi?id=1857779
ad1c90
rhel-av-8.2.1: not cloned yet
ad1c90
Message-Id: <add765f8f49b70dbfe1c2adf7e63e6e21b480c6d.1595332476.git.pkrempa@redhat.com>
ad1c90
ad1c90
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
ad1c90
---
ad1c90
 src/qemu/qemu_blockjob.c | 13 +++++++++++--
ad1c90
 1 file changed, 11 insertions(+), 2 deletions(-)
ad1c90
ad1c90
diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c
ad1c90
index 7e2df1445d..486fca31f3 100644
ad1c90
--- a/src/qemu/qemu_blockjob.c
ad1c90
+++ b/src/qemu/qemu_blockjob.c
ad1c90
@@ -1378,8 +1378,10 @@ qemuBlockJobProcessEventConcludedCopyAbort(virQEMUDriverPtr driver,
ad1c90
 static void
ad1c90
 qemuBlockJobProcessEventFailedActiveCommit(virQEMUDriverPtr driver,
ad1c90
                                            virDomainObjPtr vm,
ad1c90
-                                           qemuBlockJobDataPtr job)
ad1c90
+                                           qemuBlockJobDataPtr job,
ad1c90
+                                           qemuDomainAsyncJob asyncJob)
ad1c90
 {
ad1c90
+    qemuDomainObjPrivatePtr priv = vm->privateData;
ad1c90
     g_autoptr(virJSONValue) actions = virJSONValueNewArray();
ad1c90
     virDomainDiskDefPtr disk = job->disk;
ad1c90
 
ad1c90
@@ -1391,6 +1393,13 @@ qemuBlockJobProcessEventFailedActiveCommit(virQEMUDriverPtr driver,
ad1c90
     ignore_value(qemuMonitorTransactionBitmapRemove(actions, disk->mirror->nodeformat,
ad1c90
                                                     "libvirt-tmp-activewrite"));
ad1c90
 
ad1c90
+    if (qemuDomainObjEnterMonitorAsync(priv->driver, vm, asyncJob) < 0)
ad1c90
+        return;
ad1c90
+
ad1c90
+    qemuMonitorTransaction(priv->mon, &actions);
ad1c90
+
ad1c90
+    if (qemuDomainObjExitMonitor(priv->driver, vm) < 0)
ad1c90
+        return;
ad1c90
 
ad1c90
     /* Ideally, we would make the backing chain read only again (yes, SELinux
ad1c90
      * can do that using different labels). But that is not implemented yet and
ad1c90
@@ -1515,7 +1524,7 @@ qemuBlockJobEventProcessConcludedTransition(qemuBlockJobDataPtr job,
ad1c90
         if (success) {
ad1c90
             qemuBlockJobProcessEventCompletedActiveCommit(driver, vm, job, asyncJob);
ad1c90
         } else {
ad1c90
-            qemuBlockJobProcessEventFailedActiveCommit(driver, vm, job);
ad1c90
+            qemuBlockJobProcessEventFailedActiveCommit(driver, vm, job, asyncJob);
ad1c90
         }
ad1c90
         break;
ad1c90
 
ad1c90
-- 
ad1c90
2.27.0
ad1c90