part_blk: prevent deprecated warning

This commit is contained in:
Christian Helmuth 2017-05-23 11:22:42 +02:00
parent 85919d29e2
commit 923b3ec54d
2 changed files with 11 additions and 9 deletions

View File

@ -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) { }
};

View File

@ -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);