[prev in list] [next in list] [prev in thread] [next in thread] 

List:       hurd-bug
Subject:    Re: [PATCH] libmachdev: Introduce startup notification for clean rumpdisk shutdown
From:       Samuel Thibault <samuel.thibault () gnu ! org>
Date:       2020-07-25 11:25:50
Message-ID: 20200725112550.42d24khr3ib73hah () function
[Download RAW message or body]

Damien Zammit, le sam. 25 juil. 2020 16:51:50 +1000, a ecrit:
> -SRCS = ds_routines.c trivfs_server.c \
> -       deviceServer.c notifyServer.c mach_i386Server.c
> +SRCS = ds_routines.c trivfs_server.c startup_notifyServer.c \
> +       deviceServer.c notifyServer.c mach_i386Server.c startup.c startup-ops.c

I'd say not to split the code into several files. It's already hard to
understand how bootstrap works, putting the different pieces in separate
files will not help people reading it.

> +/* The system is going down. Call trivfs_goaway() */
> +error_t
> +S_startup_dosync (mach_port_t handle)
> +{
> +  struct port_info *inpi = ports_lookup_port (port_bucket, handle,
> +					      machdev_shutdown_notify_class);
> +
> +  if (!inpi)
> +    return EOPNOTSUPP;
> +
> +  ports_port_deref (inpi);
> +
> +  return trivfs_goaway (NULL, FSYS_GOAWAY_FORCE);
> +}

That, in particular, should probably interact with machdev_trivfs_init
and machdev_trivfs_server, to let the translator using machdev register
a function to be called at shutdown. In the rump case, it'll have to
flush the disk caches, before startup shuts the system down.

Samuel

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic