mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-19 11:16:57 +00:00
parent
27c2a66bbd
commit
cd37bff514
@ -170,6 +170,24 @@ Configuration::Configuration(Env &env,
|
||||
}
|
||||
|
||||
|
||||
void Configuration::stop_reporting()
|
||||
{
|
||||
if (!_reporter.valid()) {
|
||||
return;
|
||||
}
|
||||
_reporter().enabled(false);
|
||||
}
|
||||
|
||||
|
||||
void Configuration::start_reporting()
|
||||
{
|
||||
if (!_reporter.valid()) {
|
||||
return;
|
||||
}
|
||||
_reporter().enabled(true);
|
||||
}
|
||||
|
||||
|
||||
Configuration::~Configuration()
|
||||
{
|
||||
/* destroy uplinks */
|
||||
|
@ -84,6 +84,10 @@ class Net::Configuration
|
||||
|
||||
~Configuration();
|
||||
|
||||
void stop_reporting();
|
||||
|
||||
void start_reporting();
|
||||
|
||||
|
||||
/***************
|
||||
** Accessors **
|
||||
|
@ -74,6 +74,8 @@ Net::Main::Main(Env &env) : _env(env)
|
||||
|
||||
void Net::Main::_handle_config()
|
||||
{
|
||||
_config().stop_reporting();
|
||||
|
||||
_config_rom.update();
|
||||
Configuration &old_config = _config();
|
||||
Configuration &new_config = *new (_heap)
|
||||
@ -87,6 +89,8 @@ void Net::Main::_handle_config()
|
||||
_for_each_interface([&] (Interface &intf) { intf.handle_config_3(); });
|
||||
|
||||
destroy(_heap, &old_config);
|
||||
|
||||
_config().start_reporting();
|
||||
}
|
||||
|
||||
|
||||
|
@ -42,13 +42,14 @@ Net::Report::Report(bool const &verbose,
|
||||
_domains { domains },
|
||||
_timeout { timer, *this, &Report::_handle_report_timeout,
|
||||
read_sec_attr(node, "interval_sec", 5) }
|
||||
{
|
||||
_reporter.enabled(true);
|
||||
}
|
||||
{ }
|
||||
|
||||
|
||||
void Net::Report::_report()
|
||||
{
|
||||
if (!_reporter.enabled()) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
Reporter::Xml_generator xml(_reporter, [&] () {
|
||||
if (_quota) {
|
||||
|
Loading…
Reference in New Issue
Block a user