[libvirt] [PATCH 2/2] qemuProcessStop: Simulate blockjob --abort on destroy

Michal Privoznik mprivozn at redhat.com
Tue Nov 19 09:14:09 UTC 2019


If user starts a blockcommit without --pivot then we modify
access for qemu on both images and leave it like that until
pivot is executed. So far so good. Problem is, if user instead
of issuing pivot calls destroy on the domain. In this case we
don't ever clear the access we granted at the beginning.

https://bugzilla.redhat.com/show_bug.cgi?id=1741456#c19

Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
---
 src/qemu/qemu_process.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 8cb12ac9a6..fa9167441e 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -7617,6 +7617,15 @@ void qemuProcessStop(virQEMUDriverPtr driver,
     for (i = 0; i < vm->def->niothreadids; i++)
         vm->def->iothreadids[i]->thread_id = 0;
 
+    for (i = 0; i < def->ndisks; i++) {
+        virDomainDiskDefPtr disk = def->disks[i];
+
+        if (!disk->mirror)
+            continue;
+
+        qemuBlockRemoveImageMetadata(driver, vm, disk->dst, disk->mirror);
+    }
+
     /* clear all private data entries which are no longer needed */
     qemuDomainObjPrivateDataClear(priv);
 
-- 
2.23.0




More information about the libvir-list mailing list