Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a kernel command-line parser in src/cmdline.zig to extract network configuration for the scoutd service. It includes logic for reading /proc/cmdline, parsing IPv4 addresses with CIDR prefixes, and handling potential errors during the bootstrap process. Feedback suggests using std.mem.tokenizeAny for more robust tokenization of command-line arguments and std.mem.indexOfScalar for more efficient character searching.
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.
This PR adds the first kernel command line bootstrap contract for scoutd. It defines a small scoutd owned schema for early guest boot and parses only the values needed before networking and MMDS are available.
The new parser reads the kernel command line, extracts the required bootstrap fields, validates them, and rejects malformed, duplicate, or missing values. On invalid bootstrap input, scoutd now fails fast during early boot instead of continuing with a bad guest configuration.
This keeps the kernel command line intentionally small and focused while setting up the next phase of work, which is guest networking bring up. Build and tests pass with Zig 0.15.2.