Blame SOURCES/libvirt-qemu-require-reply-from-guest-agent-in-qemuAgentGetInterfaces.patch

9c6c51
From e9a07e34c638a540e6ecc7fd05834c7682f22631 Mon Sep 17 00:00:00 2001
9c6c51
Message-Id: <e9a07e34c638a540e6ecc7fd05834c7682f22631@dist-git>
9c6c51
From: =?UTF-8?q?J=C3=A1n=20Tomko?= <jtomko@redhat.com>
9c6c51
Date: Thu, 10 Jan 2019 12:49:11 +0100
9c6c51
Subject: [PATCH] qemu: require reply from guest agent in
9c6c51
 qemuAgentGetInterfaces
9c6c51
MIME-Version: 1.0
9c6c51
Content-Type: text/plain; charset=UTF-8
9c6c51
Content-Transfer-Encoding: 8bit
9c6c51
9c6c51
Since its introduction in commit 0977b8aa071 (released in v1.2.14)
9c6c51
qemuAgentGetInterfaces calls qemuAgentCommand with needReply=false,
9c6c51
which allows qemuAgentCommand to return 0 even when it did not get
9c6c51
any reply from the agent.
9c6c51
9c6c51
Set needReply to true, since we dereference it right after.
9c6c51
9c6c51
This can be hit if libvirt is waiting for an event from the agent
9c6c51
(e.g. shutdown) and the agent cannot reply in time (e.g. due to
9c6c51
the guest being shut down), as reported in:
9c6c51
https://bugzilla.redhat.com/show_bug.cgi?id=1663051
9c6c51
9c6c51
Signed-off-by: Ján Tomko <jtomko@redhat.com>
9c6c51
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
9c6c51
(cherry picked from commit 7cfd1fbb1332ae5df678b9f41a62156cb2e88c73)
9c6c51
Signed-off-by: Ján Tomko <jtomko@redhat.com>
9c6c51
9c6c51
8.0: https://bugzilla.redhat.com/show_bug.cgi?id=1665000
9c6c51
9c6c51
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
9c6c51
---
9c6c51
 src/qemu/qemu_agent.c | 2 +-
9c6c51
 1 file changed, 1 insertion(+), 1 deletion(-)
9c6c51
9c6c51
diff --git a/src/qemu/qemu_agent.c b/src/qemu/qemu_agent.c
9c6c51
index 986e37b07d..d6fd02a4b6 100644
9c6c51
--- a/src/qemu/qemu_agent.c
9c6c51
+++ b/src/qemu/qemu_agent.c
9c6c51
@@ -1987,7 +1987,7 @@ qemuAgentGetInterfaces(qemuAgentPtr mon,
9c6c51
     if (!(cmd = qemuAgentMakeCommand("guest-network-get-interfaces", NULL)))
9c6c51
         goto cleanup;
9c6c51
 
9c6c51
-    if (qemuAgentCommand(mon, cmd, &reply, false,
9c6c51
+    if (qemuAgentCommand(mon, cmd, &reply, true,
9c6c51
                          VIR_DOMAIN_QEMU_AGENT_COMMAND_BLOCK) < 0)
9c6c51
         goto cleanup;
9c6c51
 
9c6c51
-- 
9c6c51
2.20.1
9c6c51