Skip to content

Commit

Permalink
discover/device-handler: Disable safe mode warning on reinit
Browse files Browse the repository at this point in the history
If a user pressed "Rescan Devices" in safe mode the reinit would
complete successfully, but the big warning that safe mode is active
would remain. On reinit clear the safe_mode flag properly.

This has no functional change aside from clearing the UI warning - the
IPMI override remains active until cleared or a successful boot occurs.

Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
  • Loading branch information
sammj committed Aug 23, 2017
1 parent 48ca02f commit b9b5fa3
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions discover/device-handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <process/process.h>
#include <url/url.h>
#include <i18n/i18n.h>
#include <pb-config/pb-config.h>

#include <sys/sysmacros.h>
#include <sys/types.h>
Expand Down Expand Up @@ -393,6 +394,7 @@ void device_handler_reinit(struct device_handler *handler)
{
struct discover_boot_option *opt, *tmp;
struct ramdisk_device *ramdisk;
struct config *config;
unsigned int i;

device_handler_cancel_default(handler);
Expand Down Expand Up @@ -440,6 +442,14 @@ void device_handler_reinit(struct device_handler *handler)

set_env_variables(config_get());

/* If the safe mode warning was active disable it now */
if (config_get()->safe_mode) {
config = config_copy(handler, config_get());
config->safe_mode = false;
config_set(config);
discover_server_notify_config(handler->server, config);
}

device_handler_reinit_sources(handler);
}

Expand Down

0 comments on commit b9b5fa3

Please sign in to comment.