vfs: dynamic configuration support

This commit is contained in:
Sebastian Sumpf
2017-02-07 19:03:23 +01:00
committed by Norman Feske
parent 8025f5f570
commit aa602032dd
18 changed files with 70 additions and 26 deletions

View File

@ -562,7 +562,8 @@ class Vfs::Dir_file_system : public File_system
** File_system interface **
***************************/
char const *name() const { return "dir"; }
char const *name() const { return "dir"; }
char const *type() override { return "dir"; }
/**
* Synchronize all file systems
@ -583,6 +584,25 @@ class Vfs::Dir_file_system : public File_system
fs->sync(path);
}
void apply_config(Genode::Xml_node const &node) override
{
using namespace Genode;
File_system *curr = _first_file_system;
for (unsigned i = 0; i < node.num_sub_nodes(); i++, curr = curr->next) {
Xml_node const &sub_node = node.sub_node(i);
/* check if type of XML node matches current file-system type */
if (sub_node.has_type(curr->type()) == false) {
Genode::error("VFS config update failed (node type '",
sub_node.type(), "' != fs type '", curr->type(),"')");
return;
}
curr->apply_config(node.sub_node(i));
}
}
/********************************
** File I/O service interface **