You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
pillar/qmp: return a proper error if response on "query-status" can't be parsed
The 'query-status' QMP request is a special one: if status can't
be parsed - QEMU is stopped by EVE ('quit' is sent over QMP).
There are many customer complains on sudden QEMU stops with only
a few lines in the log, e.g.:
"domain c54579e8-f67e-43fa-ae44-8e03584606c2.1.2 reported to be in unexpected state "
"one of the c54579e8-f67e-43fa-ae44-8e03584606c2 tasks has crashed (domain c54579e8-f67e-43fa-ae44-8e03584606c2.1.2 reported to be in unexpected state )"
"qmpEventHandler: Received event: SHUTDOWN event details: map[guest:false reason:host-qmp-quit]. Calling quit on socket: /run/hypervisor/kvm/c54579e8-f67e-43fa-ae44-8e03584606c2.1.2/qmp"
Which indicates that `getQemuStatus()` routine returns a "" (empty) string.
(according to the code the actual returned state is printed:
"domain %s reported to be in unexpected state %s", domainName, res)
The `getQemuStatus()` can return a "" (empty string) and no error only
in one case: when received JSON does not match the expected structure.
This commit disallows unknown JSON fields, so that a returned string
should match exactly the structure.
This does not fix the error or sudden stop, but rather makes an error
explicit, so instead of:
"domain c54579e8-f67e-43fa-ae44-8e03584606c2.1.2 reported to be in unexpected state "
the following error may appear:
"couldn't retrieve status for domain c54579e8-f67e-43fa-ae44-8e03584606c2.1.2: json: unknown field "error"; (the bytes received: '{"error": {"class": "CommandNotFound", "desc": "Expecting capabilities negotiation with 'qmp_capabilities'"}}"
which explicitly indicates the expecting capabilities negotiations.
(the error is made up and does not reflect the real problem!)
Again. This does not fix a problem, rather exposes it with a clear
error message, so QEMU will be stopped by the domainmgr, but I hope
clear error help to fix a real problem.
Signed-off-by: Roman Penyaev <[email protected]>
0 commit comments