From e060b0624d1b78438b759cc5a25da87b28c9736c Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Thu, 26 Mar 2020 15:37:44 +0100 Subject: [PATCH] qemuBackupBegin: Fix monitor access when rolling back due to failure The code attempting to clean up after a failed pull mode backup job wrongly entered monitor but didn't clean up nor exit monitor due to a logic bug. Fix the condition. Introduced in a1521f84a53 https://bugzilla.redhat.com/show_bug.cgi?id=1817327 Signed-off-by: Peter Krempa Reviewed-by: Eric Blake --- src/qemu/qemu_backup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_backup.c b/src/qemu/qemu_backup.c index 8b66ee8d1f..9a056fa407 100644 --- a/src/qemu/qemu_backup.c +++ b/src/qemu/qemu_backup.c @@ -894,7 +894,7 @@ qemuBackupBegin(virDomainObjPtr vm, qemuCheckpointRollbackMetadata(vm, chk); if (!job_started && nbd_running && - qemuDomainObjEnterMonitorAsync(priv->driver, vm, QEMU_ASYNC_JOB_BACKUP) < 0) { + qemuDomainObjEnterMonitorAsync(priv->driver, vm, QEMU_ASYNC_JOB_BACKUP) == 0) { ignore_value(qemuMonitorNBDServerStop(priv->mon)); ignore_value(qemuDomainObjExitMonitor(priv->driver, vm)); }