From 652f92c9c9d09847fec60547b729e8397369f7c4 Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Tue, 14 Feb 2017 16:24:27 +0100 Subject: [PATCH] init: 'unscoped_label' session-routing attribute This patch enhances init with the ability to route individual environment sessions. Prior this patch, environment sessions could be routed only by an all-encompassing '' node that would match both child-initiated and environment sessions. In contrast to the existing 'label', 'label_prefix', and 'label_suffix' attributes of '' nodes, which are always scoped with ther name of the corresponding child, the 'unscoped_label' allows the definition of routing rules for all session requests, including init's requests for the child's environment sessions. For example, to route the ROM session requests for a child's dynamic linker, the following route would match: ... Issue #2215 --- repos/os/include/init/child.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/repos/os/include/init/child.h b/repos/os/include/init/child.h index e7250fda6..8d0977088 100644 --- a/repos/os/include/init/child.h +++ b/repos/os/include/init/child.h @@ -173,6 +173,21 @@ namespace Init { service_node.has_attribute("label_prefix") || service_node.has_attribute("label_suffix"); + char const *unscoped_attr = "unscoped_label"; + if (service_node.has_attribute(unscoped_attr)) { + + /* + * If an 'unscoped_label' attribute is provided, don't consider any + * scoped label attribute. + */ + if (route_depends_on_child_provided_label) + warning("service node contains both scoped and unscoped label attributes"); + + typedef String Label; + Label const label = service_node.attribute_value(unscoped_attr, Label()); + return label == label_from_args(args); + } + if (!route_depends_on_child_provided_label) return true;