mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-19 13:47:56 +00:00
os/session_policy: warn if no policy exists
The situation where a 'Session_policy' is constructed for a label with no matching policy is in almost all cases a configuration problem. A diagnostic message eases pin-pointing such mistaks. By adding the message to the 'Session_policy', servers don't need to manually handle the exception to provide diagnostic information. This simplifies the server code in many components.
This commit is contained in:
parent
f529871162
commit
d3759811b6
@ -12,6 +12,7 @@
|
||||
<resource name="RAM" quantum="8M"/>
|
||||
<config>
|
||||
<controls> <maximizer/> <title/> </controls>
|
||||
<default-policy/>
|
||||
</config>
|
||||
<route>
|
||||
<service name="ROM" label="window_layout"> <parent label="window_layout"/> </service>
|
||||
|
@ -45,6 +45,7 @@
|
||||
<config>
|
||||
<policy label_prefix="decorator" role="decorator"/>
|
||||
<policy label_prefix="layouter" role="layouter"/>
|
||||
<default-policy/>
|
||||
</config>
|
||||
<route>
|
||||
<service name="ROM" label="resize_request"> <child name="report_rom"/> </service>
|
||||
|
@ -14,6 +14,7 @@
|
||||
<config>
|
||||
<libc/>
|
||||
<vfs> <tar name="plain_decorator_theme.tar"/> </vfs>
|
||||
<default-policy/>
|
||||
</config>
|
||||
<route>
|
||||
<service name="ROM" label="window_layout"> <parent label="window_layout"/> </service>
|
||||
|
@ -15,6 +15,7 @@
|
||||
#define _INCLUDE__OS__SESSION_POLICY_H_
|
||||
|
||||
#include <base/session_label.h>
|
||||
#include <base/log.h>
|
||||
#include <session/session.h>
|
||||
#include <util/arg_string.h>
|
||||
#include <util/xml_node.h>
|
||||
@ -199,6 +200,7 @@ class Genode::Session_policy : public Xml_node
|
||||
try { return config.sub_node("default-policy"); }
|
||||
catch (...) { }
|
||||
|
||||
warning("no policy defined for label '", label, "'");
|
||||
throw No_policy_defined();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user