[PATCH] qemuBackupDiskDataCleanupOne: Don't skip rest of cleanup if we can't enter monitor

Peter Krempa posted 1 patch 1 month, 3 weeks ago
src/qemu/qemu_backup.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
[PATCH] qemuBackupDiskDataCleanupOne: Don't skip rest of cleanup if we can't enter monitor
Posted by Peter Krempa 1 month, 3 weeks ago
Recent fix to use the proper 'async' monitor function would cause
libvirt to leak some of the objects it's supposed to clean up in other
places besides qemu.

Don't skip the whole function on failure to enter the job but just the
monitor section.

Fixes: 9b22c25548aa658acdeac2269ddae32584df32d8
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
---
 src/qemu/qemu_backup.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/qemu/qemu_backup.c b/src/qemu/qemu_backup.c
index 5eb2cbe306..f64639d501 100644
--- a/src/qemu/qemu_backup.c
+++ b/src/qemu/qemu_backup.c
@@ -125,10 +125,10 @@ qemuBackupDiskDataCleanupOne(virDomainObj *vm,

     if (!dd->started) {
         if (dd->added) {
-            if (qemuDomainObjEnterMonitorAsync(vm, VIR_ASYNC_JOB_BACKUP) < 0)
-                return;
-            qemuBlockStorageSourceAttachRollback(priv->mon, dd->crdata->srcdata[0]);
-            qemuDomainObjExitMonitor(vm);
+            if (qemuDomainObjEnterMonitorAsync(vm, VIR_ASYNC_JOB_BACKUP) == 0) {
+                qemuBlockStorageSourceAttachRollback(priv->mon, dd->crdata->srcdata[0]);
+                qemuDomainObjExitMonitor(vm);
+            }
         }

         if (dd->created) {
-- 
2.46.0
Re: [PATCH] qemuBackupDiskDataCleanupOne: Don't skip rest of cleanup if we can't enter monitor
Posted by Michal Prívozník 1 month, 3 weeks ago
On 9/6/24 14:53, Peter Krempa wrote:
> Recent fix to use the proper 'async' monitor function would cause
> libvirt to leak some of the objects it's supposed to clean up in other
> places besides qemu.
> 
> Don't skip the whole function on failure to enter the job but just the
> monitor section.
> 
> Fixes: 9b22c25548aa658acdeac2269ddae32584df32d8
> Signed-off-by: Peter Krempa <pkrempa@redhat.com>
> ---
>  src/qemu/qemu_backup.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>

Michal