commit | 61c5dcbfcb856a7f3efbd6eff81460d7eec0d9ea | [log] [tgz] |
---|---|---|
author | Andrew Davies <awdavies@google.com> | Mon Oct 26 20:09:46 2020 +0000 |
committer | CQ Bot <commit-bot@chromium.org> | Mon Oct 26 20:09:46 2020 +0000 |
tree | ac22efc128d5ff3781791090ba20b2303d4b7e47 | |
parent | ce0e2d63d0e162730495683a4a4a5c8bd63b16f8 [diff] |
[ffx] Add default config rules for client commands. This change does a few things: -- Makes `-t` set `target.default` in the runtime config. -- Makes a macro that allows for config fallback of any arbitraty struct field that is an `Option<String>` and `Option<f64>` (more types will be added as needed). -- Changes get-ssh-address command to use `target.default` rather than accepting a parameter. -- Uses backup of timeout to a config value. -- Removes use of `inner_lock` on TargetCollection to make deadlocks less likely to occur from misuse (as there is now no way to access the inner locking mechanisms). -- Removes timeouts inside the daemon, allowing for target queries to run an arbitrary amount of time if necessary (as long as the client stays up). Example usage of macro: ```rust #[derive(FfxConfigBacked, Default)] struct Foo { #[ffx_config_default(key = "timeout", default = "1.0")] field_one: Option<f64>, #[ffx_config_default("nodename")] field_two: Option<String> } ``` These will generate according functions for looking up the respective values from the FFX config. This is used in the two plugins, one for getting the default target, the other for setting a timeout for getting the ssh address of a target. Bug: 59622 Change-Id: I5a98842512990a33761e1abc6c9838d64ea46550 Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/436334 Reviewed-by: Matthew Boetger <boetger@google.com> Commit-Queue: Andrew Davies <awdavies@google.com> API-Review: James Tucker <raggi@google.com> Testability-Review: James Tucker <raggi@google.com>
Pink + Purple == Fuchsia (a new operating system)
Fuchsia is a modular, capability-based operating system. Fuchsia runs on modern 64-bit Intel and ARM processors.
Fuchsia is an open source project with a code of conduct that we expect everyone who interacts with the project to respect.
Read more about Fuchsia's principles.
See Getting Started.
See fuchsia.dev.