From cc8b03ae4ff75c0e207c4bbf73036512d42339e7 Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Wed, 14 Feb 2018 21:51:06 +0100 Subject: [PATCH] depot_deploy: customization hooks for start nodes This patch enables the manual customization of 'ram', 'caps', and 'version' attributes of start nodes. --- repos/gems/src/app/depot_deploy/child.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/repos/gems/src/app/depot_deploy/child.h b/repos/gems/src/app/depot_deploy/child.h index c460030dc..08bfc9280 100644 --- a/repos/gems/src/app/depot_deploy/child.h +++ b/repos/gems/src/app/depot_deploy/child.h @@ -131,8 +131,11 @@ class Depot_deploy::Child : public List_model::Element Xml_node const runtime = pkg.sub_node("runtime"); - _ram_quota = Ram_quota { runtime.attribute_value("ram", Number_of_bytes()) }; - _cap_quota = Cap_quota { runtime.attribute_value("caps", 0UL) }; + Number_of_bytes const ram { runtime.attribute_value("ram", Number_of_bytes()) }; + _ram_quota = Ram_quota { _start_xml->xml().attribute_value("ram", ram) }; + + unsigned long const caps = runtime.attribute_value("caps", 0UL); + _cap_quota = Cap_quota { _start_xml->xml().attribute_value("caps", caps) }; _binary_name = runtime.attribute_value("binary", Binary_name()); _config_name = runtime.attribute_value("config", Config_name()); @@ -175,6 +178,11 @@ void Depot_deploy::Child::gen_start_node(Xml_generator &xml, Xml_node common) co xml.attribute("name", _name); xml.attribute("caps", _cap_quota.value); + typedef String<64> Version; + Version const version = _start_xml->xml().attribute_value("version", Version()); + if (version.valid()) + xml.attribute("version", version); + xml.node("binary", [&] () { xml.attribute("name", _binary_name); }); xml.node("resource", [&] () {