mirror of
https://github.com/genodelabs/genode.git
synced 2025-06-22 16:59:03 +00:00
part_blk: prevent deprecated warning
This commit is contained in:
@ -211,6 +211,7 @@ class Block::Root :
|
|||||||
private:
|
private:
|
||||||
|
|
||||||
Genode::Env &_env;
|
Genode::Env &_env;
|
||||||
|
Genode::Xml_node _config;
|
||||||
Block::Driver &_driver;
|
Block::Driver &_driver;
|
||||||
Block::Partition_table &_table;
|
Block::Partition_table &_table;
|
||||||
|
|
||||||
@ -233,7 +234,7 @@ class Block::Root :
|
|||||||
Session_label const label = label_from_args(args);
|
Session_label const label = label_from_args(args);
|
||||||
char const *label_str = label.string();
|
char const *label_str = label.string();
|
||||||
try {
|
try {
|
||||||
Session_policy policy(label);
|
Session_policy policy(label, _config);
|
||||||
|
|
||||||
/* read partition attribute */
|
/* read partition attribute */
|
||||||
policy.attribute("partition").value(&num);
|
policy.attribute("partition").value(&num);
|
||||||
@ -291,9 +292,9 @@ class Block::Root :
|
|||||||
|
|
||||||
public:
|
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)
|
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) { }
|
_driver(driver), _table(table) { }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -32,13 +32,16 @@ class Main
|
|||||||
|
|
||||||
Block::Partition_table & _table();
|
Block::Partition_table & _table();
|
||||||
|
|
||||||
Genode::Env & _env;
|
Genode::Env &_env;
|
||||||
|
|
||||||
|
Genode::Attached_rom_dataspace _config { _env, "config" };
|
||||||
|
|
||||||
Genode::Heap _heap { _env.ram(), _env.rm() };
|
Genode::Heap _heap { _env.ram(), _env.rm() };
|
||||||
Block::Driver _driver { _env, _heap };
|
Block::Driver _driver { _env, _heap };
|
||||||
Genode::Reporter _reporter { _env, "partitions" };
|
Genode::Reporter _reporter { _env, "partitions" };
|
||||||
Mbr_partition_table _mbr { _heap, _driver, _reporter };
|
Mbr_partition_table _mbr { _heap, _driver, _reporter };
|
||||||
Gpt _gpt { _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:
|
public:
|
||||||
|
|
||||||
@ -65,14 +68,12 @@ Block::Partition_table & Main::_table()
|
|||||||
bool use_gpt = false;
|
bool use_gpt = false;
|
||||||
bool report = false;
|
bool report = false;
|
||||||
|
|
||||||
Genode::Attached_rom_dataspace config(_env, "config");
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
use_gpt = config.xml().attribute_value("use_gpt", false);
|
use_gpt = _config.xml().attribute_value("use_gpt", false);
|
||||||
} catch(...) {}
|
} catch(...) {}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
report = config.xml().sub_node("report").attribute_value
|
report = _config.xml().sub_node("report").attribute_value
|
||||||
("partitions", false);
|
("partitions", false);
|
||||||
if (report)
|
if (report)
|
||||||
_reporter.enabled(true);
|
_reporter.enabled(true);
|
||||||
|
Reference in New Issue
Block a user