Deprecate policy constructor with implicit config

because it uses the deprecated config library.

Issue #1987
This commit is contained in:
Christian Helmuth 2017-04-04 15:18:06 +02:00
parent dde11de008
commit e49bb4943e
2 changed files with 17 additions and 6 deletions

View File

@ -211,9 +211,7 @@ class Genode::Session_policy : public Xml_node
* Constructor
*
* \param label label used as the selector of a policy
* \param config XML node that contains the policies as sub nodes,
* using the component's top-level config node by
* default
* \param config XML node that contains the policies as sub nodes
*
* \throw No_policy_defined the server configuration has no
* policy defined for the specified label
@ -227,11 +225,24 @@ class Genode::Session_policy : public Xml_node
* with the longest label is selected.
*/
template <size_t N>
explicit Session_policy(String<N> const &label,
Xml_node config = Genode::config()->xml_node())
Session_policy(String<N> const &label, Xml_node config)
:
Xml_node(_query_policy(label, config))
{ }
/**
* Constructor
*
* \param label label used as the selector of a policy
*
* \deprecated use constructor with explicit 'config' argument
*/
template <size_t N> explicit Session_policy(String<N> const &label) __attribute__((deprecated));
};
template <Genode::size_t N> Genode::Session_policy::Session_policy(String<N> const &label)
:
Xml_node(_query_policy(label, Genode::config()->xml_node()))
{ }
#endif /* _INCLUDE__OS__SESSION_POLICY_H_ */

View File

@ -205,7 +205,7 @@ class Platform::Session_component : public Genode::Rpc_object<Session>
Genode::Region_map &_local_rm;
Genode::Heap _md_alloc;
Genode::Session_label const _label;
Genode::Session_policy const _policy { _label };
Genode::Session_policy const _policy { _label, _config.xml() };
Genode::List<Device_component> _device_list;
Platform::Pci_buses &_pci_bus;
Genode::Heap &_global_heap;