mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-07 11:27:29 +00:00
sculpt: increase ram-fs caps on demand
This commit is contained in:
parent
950b270e74
commit
ae55187a68
@ -581,13 +581,23 @@ void Sculpt::Main::_handle_runtime_state()
|
||||
/* upgrade ram_fs quota on demand */
|
||||
state.for_each_sub_node("child", [&] (Xml_node child) {
|
||||
|
||||
if (child.attribute_value("name", String<16>()) == "ram_fs"
|
||||
&& child.has_sub_node("ram")
|
||||
&& child.sub_node("ram").has_attribute("requested")) {
|
||||
if (child.attribute_value("name", String<16>()) == "ram_fs") {
|
||||
|
||||
_storage._ram_fs_state.ram_quota.value *= 2;
|
||||
reconfigure_runtime = true;
|
||||
generate_dialog();
|
||||
if (child.has_sub_node("ram")
|
||||
&& child.sub_node("ram").has_attribute("requested")) {
|
||||
|
||||
_storage._ram_fs_state.ram_quota.value *= 2;
|
||||
reconfigure_runtime = true;
|
||||
generate_dialog();
|
||||
}
|
||||
|
||||
if (child.has_sub_node("caps")
|
||||
&& child.sub_node("caps").has_attribute("requested")) {
|
||||
|
||||
_storage._ram_fs_state.cap_quota.value += 100;
|
||||
reconfigure_runtime = true;
|
||||
generate_dialog();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@ -622,6 +632,7 @@ void Sculpt::Main::_generate_runtime_config(Xml_generator &xml) const
|
||||
xml.attribute("init_ram", "yes");
|
||||
xml.attribute("init_caps", "yes");
|
||||
xml.attribute("child_ram", "yes");
|
||||
xml.attribute("child_caps", "yes");
|
||||
xml.attribute("delay_ms", 4*500);
|
||||
xml.attribute("buffer", "64K");
|
||||
});
|
||||
|
@ -24,9 +24,11 @@ namespace Sculpt { struct Ram_fs_state; }
|
||||
|
||||
struct Sculpt::Ram_fs_state : Noncopyable
|
||||
{
|
||||
static Ram_quota initial_ram() { return Ram_quota{1024*1024}; }
|
||||
static Ram_quota initial_ram_quota() { return Ram_quota{1024*1024}; }
|
||||
static Cap_quota initial_cap_quota() { return Cap_quota{300}; }
|
||||
|
||||
Ram_quota ram_quota = initial_ram();
|
||||
Ram_quota ram_quota = initial_ram_quota();
|
||||
Cap_quota cap_quota = initial_cap_quota();
|
||||
|
||||
struct Version { unsigned value; } version { 0 };
|
||||
|
||||
|
@ -18,7 +18,7 @@ void Sculpt::gen_ram_fs_start_content(Xml_generator &xml,
|
||||
{
|
||||
xml.attribute("version", state.version.value);
|
||||
|
||||
gen_common_start_content(xml, "ram_fs", Cap_quota{300}, state.ram_quota);
|
||||
gen_common_start_content(xml, "ram_fs", state.cap_quota, state.ram_quota);
|
||||
|
||||
gen_provides<::File_system::Session>(xml);
|
||||
|
||||
|
@ -182,7 +182,8 @@ struct Sculpt::Storage : Storage_dialog::Action
|
||||
|
||||
void reset_ram_fs() override
|
||||
{
|
||||
_ram_fs_state.ram_quota = Ram_fs_state::initial_ram();
|
||||
_ram_fs_state.ram_quota = Ram_fs_state::initial_ram_quota();
|
||||
_ram_fs_state.cap_quota = Ram_fs_state::initial_cap_quota();
|
||||
_ram_fs_state.version.value++;
|
||||
|
||||
dialog.reset_operation();
|
||||
|
Loading…
x
Reference in New Issue
Block a user