mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
SerialBuffer owns its downstream writer privately, with no way to replace it. Buffering the Socket console requires keeping one buffer alive across client connects and disconnects and pointing it at each newly accepted client (or a discarding sink when none is connected) without dropping bytes buffered while no client was attached. Add set_out(), which swaps the writer while leaving the buffered contents intact, plus unit tests covering accumulate-while-detached, replay on connect, live pass-through, delivery of while-detached output to the next client, and that bytes already drained by one client are not resent to the next. Signed-off-by: Max Makarov <maxpain@linux.com> Assisted-by: Claude:claude-opus-4-8 [Claude Code]