From: Tao Cui <cui.tao@linux.dev>
To: qemu-devel@nongnu.org
Cc: pbonzini@redhat.com, armbru@redhat.com, eblake@redhat.com,
kvm@vger.kernel.org, Tao Cui <cuitao@kylinos.cn>
Subject: [PATCH v1 0/2] accel/kvm: notify management of vCPU run errors
Date: Wed, 8 Jul 2026 14:12:18 +0800 [thread overview]
Message-ID: <20260708061220.53507-1-cui.tao@linux.dev> (raw)
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
next reply other threads:[~2026-07-08 6:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-08 6:12 Tao Cui [this message]
2026-07-08 6:12 ` [PATCH v1 1/2] qapi: add KVM_VCPU_ERROR event Tao Cui
2026-07-08 6:12 ` [PATCH v1 2/2] accel/kvm: emit KVM_VCPU_ERROR on unrecoverable vCPU exits Tao Cui
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260708061220.53507-1-cui.tao@linux.dev \
--to=cui.tao@linux.dev \
--cc=armbru@redhat.com \
--cc=cuitao@kylinos.cn \
--cc=eblake@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox