-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
server: introduce a serial console backend #830
base: master
Are you sure you want to change the base?
Conversation
7f2707e
to
8f98714
Compare
Instead of pushing all serial console websocket connections onto a single task, create one task per websocket connection and add a serial console backend that brokers traffic between the websocket tasks and the underlying character device. Each connection to the console backend has an independent handle that has its own permissions (read-write or read-only) and rules for what to do if a byte from the guest can't immediately be written to a client task (block or disconnect the client). These tools are sufficient to implement the serial console access policies described in RFD 491. This change doesn't build on its own; additional work is needed to hook the new backend up to the server APIs.
This plumbs the backend everywhere it needs to be, but import and export aren't quite set up yet.
8f98714
to
5b4e8c9
Compare
@hawkw: I think I've addressed all your feedback in the newest round of commits. The new changes use There's a new theory statement in |
Rework parts of
propolis-server
's serial console logic to achieve the following goals:To do this, split the existing serial console task into two layers. The
ConsoleBackend
layer deals with I/O to and from a Propolis character device. TheSerialConsoleManager
layer creates a task for each websocket connection to a serial device and registers it as a client of the relevantConsoleBackend
. The backend layer allows the manager to declare that specific clients have read-only access to the console and to decide what happens if a client becomes unable to accept new bytes from a client; the manager implements the policies that determine how many clients can exist concurrently and what backend policies apply to them.Update the serial API endpoint to allow users to request a writable connection to the console. Add parameters to the serial console helper types in
propolis-client
that govern how this is set. This will require a small update to Nexus the next time Omicron picks up a Propolis build to add the extra parameter. End users don't see this aspect of the serial API (Nexus serves as a proxy for connections to VMs' serial consoles), so this should be a non-breaking change for control plane API users.propolis-cli serial
defaults to a writable connection to match previous behavior, but it now supports a--readonly
flag to create read-only connections.As currently written, this PR implements the "only one read-write client at a time" policy described in RFD 491. I can easily disable this part of the change if we don't want to do this yet (should just need to remove a few lines from the console manager's client-attach function).
Tests: cargo test, PHD, ad hoc testing with local propolis-server processes. This change changes the order of messages sent in the migration protocol and so will break the migrate-from-base tests; this remains OK for now since live migration isn't being used in production yet.
Fixes #650. Related to #614.