From 9b22c25548aa658acdeac2269ddae32584df32d8 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Thu, 5 Sep 2024 14:55:59 +0200 Subject: [PATCH] qemu: backup: Use 'async' monitor in 'qemuBackupDiskDataCleanupOne' 'qemuBackupDiskDataCleanupOne()' is entering the monitor while we're in the async backup job inside 'qemuBackupBegin()' which is semantically wrong and per upstream report causes crashes if some monitoring commands are run in parallel. Use qemuDomainObjEnterMonitorAsync() instead. Closes: https://gitlab.com/libvirt/libvirt/-/issues/668 Signed-off-by: Peter Krempa Reviewed-by: Jiri Denemark --- src/qemu/qemu_backup.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_backup.c b/src/qemu/qemu_backup.c index 81391c29f7..5eb2cbe306 100644 --- a/src/qemu/qemu_backup.c +++ b/src/qemu/qemu_backup.c @@ -125,7 +125,8 @@ qemuBackupDiskDataCleanupOne(virDomainObj *vm, if (!dd->started) { if (dd->added) { - qemuDomainObjEnterMonitor(vm); + if (qemuDomainObjEnterMonitorAsync(vm, VIR_ASYNC_JOB_BACKUP) < 0) + return; qemuBlockStorageSourceAttachRollback(priv->mon, dd->crdata->srcdata[0]); qemuDomainObjExitMonitor(vm); }