From ecffc91d0232ce7a5ee98b8026f2e41926dffe83 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Fri, 6 Sep 2024 14:42:25 +0200 Subject: [PATCH] qemuBackupDiskDataCleanupOne: Don't skip rest of cleanup if we can't enter monitor 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 Reviewed-by: Michal Privoznik --- 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.39.5