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: 9b22c25548
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Peter Krempa 2024-09-06 14:42:25 +02:00
parent 8666523b7d
commit ecffc91d02

View File

@ -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) {