Pass flags to downstream internal_start binary only if defined in env config.#2596
Open
ser-io wants to merge 1 commit into
Open
Pass flags to downstream internal_start binary only if defined in env config.#2596ser-io wants to merge 1 commit into
ser-io wants to merge 1 commit into
Conversation
9587c7d to
b6ea967
Compare
b6ea967 to
40c8f7c
Compare
… config. Bug: b/329890155
40c8f7c to
e77ff33
Compare
jemoreira
approved these changes
May 22, 2026
|
|
||
| static std::set<std::string> GatherFlagNamesUsedInConfig( | ||
| const EnvironmentSpecification& cfg) { | ||
| std::vector<std::pair<std::string, std::function<bool(const Instance&)>>> |
Member
There was a problem hiding this comment.
nit: vector<pair<string, predicate>> sounds like it could be map<string, predicate>.
| static std::set<std::string> GatherFlagNamesUsedInConfig( | ||
| const EnvironmentSpecification& cfg) { | ||
| std::vector<std::pair<std::string, std::function<bool(const Instance&)>>> | ||
| predicates{ |
Member
There was a problem hiding this comment.
nit: I think it would be clearer to implement this like this:
std::set<std::string> GatherFlagNamesUsedInEnvironmentConfig(const EnvironmentSpec& cfg) {
std::set<std::string> flag_names;
for (const auto& instance: cfg.instances()) {
flag_names.merge(GatherFlagNamesUsedInInstanceConfig);
}
}
std::set<std::string> GatherFlagNamesUsedInInstanceConfig(const Instance& instance) {
std::set<std::string> flag_names;
if (instance.has_vm()) { flag_names.insert(kFlagVmManager); }
if (instance.vm().has_cpus()) { flag_names.insert(kFlagCpus); }
...
return flag_names;
}
| "crosvm_simple_media_device"; | ||
| inline constexpr char kFlagCrosvmV4l2Proxy[] = "crosvm_v4l2_proxy"; | ||
|
|
||
| static std::set<std::string> GatherFlagNamesUsedInConfig( |
Member
There was a problem hiding this comment.
nit: static isn't needed inside the anonymous namespace
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.
Bug: b/329890155