render / rpms / libvirt

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