qemu_wait_serial
Waits until specified text appears on a QEMU guest's serial console, or times out, so you can confirm a boot stage before sending keystrokes or taking screenshots.
Instructions
Block until text appears on the serial console, or time out.
The reliable way to know a guest reached a boot stage ("login:", "kernel ready", a shell prompt) before typing or screenshotting. Each wait searches only output after the previous successful wait's match, so waiting for "$ " after typing a command finds the NEW prompt, not the one already on screen. The first wait searches from the start of the log (so a marker printed before the call is still found); from_start=True searches the whole log again. Returns the serial tail either way, prefixed FOUND or TIMEOUT. Always checks at least once, even if timeout_s is 0 or negative. poll_interval_s (default 0.25s) must be positive. Each poll reads only the serial log bytes written since the previous poll, not the whole file, so a long wait against a chatty guest doesn't cost ever-more I/O per poll. text must be non-empty.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| text | Yes | ||
| timeout_s | No | ||
| from_start | No | ||
| poll_interval_s | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |