aboutsummaryrefslogtreecommitdiff
path: root/libmachdev/trivfs_server.c
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2020-11-14 12:32:21 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2020-11-14 12:34:29 +0100
commite6657829a66e72078b33f4c11c4501b054fac904 (patch)
tree98f9291fcdd197771628ce1041af43d2f242eff7 /libmachdev/trivfs_server.c
parentf366c5540592871ac05ea5b078e40dc581a7b2ec (diff)
downloadhurd-e6657829a66e72078b33f4c11c4501b054fac904.tar.gz
hurd-e6657829a66e72078b33f4c11c4501b054fac904.tar.bz2
hurd-e6657829a66e72078b33f4c11c4501b054fac904.zip
libmachdev: Avoid conflating translator name and path
bootstrap translators may not wish to appear in the FS, and the name of the translator does not have to match the path where it is getting installed. * libmachdev/machdev.h (machdev_trivfs_init): Add path parameter. * libmachdev/trivfs_server.c (machdev_trivfs_init): Add path parameter, set devnode only if it is not NULL. (trivfs_S_fsys_init): Only call install_as_translator when devnode is not NULL. * /rumpdisk/main.c (main): Add path parameter.
Diffstat (limited to 'libmachdev/trivfs_server.c')
-rw-r--r--libmachdev/trivfs_server.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libmachdev/trivfs_server.c b/libmachdev/trivfs_server.c
index 5d01e61d..0501f8d2 100644
--- a/libmachdev/trivfs_server.c
+++ b/libmachdev/trivfs_server.c
@@ -281,7 +281,7 @@ trivfs_S_fsys_init (struct trivfs_control *fsys,
/* Install the bootstrap port on /dev/something so users
* can still access the bootstrapped device */
- if (bootstrapped)
+ if (bootstrapped && devnode)
{
right = ports_get_send_right (&control->pi);
install_as_translator (right);
@@ -384,7 +384,7 @@ resume_bootstrap_server(mach_port_t server_task, const char *server_name)
}
int
-machdev_trivfs_init(mach_port_t bootstrap_resume_task, const char *name, mach_port_t *bootstrap)
+machdev_trivfs_init(mach_port_t bootstrap_resume_task, const char *name, const char *path, mach_port_t *bootstrap)
{
port_bucket = ports_create_bucket ();
trivfs_cntl_class = ports_create_class (trivfs_clean_cntl, 0);
@@ -394,7 +394,8 @@ machdev_trivfs_init(mach_port_t bootstrap_resume_task, const char *name, mach_po
if (bootstrap_resume_task != MACH_PORT_NULL)
{
- devnode = strdup(name);
+ if (path)
+ devnode = strdup(path);
resume_bootstrap_server(bootstrap_resume_task, name);
*bootstrap = MACH_PORT_NULL;
/* We need to install as a translator later */