Commit edb799c
authored
vmkit: keep stdout a clean ack channel for Linux guests (#776)
Found while live-testing #775 (booting a real Linux guest): driving a
Linux guest interactively was unreliable because the guest serial
console shares stdout with the command/ack channel, so boot logs
interleaved with acks and the driver never got a real frame.
- **Rust**: route the guest serial console to **stderr**; stdout becomes
ack-only (the Python `Driver` already discards stderr, so boot noise is
dropped during normal driving, still visible running the binary
directly).
- **Python (defensive)**: `_read_ack` skips any non-ack line (the binary
always writes `ok`/`err`) so a stray stdout line can never be mistaken
for an ack, on any platform.
- **Test**: smoke test now feeds interleaved console noise + an `err`
ack through a fake pipe and asserts the real ack is recovered.
Validated: `nix build .#mcp` (compiles the Rust change) and `nix run
.#lint` pass; ack-skip logic covered by a deterministic fake-pipe test.
_Authored with Claude (Opus 4.8)._1 parent 46796fe commit edb799c
3 files changed
Lines changed: 60 additions & 30 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
847 | 847 | | |
848 | 848 | | |
849 | 849 | | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
850 | 864 | | |
851 | 865 | | |
852 | 866 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
799 | 799 | | |
800 | 800 | | |
801 | 801 | | |
802 | | - | |
| 802 | + | |
| 803 | + | |
803 | 804 | | |
804 | | - | |
805 | | - | |
806 | | - | |
807 | | - | |
808 | | - | |
| 805 | + | |
| 806 | + | |
809 | 807 | | |
810 | 808 | | |
811 | 809 | | |
812 | 810 | | |
813 | 811 | | |
814 | 812 | | |
815 | 813 | | |
816 | | - | |
817 | | - | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
818 | 836 | | |
819 | 837 | | |
820 | 838 | | |
821 | 839 | | |
822 | | - | |
823 | | - | |
824 | | - | |
825 | | - | |
826 | | - | |
827 | | - | |
| 840 | + | |
828 | 841 | | |
829 | 842 | | |
830 | | - | |
831 | | - | |
832 | | - | |
| 843 | + | |
| 844 | + | |
833 | 845 | | |
834 | | - | |
835 | | - | |
| 846 | + | |
836 | 847 | | |
837 | | - | |
838 | | - | |
839 | | - | |
840 | | - | |
841 | | - | |
842 | | - | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
843 | 853 | | |
844 | 854 | | |
845 | 855 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
125 | | - | |
| 125 | + | |
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
| |||
191 | 191 | | |
192 | 192 | | |
193 | 193 | | |
194 | | - | |
195 | | - | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
196 | 202 | | |
197 | 203 | | |
198 | | - | |
| 204 | + | |
199 | 205 | | |
200 | 206 | | |
201 | 207 | | |
202 | 208 | | |
203 | | - | |
| 209 | + | |
204 | 210 | | |
205 | 211 | | |
206 | 212 | | |
| |||
0 commit comments