base: add Child_policy::Route::Diag flag

The 'diag' flag can be defined by a target node of a route in init's
configuration. It is propagated as session argument to the server, which
may evaluate the flag to enable diagnostic output for the corresponding
session.

Issue #2398
This commit is contained in:
Norman Feske
2017-05-08 19:45:47 +02:00
committed by Christian Helmuth
parent 3670f7735d
commit aea5d03691
4 changed files with 24 additions and 11 deletions

View File

@ -138,8 +138,8 @@ Child_policy::Route Child::_resolve_session_request(Child_policy &policy,
try {
Session_state::Args args(argbuf);
return Child_policy::Route {
policy.resolve_session_request(name, args), label };
return { policy.resolve_session_request(name, args), label,
session_diag_from_args(argbuf) };
}
catch (Parent::Service_denied) { }
@ -187,6 +187,9 @@ Session_capability Child::session(Parent::Client::Id id,
Child_policy::Route route = _resolve_session_request(_policy, name.string(), argbuf);
Service &service = route.service;
/* propagate diag flag */
Arg_string::set_arg(argbuf, sizeof(argbuf), "diag", route.diag.enabled);
Session_state &session =
create_session(_policy.name(), service, route.label,
_session_factory, _id_space, id, argbuf, filtered_affinity);