Fix logs cut off after screenshot test #336
Merged
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.
OVMF sets up the stdout handle such that writes go to all serial devices
(as well as the visual console when not running headless). This is
convenient since the logger writes to stdout, so connecting a serial
device to QEMU's stdout writes logs from the test runner to the host.
However, once a serial device is opened in exclusive mode it is
disconnected from stdout. Since the test runner needs to open a serial
device in exclusive mode, a single serial device isn't sufficient --
once the device is opened in exclusive mode it will stop receiving logs.
So, open two serial devices for the QEMU test. The first one is
connected to the host's stdout, and serves just to transport logs. The
second one is connected to a pipe, and used to receive the SCREENSHOT
command and send the response. That second will also receive logs up
until the test runner opens the handle in exclusive mode, but we can
just read and ignore those lines.
Fixes #327