From 27527bf16586defc7c91333ad215c86c3bf2ee7c Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Fri, 26 Mar 2021 16:15:59 +0100 Subject: [PATCH] wm: allow clients to upgrade session caps This patch adds the handling neccessary for clients to upgrade the cap quota of their GUI session. Until now, the upgrade mechanism supported only RAM quota. The limitation became visible once a client - in the particular case the motif_decorator - attempted the cap upgrade of its GUI session. The cap quota would arrive at the wm, but the wm would keep it instead of forwarding the quota to nitpicker. This resulted in an infinite retry loop at the motif_decorator, ultimatedly depleting all its cap quota. --- repos/gems/src/server/wm/decorator_gui.h | 3 +-- repos/gems/src/server/wm/gui.h | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/repos/gems/src/server/wm/decorator_gui.h b/repos/gems/src/server/wm/decorator_gui.h index 3aae43543b..d383ef2c8f 100644 --- a/repos/gems/src/server/wm/decorator_gui.h +++ b/repos/gems/src/server/wm/decorator_gui.h @@ -328,8 +328,7 @@ struct Wm::Decorator_gui_session : Genode::Rpc_object, void upgrade(const char *args) { - size_t const ram_quota = Arg_string::find_arg(args, "ram_quota").ulong_value(0); - _gui_session.upgrade_ram(ram_quota); + _gui_session.upgrade(Genode::session_resources_from_args(args)); } Pointer::Position last_observed_pointer_pos() const diff --git a/repos/gems/src/server/wm/gui.h b/repos/gems/src/server/wm/gui.h index 36a8d51a1d..433139406f 100644 --- a/repos/gems/src/server/wm/gui.h +++ b/repos/gems/src/server/wm/gui.h @@ -813,8 +813,7 @@ class Wm::Gui::Session_component : public Rpc_object, void upgrade(char const *args) { - size_t const ram_quota = Arg_string::find_arg(args, "ram_quota").ulong_value(0); - _session.upgrade_ram(ram_quota); + _session.upgrade(Genode::session_resources_from_args(args)); } void try_to_init_real_child_views()