mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-23 15:32:25 +00:00
depot_deploy: support cpu quota configuration
the same as the ram and cap quota
This commit is contained in:
parent
5f350adb57
commit
b2a7ac2996
@ -97,6 +97,7 @@ class Depot_deploy::Child : public List_model<Child>::Element
|
||||
*/
|
||||
Number_of_bytes _pkg_ram_quota { 0 };
|
||||
unsigned long _pkg_cap_quota { 0 };
|
||||
unsigned long _pkg_cpu_quota { 0 };
|
||||
|
||||
Binary_name _binary_name { };
|
||||
Config_name _config_name { };
|
||||
@ -181,6 +182,7 @@ class Depot_deploy::Child : public List_model<Child>::Element
|
||||
|
||||
_pkg_ram_quota = runtime.attribute_value("ram", Number_of_bytes());
|
||||
_pkg_cap_quota = runtime.attribute_value("caps", 0UL);
|
||||
_pkg_cpu_quota = runtime.attribute_value("cpu", 0UL);
|
||||
|
||||
_binary_name = runtime.attribute_value("binary", Binary_name());
|
||||
_config_name = runtime.attribute_value("config", Config_name());
|
||||
@ -356,6 +358,16 @@ void Depot_deploy::Child::gen_start_node(Xml_generator &xml, Xml_node common,
|
||||
xml.attribute("quantum", String<32>(ram));
|
||||
});
|
||||
|
||||
unsigned long cpu_quota = _pkg_cpu_quota;
|
||||
if (_defined_by_launcher())
|
||||
cpu_quota = _launcher_xml->xml().attribute_value("cpu", cpu_quota);
|
||||
cpu_quota = _start_xml->xml().attribute_value("cpu", cpu_quota);
|
||||
|
||||
xml.node("resource", [&] () {
|
||||
xml.attribute("name", "CPU");
|
||||
xml.attribute("quantum", cpu_quota);
|
||||
});
|
||||
|
||||
Xml_node const runtime = _pkg_xml->xml().sub_node("runtime");
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user