Commit 7231ca26 authored by Dimitris Aragiorgis's avatar Dimitris Aragiorgis Committed by Thomas Thrainer

Workaround for monitor bug related to greeting msg

QMP may return multiple greeting messages upon connection.
This is reported on qemu-devel. The fix is one-liner but
until it get's released this is a quick and dirty workaround
that flushes the client's buffer after getting the first
greeting message.
Signed-off-by: default avatarDimitris Aragiorgis <dimara@grnet.gr>
Signed-off-by: default avatarThomas Thrainer <thomasth@google.com>
Reviewed-by: default avatarThomas Thrainer <thomasth@google.com>
parent 066f16b0
......@@ -491,6 +491,10 @@ class QmpConnection(MonitorSocket):
raise errors.HypervisorError("kvm: QMP communication error (wrong"
" server greeting")
# This is needed because QMP can return more than one greetings
# see https://groups.google.com/d/msg/ganeti-devel/gZYcvHKDooU/SnukC8dgS5AJ
self._buf = ""
# Let's put the monitor in command mode using the qmp_capabilities
# command, or else no command will be executable.
# (As per the QEMU Protocol Specification 0.1 - section 4)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment