render / rpms / libvirt

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