From: Ján Tomko Date: Fri, 4 Jan 2019 09:17:46 +0000 (+0100) Subject: qemu: require reply from guest agent in qemuAgentGetInterfaces X-Git-Tag: v5.0.0-rc1~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7cfd1fbb1332ae5df678b9f41a62156cb2e88c73;p=thirdparty%2Flibvirt.git qemu: require reply from guest agent in qemuAgentGetInterfaces Since its introduction in commit 0977b8aa071 (released in v1.2.14) qemuAgentGetInterfaces calls qemuAgentCommand with needReply=false, which allows qemuAgentCommand to return 0 even when it did not get any reply from the agent. Set needReply to true, since we dereference it right after. This can be hit if libvirt is waiting for an event from the agent (e.g. shutdown) and the agent cannot reply in time (e.g. due to the guest being shut down), as reported in: https://bugzilla.redhat.com/show_bug.cgi?id=1663051 Signed-off-by: Ján Tomko Reviewed-by: Jiri Denemark --- diff --git a/src/qemu/qemu_agent.c b/src/qemu/qemu_agent.c index 0f4dae37e3..80b789b5e0 100644 --- a/src/qemu/qemu_agent.c +++ b/src/qemu/qemu_agent.c @@ -2043,7 +2043,7 @@ qemuAgentGetInterfaces(qemuAgentPtr mon, if (!(cmd = qemuAgentMakeCommand("guest-network-get-interfaces", NULL))) goto cleanup; - if (qemuAgentCommand(mon, cmd, &reply, false, + if (qemuAgentCommand(mon, cmd, &reply, true, VIR_DOMAIN_QEMU_AGENT_COMMAND_BLOCK) < 0) goto cleanup;