Refactor configuration file reload handling

Rather than parse the configuration file into a new structure and
copy changed values from that into the main structure, we'll copy
the existing structure before parsing the changed configuration
file directly into the nmain structure, and revert using the copy
if any issues are encountered.

This is necessary as preparation for further reworking of the
configuration file structure handling. It also makes the reload
idempotent.

While we're at it, make some general improvements to the reload
handling, particularly:

 - improve logging to show "before" and "after" values
 - collate change notifications and only display if no errors
   were found
 - remove unnecessary double-logging of errors
 - various bugfixes
This commit is contained in:
Ian Barwick
2020-05-05 13:49:11 +09:00
parent d37513312a
commit bcc284cac9
5 changed files with 423 additions and 279 deletions

View File

@@ -564,3 +564,10 @@ parse_follow_command(char *parsed_command, char *template, int node_id)
return;
}
const char *
format_bool(bool value)
{
return value == true ? "true" : "false";
}