From: Geoff Levand Date: Tue, 23 Jul 2013 20:30:19 +0000 (-0700) Subject: discover: Hookup --no-autoboot to config X-Git-Tag: v1.0.0~538 X-Git-Url: https://git.ozlabs.org/?p=petitboot;a=commitdiff_plain;h=37d865eb008f746a0b013557312c6b44c7236eb7 discover: Hookup --no-autoboot to config Add new routine config_set_autoboot(), and use it to set the --no-autoboot option. Signed-off-by: Geoff Levand --- diff --git a/discover/pb-discover.c b/discover/pb-discover.c index 007e66f..8ab2849 100644 --- a/discover/pb-discover.c +++ b/discover/pb-discover.c @@ -157,6 +157,9 @@ int main(int argc, char *argv[]) config_init(NULL); + if (opts.no_autoboot == opt_yes) + config_set_autoboot(false); + waitset = waitset_create(NULL); server = discover_server_init(waitset); diff --git a/lib/pb-config/pb-config.c b/lib/pb-config/pb-config.c index 9f7d240..6398a69 100644 --- a/lib/pb-config/pb-config.c +++ b/lib/pb-config/pb-config.c @@ -23,8 +23,8 @@ static void dump_config(struct config *config) pb_log("configuration:\n"); - pb_log(" autoboot enabled: %s\n", - config->autoboot_enabled ? "yes" : "no"); + pb_log(" autoboot: %s\n", + config->autoboot_enabled ? "enabled" : "disabled"); if (config->n_network_configs > 0) pb_log(" network configuration:\n"); @@ -74,6 +74,14 @@ const struct config *config_get(void) return config; } +void config_set_autoboot(bool autoboot_enabled) +{ + config->autoboot_enabled = autoboot_enabled; + + pb_log("set autoboot: %s\n", + config->autoboot_enabled ? "enabled" : "disabled"); +} + int config_fini(void) { talloc_free(config); diff --git a/lib/pb-config/pb-config.h b/lib/pb-config/pb-config.h index cfcf025..c377087 100644 --- a/lib/pb-config/pb-config.h +++ b/lib/pb-config/pb-config.h @@ -33,6 +33,7 @@ struct config { int config_init(void *ctx); const struct config *config_get(void); +void config_set_autoboot(bool autoboot_enabled); int config_fini(void); #endif /* CONFIGURATION_H */