decorator: fix cap-upgrade handling

This commit fixes the 'Out_of_caps' handling. The previous version
mistakenly upgraded the RAM instead the caps as response. The problem
could be triggered by the 'decorator_stress.run' script.
This commit is contained in:
Norman Feske 2020-06-17 14:52:27 +02:00
parent f63713694c
commit c8322ffd2a
2 changed files with 7 additions and 3 deletions

View File

@ -9,6 +9,7 @@ import_from_depot [depot_user]/src/[base_src] \
[depot_user]/src/decorator \ [depot_user]/src/decorator \
[depot_user]/src/libc \ [depot_user]/src/libc \
[depot_user]/src/libpng \ [depot_user]/src/libpng \
[depot_user]/src/vfs \
[depot_user]/src/zlib [depot_user]/src/zlib
install_config { install_config {
@ -82,8 +83,11 @@ install_config {
</route> </route>
</start> </start>
<start name="decorator"> <start name="decorator" caps="200">
<resource name="RAM" quantum="8M"/> <resource name="RAM" quantum="8M"/>
<config>
<default-policy/>
</config>
<route> <route>
<service name="ROM" label="pointer"> <service name="ROM" label="pointer">
<child name="report_rom" /> </service> <child name="report_rom" /> </service>

View File

@ -183,7 +183,7 @@ struct Decorator::Main : Window_factory_base
*/ */
Window_base *create(Xml_node window_node) override Window_base *create(Xml_node window_node) override
{ {
for (unsigned retry = 0 ; retry < 2; retry ++) { for (;;) {
try { try {
return new (_heap) return new (_heap)
Window(window_node.attribute_value("id", 0UL), Window(window_node.attribute_value("id", 0UL),
@ -195,7 +195,7 @@ struct Decorator::Main : Window_factory_base
} }
catch (Genode::Out_of_caps) { catch (Genode::Out_of_caps) {
Genode::log("Handle Out_of_caps of nitpicker session - upgrade by 2"); Genode::log("Handle Out_of_caps of nitpicker session - upgrade by 2");
_nitpicker.upgrade_ram(2); _nitpicker.upgrade_caps(2);
} }
} }
return nullptr; return nullptr;