diff options
| author | Alexey Kardashevskiy <aik@linux.ibm.com> | 2020-05-26 12:29:39 +1000 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2020-10-26 10:19:14 +0100 |
| commit | a7aac492ebbc53e5c7bc4b5bbaf55f428c54093f (patch) | |
| tree | 6e3fc0007132959e50469ccd2a7199f8e69b0569 /pkg/instance/instance.go | |
| parent | a5924b471c98b54c2e097762ebe94089fa6a272e (diff) | |
vm/qemu: dump vCPU registers when crashed/hung using QMP
QEMU provides an interface to read/change the VM state. There are:
1. JSON based "QMP" protocol;
2. human monitor protocol - "HMP" - a user-friendly QEMU console.
The type of protocol is selected by the "mode" switch. QMP and HMP
implement quite different set of commands (although there is some
intersection) but QMP also implements a wrapper for HMP - HMP does not
implement a proxy for QMP.
This adds a TCP socket for QMP (another option would be a UNIX socket)
to QEMU and uses it for dumping vCPU(s) registers (via HMP's
"info registers") from instance::Diagnose() which is invoked when VM
is considered having issues.
This implements a QMP handshake and stores the connection handle
in the instance.
An example of a typical trafic is below:
R {"QMP": {"version": {"qemu": {"micro": 50, "minor": 1, "major": 5}, \
"package": ""}, "capabilities": ["oob"]}}
S {"execute": "qmp_capabilities"}
R {"return": {}}
S {"execute": "human-monitor-command", "arguments": \
{"command-line": "info status"}}
R {"return": "VM status: running\r\n"}
Signed-off-by: Alexey Kardashevskiy <aik@linux.ibm.com>
Diffstat (limited to 'pkg/instance/instance.go')
0 files changed, 0 insertions, 0 deletions
