report_rom: deny requests for existing reports

If a requested report already exists the request is denied with
Invalid_args.

Further, I dusted the report_rom test and added it to the
autopilot list.
This commit is contained in:
Christian Helmuth
2015-08-20 16:00:57 +02:00
parent 9a326bed2d
commit e2f2ac567e
4 changed files with 44 additions and 15 deletions

View File

@ -53,6 +53,15 @@ struct Report::Session_component : Genode::Rpc_object<Session>, Rom::Writer
return i;
}
Rom::Module &_create_module(Rom::Module::Name const &name)
{
try {
return _registry.lookup(*this, name);
} catch (...) {
throw Genode::Root::Invalid_args();
}
}
public:
Session_component(Rom::Module::Name const &name, size_t buffer_size,
@ -60,7 +69,7 @@ struct Report::Session_component : Genode::Rpc_object<Session>, Rom::Writer
:
_registry(registry),
_ds(Genode::env()->ram_session(), buffer_size),
_module(_registry.lookup(*this, name)),
_module(_create_module(name)),
_verbose(verbose)
{ }