edecca
From a6912230c999761dd5a5e23f1bdec8ae00255760 Mon Sep 17 00:00:00 2001
edecca
Message-Id: <a6912230c999761dd5a5e23f1bdec8ae00255760@dist-git>
edecca
From: Michal Privoznik <mprivozn@redhat.com>
edecca
Date: Wed, 4 Jul 2018 14:51:17 +0200
edecca
Subject: [PATCH] qemuDomainNestedJobAllowed: Allow QEMU_JOB_NONE
edecca
edecca
https://bugzilla.redhat.com/show_bug.cgi?id=1598084
edecca
edecca
When creating a snapshot with --quiesce an async job is grabbed
edecca
and just before executing guest fs-freeze command an agent job is
edecca
grabbed. This is achieved by calling
edecca
edecca
  qemuDomainObjBeginJobInternal(job = QEMU_JOB_NONE,
edecca
                                agentJob = QEMU_AGENT_JOB_MODIFY);
edecca
edecca
Since there already is an async job set on the domain (by the
edecca
same thread) qemuDomainNestedJobAllowed(priv, job) is consulted
edecca
if @job is allowed by job mask. But this function returns false
edecca
(meaning sync @job is not allowed) which leads to a deadlock.
edecca
edecca
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
edecca
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
edecca
(cherry picked from commit 2647a363676833371ba400374ecfa51c84fec5c0)
edecca
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
edecca
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
edecca
---
edecca
 src/qemu/qemu_domain.c | 4 +++-
edecca
 1 file changed, 3 insertions(+), 1 deletion(-)
edecca
edecca
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
edecca
index 3f3bb94685..fa952f8306 100644
edecca
--- a/src/qemu/qemu_domain.c
edecca
+++ b/src/qemu/qemu_domain.c
edecca
@@ -6386,7 +6386,9 @@ qemuDomainObjReleaseAsyncJob(virDomainObjPtr obj)
edecca
 static bool
edecca
 qemuDomainNestedJobAllowed(qemuDomainObjPrivatePtr priv, qemuDomainJob job)
edecca
 {
edecca
-    return !priv->job.asyncJob || (priv->job.mask & JOB_MASK(job)) != 0;
edecca
+    return !priv->job.asyncJob ||
edecca
+           job == QEMU_JOB_NONE ||
edecca
+           (priv->job.mask & JOB_MASK(job)) != 0;
edecca
 }
edecca
 
edecca
 bool
edecca
-- 
edecca
2.18.0
edecca