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

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