[PATCH v1 0/2] accel/kvm: notify management of vCPU run errors

Tao Cui posted 2 patches 2 weeks, 4 days ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260708061220.53507-1-cui.tao@linux.dev
Maintainers: Paolo Bonzini <pbonzini@redhat.com>, Eric Blake <eblake@redhat.com>, Markus Armbruster <armbru@redhat.com>
accel/kvm/kvm-all.c | 46 +++++++++++++++++++++++++++++++++---
qapi/run-state.json | 57 +++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 100 insertions(+), 3 deletions(-)
[PATCH v1 0/2] accel/kvm: notify management of vCPU run errors
Posted by Tao Cui 2 weeks, 4 days ago
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