From 02d5efcf3f86014eae92f9b79ae247f320d6e5f4 Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Wed, 18 Jan 2017 17:10:07 +0100 Subject: [PATCH] init: apply routing to environment sessions The init component used to create the CPU/RAM/PD/ROM sessions (the child environment) for its children by issuing session requests to its parent, which is typically core. This policy was hard-wired. This patch enables the routing of the environment sessions of the children of init according to the configured routing policy. Because there is no hard-wired policy regarding the environment sessions anymore, routes to respective services must be explicitly declared in the init configuration. For this reason, the patch adjusts several run scripts in this respect. This patch removes the outdated '' special handling of session labels. The '' feature will eventually be removed completely (ref #2250) Issue #2197 Issue #2215 Issue #2233 Issue #2250 --- repos/base-linux/run/lx_hybrid_ctors.run | 3 + repos/base-linux/run/lx_hybrid_exception.run | 3 + .../base-linux/run/lx_hybrid_pthread_ipc.run | 3 + repos/base/run/affinity.run | 2 +- repos/base/run/log.run | 5 +- repos/base/run/mp_server.run | 5 +- repos/base/run/new_delete.run | 5 +- repos/base/run/platform_drv.inc | 13 ++- repos/base/run/thread.run | 3 + repos/gems/run/cpu_load_display.run | 12 +- repos/gems/run/cpu_sampler.run | 10 +- repos/gems/run/cpu_sampler_noux.run | 15 +-- repos/gems/run/decorator.run | 9 +- repos/gems/run/decorator_stress.run | 12 +- repos/gems/run/launcher.run | 26 +++-- repos/gems/run/menu_view.run | 16 +-- repos/gems/run/mixer_gui_qt_test.run | 2 +- repos/gems/run/nano3d.run | 8 +- repos/gems/run/nit_fader.run | 5 +- repos/gems/run/wm.run | 16 ++- repos/libports/run/ldso.run | 4 +- repos/libports/run/moon.run | 3 +- repos/libports/run/rust.run | 6 +- repos/libports/run/stdcxx.run | 4 +- repos/os/include/init/child.h | 108 +++++------------- repos/os/run/clipboard.run | 20 ++-- repos/os/run/demo.run | 6 +- repos/os/run/ram_fs_chunk.run | 5 +- repos/os/run/rom_filter.run | 7 +- repos/os/run/tar_rom.run | 6 +- repos/os/run/xml_node.run | 5 +- .../os/src/app/cli_monitor/gdb_command_config | 9 +- repos/os/src/server/input_merger/README | 10 +- repos/os/src/test/fault_detection/main.cc | 4 +- repos/ports/run/arora.run | 4 +- repos/ports/run/netperf.inc | 2 +- repos/ports/run/noux_gdb.run | 8 +- repos/ports/run/noux_terminal_fs.run | 10 +- repos/ports/run/noux_trace_fs.run | 19 ++- repos/ports/run/seoul.inc | 1 - repos/ports/run/vbox_auto_genode_usb_hid.run | 4 +- repos/ports/run/vbox_auto_win7_share.run | 15 +-- repos/ports/run/vbox_pointer.run | 102 +++++++++++------ repos/ports/run/vbox_win.inc | 31 ++--- repos/ports/run/virtualbox_auto.inc | 2 + 45 files changed, 300 insertions(+), 268 deletions(-) diff --git a/repos/base-linux/run/lx_hybrid_ctors.run b/repos/base-linux/run/lx_hybrid_ctors.run index dc1bfebff..2cac8f478 100644 --- a/repos/base-linux/run/lx_hybrid_ctors.run +++ b/repos/base-linux/run/lx_hybrid_ctors.run @@ -24,6 +24,9 @@ install_config { + + + diff --git a/repos/base-linux/run/lx_hybrid_exception.run b/repos/base-linux/run/lx_hybrid_exception.run index 9b17333d2..b6fda192d 100644 --- a/repos/base-linux/run/lx_hybrid_exception.run +++ b/repos/base-linux/run/lx_hybrid_exception.run @@ -23,6 +23,9 @@ install_config { + + + diff --git a/repos/base-linux/run/lx_hybrid_pthread_ipc.run b/repos/base-linux/run/lx_hybrid_pthread_ipc.run index 09cbc1e06..ba3d9d82e 100644 --- a/repos/base-linux/run/lx_hybrid_pthread_ipc.run +++ b/repos/base-linux/run/lx_hybrid_pthread_ipc.run @@ -20,6 +20,9 @@ install_config { + + + diff --git a/repos/base/run/affinity.run b/repos/base/run/affinity.run index 71658f9b2..dffa59179 100644 --- a/repos/base/run/affinity.run +++ b/repos/base/run/affinity.run @@ -31,7 +31,7 @@ set config { - + diff --git a/repos/base/run/log.run b/repos/base/run/log.run index 91da7fb4f..2f5ed2fc3 100644 --- a/repos/base/run/log.run +++ b/repos/base/run/log.run @@ -6,7 +6,10 @@ install_config { - + + + + diff --git a/repos/base/run/mp_server.run b/repos/base/run/mp_server.run index 6b021bfbf..6c932bf50 100644 --- a/repos/base/run/mp_server.run +++ b/repos/base/run/mp_server.run @@ -14,8 +14,9 @@ install_config { - - + + + diff --git a/repos/base/run/new_delete.run b/repos/base/run/new_delete.run index 3d7f6c8c7..f82790c32 100644 --- a/repos/base/run/new_delete.run +++ b/repos/base/run/new_delete.run @@ -6,7 +6,10 @@ install_config { - + + + + diff --git a/repos/base/run/platform_drv.inc b/repos/base/run/platform_drv.inc index 43c5213d6..7ec1f54b7 100644 --- a/repos/base/run/platform_drv.inc +++ b/repos/base/run/platform_drv.inc @@ -81,9 +81,13 @@ proc append_platform_drv_config {} { append config { - - + + + + + + } @@ -103,7 +107,10 @@ proc append_platform_drv_config {} { - + + + + } diff --git a/repos/base/run/thread.run b/repos/base/run/thread.run index 32fa4d5c5..0ed43b70b 100644 --- a/repos/base/run/thread.run +++ b/repos/base/run/thread.run @@ -18,6 +18,9 @@ set config { + + + diff --git a/repos/gems/run/cpu_load_display.run b/repos/gems/run/cpu_load_display.run index 7144ed5e7..3edc8fe23 100644 --- a/repos/gems/run/cpu_load_display.run +++ b/repos/gems/run/cpu_load_display.run @@ -139,14 +139,16 @@ append config { - + + - + + @@ -182,7 +184,8 @@ append config { - + + @@ -191,7 +194,8 @@ append config { - + + } diff --git a/repos/gems/run/cpu_sampler.run b/repos/gems/run/cpu_sampler.run index 0e7f674ee..e3212536f 100644 --- a/repos/gems/run/cpu_sampler.run +++ b/repos/gems/run/cpu_sampler.run @@ -17,7 +17,6 @@ create_boot_directory install_config { - @@ -25,8 +24,6 @@ install_config { - - @@ -50,10 +47,11 @@ install_config { - - - + + + + diff --git a/repos/gems/run/cpu_sampler_noux.run b/repos/gems/run/cpu_sampler_noux.run index a9a7cde90..5797755f3 100644 --- a/repos/gems/run/cpu_sampler_noux.run +++ b/repos/gems/run/cpu_sampler_noux.run @@ -157,7 +157,7 @@ append config { - + @@ -171,19 +171,20 @@ append config { - + - + - - + + + - + @@ -194,7 +195,7 @@ append config { - + diff --git a/repos/gems/run/decorator.run b/repos/gems/run/decorator.run index 03a3c51e0..0dc7f6606 100644 --- a/repos/gems/run/decorator.run +++ b/repos/gems/run/decorator.run @@ -24,7 +24,8 @@ append config { - + + @@ -154,12 +155,10 @@ append config { - - + - - + diff --git a/repos/gems/run/decorator_stress.run b/repos/gems/run/decorator_stress.run index 9ebd20a83..f4fffc8e8 100644 --- a/repos/gems/run/decorator_stress.run +++ b/repos/gems/run/decorator_stress.run @@ -130,14 +130,10 @@ append config { - - - - - - - - + + + + diff --git a/repos/gems/run/launcher.run b/repos/gems/run/launcher.run index 6b832f749..59da330ee 100644 --- a/repos/gems/run/launcher.run +++ b/repos/gems/run/launcher.run @@ -115,7 +115,7 @@ append config { - + @@ -124,7 +124,7 @@ append config { - + @@ -163,8 +163,10 @@ append config { + + - + @@ -173,8 +175,12 @@ append config { + + + + - + @@ -186,8 +192,12 @@ append config { + + + + - + @@ -220,7 +230,7 @@ append config { - + @@ -270,9 +280,7 @@ append config { - - - + diff --git a/repos/gems/run/menu_view.run b/repos/gems/run/menu_view.run index 5cdb7abed..9208d3207 100644 --- a/repos/gems/run/menu_view.run +++ b/repos/gems/run/menu_view.run @@ -24,6 +24,8 @@ create_boot_directory append config { + + @@ -117,16 +119,14 @@ append config { - - - - - + + + + + - - - + diff --git a/repos/gems/run/mixer_gui_qt_test.run b/repos/gems/run/mixer_gui_qt_test.run index eac3d09e4..8813cd520 100644 --- a/repos/gems/run/mixer_gui_qt_test.run +++ b/repos/gems/run/mixer_gui_qt_test.run @@ -192,7 +192,7 @@ append config { - + } diff --git a/repos/gems/run/nano3d.run b/repos/gems/run/nano3d.run index 569e19b97..17203572c 100644 --- a/repos/gems/run/nano3d.run +++ b/repos/gems/run/nano3d.run @@ -14,8 +14,6 @@ set build_components { app/backdrop } -lappend_if [have_spec usb] build_components drivers/usb - build $build_components create_boot_directory @@ -110,10 +108,8 @@ append config { - - - - + + diff --git a/repos/gems/run/nit_fader.run b/repos/gems/run/nit_fader.run index 54731d2ce..c16b7522e 100644 --- a/repos/gems/run/nit_fader.run +++ b/repos/gems/run/nit_fader.run @@ -25,7 +25,8 @@ append config { - + + @@ -93,7 +94,7 @@ append config { - + diff --git a/repos/gems/run/wm.run b/repos/gems/run/wm.run index 9d52cef0d..cd3f9e75c 100644 --- a/repos/gems/run/wm.run +++ b/repos/gems/run/wm.run @@ -142,8 +142,10 @@ append config { + + - + @@ -151,8 +153,12 @@ append config { + + + + - + @@ -163,8 +169,12 @@ append config { </controls> </config> <route> + <service name="ROM" label="window_layout"> + <child name="report_rom"/> </service> + <service name="ROM" label="pointer"> + <child name="report_rom"/> </service> <any-service> - <child name="wm"/> <child name="report_rom"/> <parent/> <any-child/> + <child name="wm"/> <parent/> <any-child/> </any-service> </route> </start> diff --git a/repos/libports/run/ldso.run b/repos/libports/run/ldso.run index 8ad66cb93..226be9af3 100644 --- a/repos/libports/run/ldso.run +++ b/repos/libports/run/ldso.run @@ -6,8 +6,10 @@ set config { <config> <parent-provides> <service name="ROM"/> + <service name="RAM"/> + <service name="CPU"/> <service name="LOG"/> - <service name="RM" /> + <service name="PD"/> </parent-provides> <default-route> <any-service> <parent/> </any-service> diff --git a/repos/libports/run/moon.run b/repos/libports/run/moon.run index 8aff978f1..fcbfd5be7 100644 --- a/repos/libports/run/moon.run +++ b/repos/libports/run/moon.run @@ -9,8 +9,9 @@ create_boot_directory install_config { <config> <parent-provides> + <service name="PD"/> <service name="ROM"/> - <service name="RM"/> + <service name="RAM"/> <service name="LOG"/> <service name="IO_PORT"/> <service name="IO_MEM"/> diff --git a/repos/libports/run/rust.run b/repos/libports/run/rust.run index bc300c618..9a4ec9978 100644 --- a/repos/libports/run/rust.run +++ b/repos/libports/run/rust.run @@ -6,8 +6,10 @@ install_config { <config> <parent-provides> <service name="LOG"/> - <service name="RM"/> - <service name="ROM"/> + <service name="PD"/> + <service name="ROM"/> + <service name="RAM"/> + <service name="CPU"/> </parent-provides> <default-route> <any-service> <parent/> </any-service> diff --git a/repos/libports/run/stdcxx.run b/repos/libports/run/stdcxx.run index 265f6b357..fe6f88f50 100644 --- a/repos/libports/run/stdcxx.run +++ b/repos/libports/run/stdcxx.run @@ -8,8 +8,10 @@ install_config { <config> <parent-provides> <service name="LOG"/> - <service name="RM"/> + <service name="PD"/> <service name="ROM"/> + <service name="RAM"/> + <service name="CPU"/> </parent-provides> <default-route> <any-service> <parent/> </any-service> diff --git a/repos/os/include/init/child.h b/repos/os/include/init/child.h index 1497ae8d5..e7250fda6 100644 --- a/repos/os/include/init/child.h +++ b/repos/os/include/init/child.h @@ -125,35 +125,27 @@ namespace Init { /** * Return sub string of label with the leading child name stripped out + * + * \return character pointer to the scoped part of the label, + * or nullptr if the label is not correctly prefixed with the child's + * name */ inline char const *skip_label_prefix(char const *child_name, char const *label) { size_t const child_name_len = strlen(child_name); - /* - * If the method was called with a valid "label" string, the - * following condition should be always satisfied. See the - * comment in 'service_node_args_condition_satisfied'. - */ - if (strcmp(child_name, label, child_name_len) == 0) - label += child_name_len; + if (strcmp(child_name, label, child_name_len) != 0) + return nullptr; - /* - * If the original label was empty, the 'Child_policy_enforce_labeling' - * does not append a label separator after the child-name prefix. In - * this case, we resulting label is empty. - */ - if (*label == 0) - return label; + label += child_name_len; /* * Skip label separator. This condition should be always satisfied. */ - if (strcmp(" -> ", label, 4) == 0) - return label + 4; + if (strcmp(" -> ", label, 4) != 0) + return nullptr; - warning("cannot skip label prefix while processing <if-arg>"); - return label; + return label + 4; } @@ -176,53 +168,26 @@ namespace Init { if (!service_matches) return false; - Session_label const session_label(skip_label_prefix( - child_name.string(), label_from_args(args).string())); + bool const route_depends_on_child_provided_label = + service_node.has_attribute("label") || + service_node.has_attribute("label_prefix") || + service_node.has_attribute("label_suffix"); + + if (!route_depends_on_child_provided_label) + return true; + + char const * const scoped_label = skip_label_prefix( + child_name.string(), label_from_args(args).string()); + + if (!scoped_label) + return false; + + Session_label const session_label(scoped_label); return !Xml_node_label_score(service_node, session_label).conflict(); } - /** - * Check if arguments satisfy the condition specified for the route - */ - inline bool service_node_args_condition_satisfied(Xml_node service_node, - Session_state::Args const &args, - Child_policy::Name const &child_name) - { - try { - Xml_node if_arg = service_node.sub_node("if-arg"); - enum { KEY_MAX_LEN = 64, VALUE_MAX_LEN = 64 }; - char key[KEY_MAX_LEN]; - char value[VALUE_MAX_LEN]; - if_arg.attribute("key").value(key, sizeof(key)); - if_arg.attribute("value").value(value, sizeof(value)); - - char arg_value[VALUE_MAX_LEN]; - Arg_string::find_arg(args.string(), key).string(arg_value, sizeof(arg_value), ""); - - /* - * Skip child-name prefix if the key is the process "label". - * - * Because 'filter_session_args' is called prior the call of - * 'resolve_session_request' from the 'Child::session' method, - * 'args' contains the filtered arguments, in particular the label - * prefixed with the child's name. For the 'if-args' declaration, - * however, we want to omit specifying this prefix because the - * session route is specific to the named start node anyway. So - * the prefix information is redundant. - */ - if (strcmp("label", key) == 0) - return strcmp(value, skip_label_prefix(child_name.string(), arg_value)) == 0; - - return strcmp(value, arg_value) == 0; - } catch (...) { } - - /* if no if-arg node exists, the condition is met */ - return true; - } - - /** * Check if service name is ambiguous * @@ -566,7 +531,10 @@ class Init::Child : Child_policy, Child_service::Wakeup name, _child.ram_session_cap(), *this); } - } catch (Xml_node::Nonexistent_sub_node) { } + } + catch (Xml_node::Nonexistent_sub_node) { } + catch (Genode::Child::Inactive) { + error(this->name(), ": incomplete environment at construction time"); } } virtual ~Child() @@ -622,20 +590,7 @@ class Init::Child : Child_policy, Child_service::Wakeup Service &resolve_session_request(Service::Name const &service_name, Session_state::Args const &args) override { - /* route environment session requests to the parent */ Session_label const label(label_from_args(args.string())); - if (label == name()) { - if (service_name == Ram_session::service_name()) return _env_ram_service; - if (service_name == Cpu_session::service_name()) return _env_cpu_service; - if (service_name == Pd_session::service_name()) return _env_pd_service; - if (service_name == Log_session::service_name()) return _env_log_service; - } - - /* route initial ROM requests (binary and linker) to the parent */ - if (service_name == Rom_session::service_name()) { - if (label.last_element() == binary_name()) return _env_rom_service; - if (label.last_element() == linker_name()) return _env_rom_service; - } Service *service = nullptr; @@ -646,7 +601,7 @@ class Init::Child : Child_policy, Child_service::Wakeup /* check for "session_requests" ROM request */ if (service_name == Rom_session::service_name() && label.last_element() == Session_requester::rom_name()) - return _session_requester.service(); + return _session_requester.service(); try { Xml_node route_node = _default_route_node; @@ -662,9 +617,6 @@ class Init::Child : Child_policy, Child_service::Wakeup if (!service_node_matches(service_node, args.string(), name(), service_name)) continue; - if (!service_node_args_condition_satisfied(service_node, args, name())) - continue; - Xml_node target = service_node.sub_node(); for (; ; target = target.next()) { diff --git a/repos/os/run/clipboard.run b/repos/os/run/clipboard.run index c1ceec0c9..20f3a32c4 100644 --- a/repos/os/run/clipboard.run +++ b/repos/os/run/clipboard.run @@ -20,7 +20,8 @@ append config { <parent-provides> <service name="ROM"/> <service name="RAM"/> - <service name="RM"/> + <service name="CPU"/> + <service name="PD"/> <service name="LOG"/> <service name="IRQ"/> <service name="IO_MEM"/> @@ -62,7 +63,8 @@ append config { </config> <route> - <any-service> <child name="report_rom"/> <parent/> </any-service> + <service name="ROM" label="focus"> <child name="report_rom"/> </service> + <any-service> <parent/> </any-service> </route> </start> @@ -70,15 +72,15 @@ append config { <resource name="RAM" quantum="4M"/> <route> <!-- for the simulation of nitpicker's focus reports --> - <service name="Report"> - <if-arg key="label" value="focus"/> - <child name="report_rom" /> - </service> + <service name="Report" label="focus"> <child name="report_rom"/> </service> <!-- for the simulation of clipboard clients --> - <any-service> - <child name="clipboard"/> <any-child/> <parent/> - </any-service> + <service name="ROM" label="linux -> clipboard"> <child name="clipboard"/> </service> + <service name="ROM" label="win7 -> clipboard"> <child name="clipboard"/> </service> + <service name="ROM" label="noux -> clipboard"> <child name="clipboard"/> </service> + <service name="Report"> <child name="clipboard"/> </service> + <service name="Timer"> <child name="timer"/> </service> + <any-service> <parent/> </any-service> </route> </start> diff --git a/repos/os/run/demo.run b/repos/os/run/demo.run index 730a2d6c7..794669601 100644 --- a/repos/os/run/demo.run +++ b/repos/os/run/demo.run @@ -160,7 +160,7 @@ append config { </output> </config> <route> - <service name="ROM"> <child name="report_rom"/> </service> + <service name="ROM" label="xray"> <child name="report_rom"/> </service> <any-service> <parent/> </any-service> </route> </start> @@ -175,7 +175,7 @@ append config { </config> <route> <service name="Report"> <child name="report_rom"/> </service> - <service name="ROM"> <child name="report_rom"/> </service> + <service name="ROM" label="hover"> <child name="report_rom"/> </service> <any-service> <parent/> <any-child/> </any-service> </route> </start> @@ -200,7 +200,7 @@ append config { <start name="status_bar"> <resource name="RAM" quantum="1M"/> <route> - <service name="ROM"> <child name="report_rom"/> </service> + <service name="ROM" label="focus"> <child name="report_rom"/> </service> <any-service> <parent/> <any-child/> </any-service> </route> </start> diff --git a/repos/os/run/ram_fs_chunk.run b/repos/os/run/ram_fs_chunk.run index 7be8c4d45..09e9a407e 100644 --- a/repos/os/run/ram_fs_chunk.run +++ b/repos/os/run/ram_fs_chunk.run @@ -11,7 +11,10 @@ create_boot_directory install_config { <config> <parent-provides> - <service name="RM"/> + <service name="PD"/> + <service name="ROM"/> + <service name="RAM"/> + <service name="CPU"/> <service name="LOG"/> </parent-provides> <default-route> diff --git a/repos/os/run/rom_filter.run b/repos/os/run/rom_filter.run index c7c557b02..4d3b16cc5 100644 --- a/repos/os/run/rom_filter.run +++ b/repos/os/run/rom_filter.run @@ -20,8 +20,9 @@ append config { <parent-provides> <service name="ROM"/> <service name="RAM"/> - <service name="RM"/> + <service name="PD"/> <service name="LOG"/> + <service name="CPU"/> <service name="IRQ"/> <service name="IO_MEM"/> <service name="IO_PORT"/> @@ -90,7 +91,7 @@ append config { </config> <route> - <service name="ROM"> <child name="dynamic_rom"/> </service> + <service name="ROM" label="xray"> <child name="dynamic_rom"/> </service> <any-service> <parent/> </any-service> </route> </start> @@ -99,7 +100,7 @@ append config { <resource name="RAM" quantum="1M"/> <config rom="generated" /> <route> - <service name="ROM"> <child name="rom_filter"/> </service> + <service name="ROM" label="generated"> <child name="rom_filter"/> </service> <any-service> <parent/> </any-service> </route> </start> diff --git a/repos/os/run/tar_rom.run b/repos/os/run/tar_rom.run index 9b030fc80..e0cb3962f 100644 --- a/repos/os/run/tar_rom.run +++ b/repos/os/run/tar_rom.run @@ -54,7 +54,8 @@ install_config { <config verbose="yes"> <parent-provides> <service name="ROM"/> - <service name="RM"/> + <service name="CPU"/> + <service name="PD"/> <service name="RAM"/> <service name="LOG"/> <service name="Timer"/> @@ -65,7 +66,8 @@ install_config { </start> </config> <route> - <any-service> <child name="tar_rom"/> <parent/> <any-child/> </any-service> + <service name="ROM" label="test-timer"> <child name="tar_rom"/> </service> + <any-service> <parent/> <any-child/> </any-service> </route> </start> </config> diff --git a/repos/os/run/xml_node.run b/repos/os/run/xml_node.run index ba18f11cb..d36e5ae13 100644 --- a/repos/os/run/xml_node.run +++ b/repos/os/run/xml_node.run @@ -6,7 +6,10 @@ install_config { <config> <parent-provides> <service name="LOG"/> - <service name="RM"/> + <service name="CPU"/> + <service name="RAM"/> + <service name="ROM"/> + <service name="PD"/> </parent-provides> <default-route> <any-service> <parent/> </any-service> diff --git a/repos/os/src/app/cli_monitor/gdb_command_config b/repos/os/src/app/cli_monitor/gdb_command_config index 4af00d92b..a6b92ee6e 100644 --- a/repos/os/src/app/cli_monitor/gdb_command_config +++ b/repos/os/src/app/cli_monitor/gdb_command_config @@ -25,12 +25,9 @@ <start name="noux"> <resource name="RAM" quantum="24M"/> <route> - <service name="Terminal"> - <if-arg key="label" value=""/><parent/> - </service> - <service name="Terminal"> - <if-arg key="label" value="noux(terminal_fs)"/><child name="terminal_gdb"/> - </service> + <service name="Terminal" label=""> <parent/> </service> + <service name="Terminal" label="noux(terminal_fs)"> + <child name="terminal_gdb"/> </service> <any-service> <any-child/> <parent/> </any-service> </route> <config> diff --git a/repos/os/src/server/input_merger/README b/repos/os/src/server/input_merger/README index d2fedcdef..71c768185 100644 --- a/repos/os/src/server/input_merger/README +++ b/repos/os/src/server/input_merger/README @@ -12,12 +12,10 @@ Example configuration: <input label="usb_hid" /> </config> <route> - <service name="Input"> - <if-arg key="label" value="ps2" /> <child name="ps2_drv" /> - </service> - <service name="Input"> - <if-arg key="label" value="usb_hid" /> <child name="usb_drv" /> - </service> + <service name="Input" label="ps2"> + <child name="ps2_drv"/> </service> + <service name="Input" label="usb_hid"> + <child name="usb_drv" /> </service> <any-service> <parent /> <any-child /> </any-service> </route> </start> diff --git a/repos/os/src/test/fault_detection/main.cc b/repos/os/src/test/fault_detection/main.cc index d838391c6..fe12085f3 100644 --- a/repos/os/src/test/fault_detection/main.cc +++ b/repos/os/src/test/fault_detection/main.cc @@ -187,7 +187,9 @@ struct Faulting_loader_grand_child_test "<config>\n" " <parent-provides>\n" " <service name=\"ROM\"/>\n" - " <service name=\"RM\"/>\n" + " <service name=\"RAM\"/>\n" + " <service name=\"CPU\"/>\n" + " <service name=\"PD\"/>\n" " <service name=\"LOG\"/>\n" " </parent-provides>\n" " <default-route>\n" diff --git a/repos/ports/run/arora.run b/repos/ports/run/arora.run index a9a495c14..54e11efcb 100644 --- a/repos/ports/run/arora.run +++ b/repos/ports/run/arora.run @@ -95,9 +95,7 @@ append config { <route> <service name="Nitpicker"> <child name="wm"/> </service> <service name="Report"> <child name="clipboard"/> </service> - <service name="ROM"> - <if-arg key="label" value="clipboard"/> <child name="clipboard"/> - </service> + <service name="ROM" label="clipboard"> <child name="clipboard"/> </service> <any-service> <parent/> <any-child/> </any-service> </route> </start> diff --git a/repos/ports/run/netperf.inc b/repos/ports/run/netperf.inc index d73c5b12b..34a21f15e 100644 --- a/repos/ports/run/netperf.inc +++ b/repos/ports/run/netperf.inc @@ -216,7 +216,7 @@ append_if $use_wifi_driver config { <route> <service name="Rtc"> <any-child/> </service> <service name="File_system"> <child name="config_fs"/> </service> - <service name="ROM"> <if-arg key="label" value="wlan_configuration" /> <child name="config_rom" /> </service> + <service name="ROM" label="wlan_configuration"> <child name="config_rom" /> </service> <service name="Report"> <child name="report_rom"/> </service> <any-service> <parent/> <any-child /> </any-service> </route> diff --git a/repos/ports/run/noux_gdb.run b/repos/ports/run/noux_gdb.run index 8d1263ec8..9561760cf 100644 --- a/repos/ports/run/noux_gdb.run +++ b/repos/ports/run/noux_gdb.run @@ -162,11 +162,11 @@ append config { <start name="noux"> <resource name="RAM" quantum="1G"/> <route> - <service name="Terminal"> - <if-arg key="label" value=""/><child name="terminal_noux"/> + <service name="Terminal" label=""> + <child name="terminal_noux"/> </service> - <service name="Terminal"> - <if-arg key="label" value="/dev/gdb"/><child name="terminal_gdb"/> + <service name="Terminal" label="/dev/gdb"> + <child name="terminal_gdb"/> </service> <any-service><parent/><any-child/></any-service> </route> diff --git a/repos/ports/run/noux_terminal_fs.run b/repos/ports/run/noux_terminal_fs.run index 28fff0bf3..61dfa29ab 100644 --- a/repos/ports/run/noux_terminal_fs.run +++ b/repos/ports/run/noux_terminal_fs.run @@ -159,12 +159,10 @@ append config { <start name="noux"> <resource name="RAM" quantum="1G" /> <route> - <service name="Terminal"> - <if-arg key="label" value=""/><child name="terminal_noux"/> - </service> - <service name="Terminal"> - <if-arg key="label" value="terminal_fs"/><child name="terminal_test"/> - </service> + <service name="Terminal" label=""> + <child name="terminal_noux"/> </service> + <service name="Terminal" label="terminal_fs"> + <child name="terminal_test"/> </service> <any-service><parent/><any-child/></any-service> </route> <config> diff --git a/repos/ports/run/noux_trace_fs.run b/repos/ports/run/noux_trace_fs.run index f171dc6ae..da4f74b2b 100644 --- a/repos/ports/run/noux_trace_fs.run +++ b/repos/ports/run/noux_trace_fs.run @@ -180,17 +180,14 @@ append config { </start> </config> <route> - <service name="File_system"> - <if-arg key="label" value="home"/> <child name="ram_fs" /> </service> - <service name="File_system"> - <if-arg key="label" value="root"/> <child name="ram_fs" /> - </service> - <service name="File_system"> - <if-arg key="label" value="tmp"/> <child name="ram_fs" /> - </service> - <service name="File_system"> - <if-arg key="label" value="trace"/> <child name="trace_fs"/> - </service> + <service name="File_system" label="home"> + <child name="ram_fs" /> </service> + <service name="File_system" label="root"> + <child name="ram_fs" /> </service> + <service name="File_system" label="tmp"> + <child name="ram_fs" /> </service> + <service name="File_system" label="trace"> + <child name="trace_fs"/> </service> <any-service> <parent /> <any-child /> </any-service> </route> </start> diff --git a/repos/ports/run/seoul.inc b/repos/ports/run/seoul.inc index 6756e1ab2..856a00849 100644 --- a/repos/ports/run/seoul.inc +++ b/repos/ports/run/seoul.inc @@ -214,7 +214,6 @@ append_if $use_nic_session config { <start name="nic_drv" priority="-2"> <resource name="RAM" quantum="8M"/> <provides><service name="Nic"/></provides> - <route> <any-service><any-child/><parent/></any-service> </route> </start> } diff --git a/repos/ports/run/vbox_auto_genode_usb_hid.run b/repos/ports/run/vbox_auto_genode_usb_hid.run index 8d06b69a0..17cc4db92 100644 --- a/repos/ports/run/vbox_auto_genode_usb_hid.run +++ b/repos/ports/run/vbox_auto_genode_usb_hid.run @@ -176,9 +176,7 @@ append config { </config> <route> <service name="Report"><child name="report_rom" /></service> - <service name="ROM"> - <if-arg key="label" value="usb_devices"/> <child name="report_rom"/> - </service> + <service name="ROM" label="usb_devices"> <child name="report_rom"/> </service> <any-service> <parent/> <any-child /> </any-service> </route> </start> diff --git a/repos/ports/run/vbox_auto_win7_share.run b/repos/ports/run/vbox_auto_win7_share.run index 2fab807d7..5f1c04561 100644 --- a/repos/ports/run/vbox_auto_win7_share.run +++ b/repos/ports/run/vbox_auto_win7_share.run @@ -171,12 +171,10 @@ set config_of_app { </start> </config> <route> - <service name="File_system"> - <if-arg key="label" value="share_from"/> + <service name="File_system" label="share_from"> <child name="ram_fs_from"/> </service> - <service name="File_system"> - <if-arg key="label" value="share_to"/> + <service name="File_system" label="share_to"> <child name="ram_fs_to"/> </service> <any-service> <parent/> <any-child/> </any-service> @@ -235,18 +233,15 @@ append config_of_app { <service name="Report"> <child name="report_rom"/> </service>} append_if [expr $use_ram_fs] config_of_app { - <service name="File_system"> - <if-arg key="label" value="from_ram_fs"/> + <service name="File_system" label="from_ram_fs"> <child name="ram_fs"/> </service>} append config_of_app { - <service name="File_system"> - <if-arg key="label" value="share_ram_fs_from"/> + <service name="File_system" label="share_ram_fs_from"> <child name="ram_fs_from"/> </service> - <service name="File_system"> - <if-arg key="label" value="share_ram_fs_to"/> + <service name="File_system" label="share_ram_fs_to"> <child name="ram_fs_to"/> </service> <service name="File_system"> <child name="rump_fs"/> </service> diff --git a/repos/ports/run/vbox_pointer.run b/repos/ports/run/vbox_pointer.run index dc14cd8af..f58a99d4e 100644 --- a/repos/ports/run/vbox_pointer.run +++ b/repos/ports/run/vbox_pointer.run @@ -35,7 +35,6 @@ set config { <service name="IO_MEM"/> <service name="IO_PORT"/> <service name="PD"/> - <service name="RM"/> <service name="CPU"/> <service name="LOG"/> </parent-provides> @@ -44,9 +43,11 @@ set config { <resource name="RAM" quantum="1M"/> <provides> <service name="Timer"/> </provides> <route> - <service name="RM"> <parent/> </service> - <service name="LOG"> <parent/> </service> - <service name="ROM"> <parent/> </service> + <service name="RAM"> <parent/> </service> + <service name="ROM"> <parent/> </service> + <service name="CPU"> <parent/> </service> + <service name="PD"> <parent/> </service> + <service name="LOG"> <parent/> </service> </route> </start> <start name="fb_sdl"> @@ -58,9 +59,12 @@ set config { <config buffered="yes" width="1280" height="720" depth="16"/> <!--<config buffered="yes" width="1440" height="900" depth="16"/>--> <route> - <service name="RM"> <parent/> </service> - <service name="LOG"> <parent/> </service> - <service name="Timer"> <child name="timer"/> </service> + <service name="RAM"> <parent/> </service> + <service name="ROM"> <parent/> </service> + <service name="CPU"> <parent/> </service> + <service name="PD"> <parent/> </service> + <service name="LOG"> <parent/> </service> + <service name="Timer"> <child name="timer"/> </service> </route> </start> <alias name="input_drv" child="fb_sdl"/> @@ -76,8 +80,12 @@ set config { <policy label="pointer -> focus" report="nitpicker -> focus"/> </config> <route> - <service name="RM"> <parent/> </service> - <service name="LOG"> <parent/> </service> + <service name="RAM"> <parent/> </service> + <service name="ROM"> <parent/> </service> + <service name="CPU"> <parent/> </service> + <service name="PD"> <parent/> </service> + <service name="PD"> <parent/> </service> + <service name="LOG"> <parent/> </service> </route> </start> <start name="nitpicker"> @@ -96,7 +104,10 @@ set config { <background color="#00426f"/> <!-- indigo --> </config> <route> - <service name="RM"> <parent/> </service> + <service name="RAM"> <parent/> </service> + <service name="ROM"> <parent/> </service> + <service name="CPU"> <parent/> </service> + <service name="PD"> <parent/> </service> <service name="LOG"> <parent/> </service> <service name="Timer"> <child name="timer"/> </service> <service name="Framebuffer"> <child name="fb_drv"/> </service> @@ -116,8 +127,11 @@ set config { <policy label="pointer -> smiley" report="shape-smiley -> shape"/> </config> <route> - <service name="RM"> <parent/> </service> - <service name="LOG"> <parent/> </service> + <service name="PD"> <parent/> </service> + <service name="RAM"> <parent/> </service> + <service name="ROM"> <parent/> </service> + <service name="CPU"> <parent/> </service> + <service name="LOG"> <parent/> </service> </route> </start> <start name="shape-arrow"> @@ -125,6 +139,10 @@ set config { <resource name="RAM" quantum="2M"/> <config shape="arrow"/> <route> + <service name="PD"> <parent/> </service> + <service name="RAM"> <parent/> </service> + <service name="ROM"> <parent/> </service> + <service name="CPU"> <parent/> </service> <service name="LOG"> <parent/> </service> <service name="Report"> <child name="report_rom_shapes"/> </service> </route> @@ -134,6 +152,10 @@ set config { <resource name="RAM" quantum="2M"/> <config shape="blade"/> <route> + <service name="PD"> <parent/> </service> + <service name="RAM"> <parent/> </service> + <service name="ROM"> <parent/> </service> + <service name="CPU"> <parent/> </service> <service name="LOG"> <parent/> </service> <service name="Report"> <child name="report_rom_shapes"/> </service> </route> @@ -143,6 +165,10 @@ set config { <resource name="RAM" quantum="2M"/> <config shape="bladex"/> <route> + <service name="PD"> <parent/> </service> + <service name="RAM"> <parent/> </service> + <service name="ROM"> <parent/> </service> + <service name="CPU"> <parent/> </service> <service name="LOG"> <parent/> </service> <service name="Report"> <child name="report_rom_shapes"/> </service> </route> @@ -164,9 +190,12 @@ set config { </rom> </config> <route> - <service name="RM"> <parent/> </service> - <service name="LOG"> <parent/> </service> - <service name="Timer"> <child name="timer"/> </service> + <service name="RAM"> <parent/> </service> + <service name="ROM"> <parent/> </service> + <service name="CPU"> <parent/> </service> + <service name="PD"> <parent/> </service> + <service name="LOG"> <parent/> </service> + <service name="Timer"> <child name="timer"/> </service> </route> </start> <start name="shape-smiley"> @@ -174,10 +203,14 @@ set config { <resource name="RAM" quantum="2M"/> <configfile name="smiley.config"/> <route> - <service name="LOG"> <parent/> </service> - <service name="ROM"> <if-args key="label" value="smiley.config"/> - <child name="shape-smiley-config"/> </service> + <service name="ROM" label="smiley.config"> + <child name="shape-smiley-config"/> </service> <service name="Report"> <child name="report_rom_shapes"/> </service> + <service name="RAM"> <parent/> </service> + <service name="ROM"> <parent/> </service> + <service name="CPU"> <parent/> </service> + <service name="PD"> <parent/> </service> + <service name="LOG"> <parent/> </service> </route> </start> @@ -191,14 +224,18 @@ set config { <policy label="test-label-bladex" rom="bladex"/> </config> <route> - <service name="RM"> <parent/> </service> + <service name="PD"> <parent/> </service> <service name="LOG"> <parent/> </service> <service name="Nitpicker"> <child name="nitpicker"/> </service> - <service name="ROM"> <if-arg key="label" value="xray"/> - <child name="report_rom_nitpicker"/> </service> - <service name="ROM"> <if-arg key="label" value="hover"/> - <child name="report_rom_nitpicker"/> </service> - <service name="ROM"> <child name="report_rom_shapes"/> </service> + <service name="ROM" label="xray"> <child name="report_rom_nitpicker"/> </service> + <service name="ROM" label="hover"> <child name="report_rom_nitpicker"/> </service> + <service name="ROM" label="arrow"> <child name="report_rom_shapes"/> </service> + <service name="ROM" label="blade"> <child name="report_rom_shapes"/> </service> + <service name="ROM" label="bladex"> <child name="report_rom_shapes"/> </service> + <service name="ROM" label="smiley"> <child name="report_rom_shapes"/> </service> + <service name="RAM"> <parent/> </service> + <service name="ROM"> <parent/> </service> + <service name="CPU"> <parent/> </service> </route> </start> @@ -206,11 +243,11 @@ set config { <binary name="testnit"/> <resource name="RAM" quantum="2M"/> <route> - <service name="RM"> <parent/> </service> <service name="LOG"> <parent/> </service> <service name="PD"> <parent/> </service> <service name="CPU"> <parent/> </service> <service name="RAM"> <parent/> </service> + <service name="ROM"> <parent/> </service> <service name="Timer"> <child name="timer"/> </service> <service name="Nitpicker"> <child name="nitpicker"/> </service> </route> @@ -219,11 +256,11 @@ set config { <binary name="testnit"/> <resource name="RAM" quantum="2M"/> <route> - <service name="RM"> <parent/> </service> <service name="LOG"> <parent/> </service> <service name="PD"> <parent/> </service> <service name="CPU"> <parent/> </service> <service name="RAM"> <parent/> </service> + <service name="ROM"> <parent/> </service> <service name="Timer"> <child name="timer"/> </service> <service name="Nitpicker"> <child name="nitpicker"/> </service> </route> @@ -232,11 +269,11 @@ set config { <binary name="testnit"/> <resource name="RAM" quantum="2M"/> <route> - <service name="RM"> <parent/> </service> <service name="LOG"> <parent/> </service> <service name="PD"> <parent/> </service> <service name="CPU"> <parent/> </service> <service name="RAM"> <parent/> </service> + <service name="ROM"> <parent/> </service> <service name="Timer"> <child name="timer"/> </service> <service name="Nitpicker"> <child name="nitpicker"/> </service> </route> @@ -245,11 +282,11 @@ set config { <binary name="testnit"/> <resource name="RAM" quantum="2M"/> <route> - <service name="RM"> <parent/> </service> - <service name="LOG"> <parent/> </service> <service name="PD"> <parent/> </service> + <service name="LOG"> <parent/> </service> <service name="CPU"> <parent/> </service> <service name="RAM"> <parent/> </service> + <service name="ROM"> <parent/> </service> <service name="Timer"> <child name="timer"/> </service> <service name="Nitpicker"> <child name="nitpicker"/> </service> </route> @@ -258,10 +295,11 @@ set config { <binary name="testnit"/> <resource name="RAM" quantum="2M"/> <route> - <service name="RM"> <parent/> </service> + <service name="PD"> <parent/> </service> <service name="LOG"> <parent/> </service> <service name="CPU"> <parent/> </service> <service name="RAM"> <parent/> </service> + <service name="ROM"> <parent/> </service> <service name="Timer"> <child name="timer"/> </service> <service name="Nitpicker"> <child name="nitpicker"/> </service> </route> @@ -270,11 +308,11 @@ set config { <binary name="testnit"/> <resource name="RAM" quantum="2M"/> <route> - <service name="RM"> <parent/> </service> - <service name="LOG"> <parent/> </service> <service name="PD"> <parent/> </service> + <service name="LOG"> <parent/> </service> <service name="CPU"> <parent/> </service> <service name="RAM"> <parent/> </service> + <service name="ROM"> <parent/> </service> <service name="Timer"> <child name="timer"/> </service> <service name="Nitpicker"> <child name="nitpicker"/> </service> </route> diff --git a/repos/ports/run/vbox_win.inc b/repos/ports/run/vbox_win.inc index 7cc63cf8a..936b017c5 100644 --- a/repos/ports/run/vbox_win.inc +++ b/repos/ports/run/vbox_win.inc @@ -61,13 +61,9 @@ append config_of_app { </config> <route> } append_if [expr $use_ps2] config_of_app { - <service name="Input"> - <if-arg key="label" value="ps2" /> <child name="ps2_drv" /> - </service> } + <service name="Input" label="ps2"> <child name="ps2_drv" /> </service> } append_if [expr $use_usb] config_of_app { - <service name="Input"> - <if-arg key="label" value="usb_hid" /> <child name="usb_drv" /> - </service> } + <service name="Input" label="usb_hid"> <child name="usb_drv" /> </service> } append config_of_app { <any-service> <parent /> <any-child /> </any-service> </route> @@ -159,9 +155,17 @@ append config_of_app " append config_of_app { </config> <route> - <service name="Nitpicker"> <child name="nitpicker"/> </service> - <service name="ROM"> <child name="report_rom"/> </service> - <any-service> <parent/> <any-child/> </any-service> + <service name="Nitpicker"> <child name="nitpicker"/> </service>} + +for { set i 1} { $i <= $use_vms } { incr i} { +append config_of_app " + <service name=\"ROM\" label=\"shape$i\"> <child name=\"report_rom\"/> </service>" +} + +append config_of_app { + <service name="ROM" label="hover"> <child name="report_rom"/> </service> + <service name="ROM" label="xray"> <child name="report_rom"/> </service> + <any-service> <parent/> </any-service> </route> </start>} @@ -186,8 +190,8 @@ for { set i 1} { $i <= $use_vms } { incr i} { <service name=\"ROM\" label=\"nit_fb${i}.config\"> <child name=\"nit_fb-config\"/> </service>" append config_of_app { - <service name="LOG"> <parent/> </service> <service name="Nitpicker"> <child name="nitpicker"/> </service> + <any-service> <parent /> </any-service> </route> </start>} } @@ -231,9 +235,8 @@ for { set i 1} { $i <= $use_vms } { incr i} { append config_of_app { </config> <route> - <service name="RM"> <parent/> </service> - <service name="LOG"> <parent/> </service> <service name="Timer"> <child name="timer"/> </service> + <any-service> <parent /> </any-service> </route> </start>} @@ -294,9 +297,7 @@ for { set i 1} { $i <= $use_vms } { incr i} { <service name=\"Input\"> <child name=\"nit_fb${i}\" /> </service>" append config_of_app { <service name="Report"><child name="report_rom" /></service> - <service name="ROM"> - <if-arg key="label" value="usb_devices"/> <child name="report_rom"/> - </service> + <service name="ROM" label="usb_devices"> <child name="report_rom" /> </service> <any-service> <parent/> <any-child /> </any-service> </route> </start>} diff --git a/repos/ports/run/virtualbox_auto.inc b/repos/ports/run/virtualbox_auto.inc index c3ebbcd35..029bd66d5 100644 --- a/repos/ports/run/virtualbox_auto.inc +++ b/repos/ports/run/virtualbox_auto.inc @@ -176,6 +176,7 @@ append_if [expr $use_cpu_load] config { <service name="LOG"><parent/></service> <service name="Timer"><child name="timer"/></service> <service name="Report"><child name="report_rom"/></service> + <any-service><parent/></any-service> </route> </start> @@ -187,6 +188,7 @@ append_if [expr $use_cpu_load] config { <service name="Timer"><child name="timer"/></service> <service name="ROM" label="trace_subjects"><child name="report_rom"/></service> <service name="Nitpicker"><child name="nitpicker"/></service> + <any-service><parent/></any-service> </route> </start>}