serial: Fix reset when disconnected - #4178
Merged
Steven Malis (smalis-msft) merged 1 commit intoAug 7, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Refactors serial device initialization/reset so modem/carrier state reflects whether a backend is actually connected after reset, preventing false carrier reporting on disconnected ports, and adds regression tests.
Changes:
- Initialize
Statewith backend connectivity (io.is_connected()) instead of always “connecting” after reset. - Remove unconditional
connect()calls in constructors and reset paths for PL011 and 16550. - Add async tests ensuring reset does not assert carrier/modem lines when the backend is disconnected.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| vm/devices/serial/serial_pl011/src/lib.rs | Makes state init/reset conditional on backend connectivity; adds PL011 regression test for disconnected reset. |
| vm/devices/serial/serial_16550/src/lib.rs | Makes state init/reset conditional on backend connectivity; adds 16550 regression test for disconnected reset. |
Chris Oo (chris-oo)
approved these changes
Aug 7, 2026
Steven Malis (smalis-msft)
merged commit Aug 7, 2026
7c5eb13
into
microsoft:main
97 of 101 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Refactors how serial device state is initialized and reset to ensure that the device's modem connection state actually matches the backend connection status after a reset. This prevents devices from incorrectly reporting a carrier when no backend is attached. Also add new tests to verify this behavior.