You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
openvmm: a console write error drops microVM output a snapshot should keep #1370
When a write to the host side of a microVM's portb console fails with an error other than BrokenPipe (for example ConnectionReset), MicrovmPortb drops all the guest output it has buffered. This also happens during a snapshot's console flush and the device's stop, so the snapshot saves an empty buffer and the restored VM never writes those bytes. The controller then logs "failed to flush microVM console output before snapshot; undelivered bytes stay in the snapshot" (openvmm/openvmm_entry/src/vm_controller/microvm.rs), and the device's stop comment says remaining bytes are saved and retried after restore. Only the host-side endpoint can cause this, and only console output is lost; guest state is not affected.
Reproduction
Have the guest write bytes to the portb data port, make the endpoint's write fail with ConnectionReset or Other, and send a snapshot flush (or stop the device). The saved state should hold the bytes. Instead its tx_buffer is empty, the restored portb never writes those bytes, and the controller logs that they stay in the snapshot. With no connected endpoint, a BrokenPipe error or a zero-length write, the bytes are kept.
Cause
MicrovmPortb::poll_tx keeps the buffered output on BrokenPipe and clears it on any other error:
No patch is attached; the retention policy needs a decision:
Keep the bytes on every error, and retry them later. A permanently failed endpoint then fills the 1 MiB buffer, after which new guest output is dropped, as for any full buffer; guest writes never block.
Keep the bytes only while a snapshot flush or stop is in progress, and drop them on errors at other times.
Keep today's behaviour, and correct the controller's warning and the stop comment to name the cases that keep the bytes: no endpoint, BrokenPipe, or a zero-length write.
Activity
chipset: keep undelivered microVM portb output
openvmm: pin keeping undelivered portb output
doc: say when the byte channel's output stays pending
chipset: keep undelivered microVM portb output