diff --git a/repos/os/src/server/part_blk/component.h b/repos/os/src/server/part_blk/component.h index aca372ad4..7ae005bb6 100644 --- a/repos/os/src/server/part_blk/component.h +++ b/repos/os/src/server/part_blk/component.h @@ -211,6 +211,7 @@ class Block::Root : private: Genode::Env &_env; + Genode::Xml_node _config; Block::Driver &_driver; Block::Partition_table &_table; @@ -233,7 +234,7 @@ class Block::Root : Session_label const label = label_from_args(args); char const *label_str = label.string(); try { - Session_policy policy(label); + Session_policy policy(label, _config); /* read partition attribute */ policy.attribute("partition").value(&num); @@ -291,9 +292,9 @@ class Block::Root : public: - Root(Genode::Env &env, Genode::Heap &heap, + Root(Genode::Env &env, Genode::Xml_node config, Genode::Heap &heap, Block::Driver &driver, Block::Partition_table &table) - : Root_component(env.ep(), heap), _env(env), + : Root_component(env.ep(), heap), _env(env), _config(config), _driver(driver), _table(table) { } }; diff --git a/repos/os/src/server/part_blk/main.cc b/repos/os/src/server/part_blk/main.cc index 64eb282b8..01da40614 100644 --- a/repos/os/src/server/part_blk/main.cc +++ b/repos/os/src/server/part_blk/main.cc @@ -32,13 +32,16 @@ class Main Block::Partition_table & _table(); - Genode::Env & _env; + Genode::Env &_env; + + Genode::Attached_rom_dataspace _config { _env, "config" }; + Genode::Heap _heap { _env.ram(), _env.rm() }; Block::Driver _driver { _env, _heap }; Genode::Reporter _reporter { _env, "partitions" }; Mbr_partition_table _mbr { _heap, _driver, _reporter }; Gpt _gpt { _heap, _driver, _reporter }; - Block::Root _root { _env, _heap, _driver, _table() }; + Block::Root _root { _env, _config.xml(), _heap, _driver, _table() }; public: @@ -65,14 +68,12 @@ Block::Partition_table & Main::_table() bool use_gpt = false; bool report = false; - Genode::Attached_rom_dataspace config(_env, "config"); - try { - use_gpt = config.xml().attribute_value("use_gpt", false); + use_gpt = _config.xml().attribute_value("use_gpt", false); } catch(...) {} try { - report = config.xml().sub_node("report").attribute_value + report = _config.xml().sub_node("report").attribute_value ("partitions", false); if (report) _reporter.enabled(true);