Skip to content

virtio-serial driver bugfixes#817

Open
Martinits wants to merge 2 commits intointel:mainfrom
Martinits:main
Open

virtio-serial driver bugfixes#817
Martinits wants to merge 2 commits intointel:mainfrom
Martinits:main

Conversation

@Martinits
Copy link
Copy Markdown

Fix 2 migtd virtio-serial driver bugs:

  • Missing control msgs since qemu may put multiple control msg but the driver pops one each time.
  • A late PORT_OPEN event may cause a PortNotAvailable when port.open(), try to drain control queue when PortNotAvailable and retry open.

Wenbo Li added 2 commits April 28, 2026 14:58
recv_control() previously popped only one used entry from the control RX
queue per call. When QEMU delivers multiple control events (e.g. DeviceAdd,
PortOpen), the remaining events could be left pending and never handled,
leading to missing RX prefill / vq empty failures.

Change recv_control() to drain all pending control messages after the
initial wait, ensuring the full control sequence is processed.

Signed-off-by: Wenbo Li <liwenbo.liwenbo@bytedance.com>
VirtioSerialPort::open() may return PortNotAvailable because the PORT_OPEN
control event arrives after the initial control setup. On each
PortNotAvailable, non-blockingly drain pending control messages for at
most 100 times.

Signed-off-by: Wenbo Li <liwenbo.liwenbo@bytedance.com>
@Martinits Martinits requested review from jyao1 and sgrams as code owners April 28, 2026 07:24
@jyao1
Copy link
Copy Markdown
Contributor

jyao1 commented May 5, 2026

could you please fix CI failure?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants