Propagate session diag flag to core

This commit restores the diag feature for selecting diagnostic output of
services provided by core. This feature became unavailable with commit
"base: remove dependency from deprecated APIs", which hard-wired the
diag flag for core services to false.

To control this feature, three possible policies can be expressed in a
routing target of init's configuration:

* Forcing silence by specifying 'diag="no"'
* Enabling diagnostics by specifying 'diag="yes"'
* Forwarding the preference of the client by omitting the 'diag'
  attribute

Fixes #3962
This commit is contained in:
Norman Feske
2020-12-02 10:30:22 +01:00
parent 36eeab6df2
commit a0fb944721
19 changed files with 63 additions and 41 deletions

View File

@ -146,7 +146,8 @@ class Core_child : public Child_policy
Name name() const override { return "init"; }
Route resolve_session_request(Service::Name const &name,
Session_label const &label) override
Session_label const &label,
Session::Diag const diag) override
{
Service *service = nullptr;
_services.for_each([&] (Service &s) {
@ -158,7 +159,7 @@ class Core_child : public Child_policy
return Route { .service = *service,
.label = label,
.diag = Session::Diag() };
.diag = diag };
}
void init(Pd_session &session, Capability<Pd_session> cap) override