VIRTWINKVM-2680: [QMP] flush pending events in wait_for to handle guest-side crashes - #1099
Open
harshapa-rh wants to merge 1 commit into
Open
VIRTWINKVM-2680: [QMP] flush pending events in wait_for to handle guest-side crashes#1099harshapa-rh wants to merge 1 commit into
harshapa-rh wants to merge 1 commit into
Conversation
…st-side crashes When a crash is triggered from inside the guest (e.g. via NotMyFault over WinRM) rather than via a QMP command (e.g. inject-nmi), the QMP socket has no recent I/O activity. This can cause QEMU to not flush pending events like GUEST_PANICKED to the socket, making wait_for_new_event block until timeout. Fix this by: 1. Sending a query-status command in wait_for before entering the blocking wait loop, which forces QMP negotiation and flushes any pending events into the cache. 2. Using IO.wait_readable with a 2 sec interval in wait_for_new_event so that if the event hasn't arrived yet, a periodic query-status poke forces QEMU to flush its event buffer. After each poke, the event cache is re-checked since send_cmd's internal read loop may have consumed and buffered the target event. Signed-off-by: Harshal Patil <harshapa@redhat.com>
harshapa-rh
force-pushed
the
fix-qmp-socket
branch
from
August 11, 2026 12:09
5a0a834 to
83260ef
Compare
Contributor
|
ok to test |
There was a problem hiding this comment.
Pull request overview
Adds periodic QMP activity to flush pending guest crash events.
Changes:
- Sends
query-statusbefore waiting. - Periodically retries and rechecks cached events.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| cached = find_cached_event(name, accepted) | ||
| return cached if cached | ||
|
|
||
| run_cmd('query-status') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a crash is triggered from inside the guest (e.g. via NotMyFault over WinRM) rather than via a QMP command (e.g. inject-nmi), the QMP socket has no recent I/O activity. This can cause QEMU to not flush pending events like GUEST_PANICKED to the socket, making wait_for_new_event block until timeout.
Fix this by:
After each poke, the event cache is re-checked since send_cmd's internal read loop may have consumed and buffered the target event.