From: Tao Cui <cuitao@kylinos.cn>
Today, when a KVM vCPU exits with KVM_EXIT_INTERNAL_ERROR,
KVM_EXIT_UNKNOWN, or a failed KVM_RUN ioctl, QEMU logs to stderr and
calls vm_stop(RUN_STATE_INTERNAL_ERROR). The management layer then only
sees the derived STOP event; it cannot tell which vCPU failed nor obtain
the kernel suberror / extra data. This gap is even called out by a
FIXME in kvm_handle_internal_error().
This series adds a KVM_VCPU_ERROR QMP event, emitted before the VM is
stopped, that carries the failing vCPU (cpu-index, qom-path), an error
category (KvmVcpuErrorReason) and, for KVM_EXIT_INTERNAL_ERROR, the
kernel suberror and extra data words.
Patch 1 defines the event and the KvmVcpuErrorReason enum in
qapi/run-state.json.
Patch 2 wires it up at the three unrecoverable-exit points in
accel/kvm/kvm-all.c and removes the FIXME.
Tao Cui (2):
qapi: add KVM_VCPU_ERROR event
accel/kvm: emit KVM_VCPU_ERROR on unrecoverable vCPU exits
accel/kvm/kvm-all.c | 46 +++++++++++++++++++++++++++++++++---
qapi/run-state.json | 57 +++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 100 insertions(+), 3 deletions(-)
--
2.43.0