Catch exceptions when creating VFS

Catch exceptions at File_system_factory::create.
Print error message in Dir_file_system.

Fixes #1786
This commit is contained in:
Emery Hemingway
2015-11-23 13:39:29 +01:00
committed by Christian Helmuth
parent 4aafa882d8
commit 549f77eafe
2 changed files with 25 additions and 11 deletions

View File

@ -210,6 +210,8 @@ class Vfs::Dir_file_system : public File_system
:
_first_file_system(0)
{
using namespace Genode;
/* remember directory name */
if (node.has_type("fstab") || node.has_type("vfs"))
_name[0] = 0;
@ -233,9 +235,16 @@ class Vfs::Dir_file_system : public File_system
continue;
}
char type_name[64];
sub_node.type_name(type_name, sizeof(type_name));
PWRN("unknown fstab node type <%s>", type_name);
PERR("failed to create <%s> VFS node", sub_node.type().string());
try {
String<64> value;
for (unsigned i = 0; i < 16; ++i) {
Xml_attribute attr = sub_node.attribute(i);
attr.value(&value);
PERR("\t%s=\"%s\"", attr.name().string(), value.string());
}
} catch (Xml_node::Nonexistent_attribute) { }
}
}