search for: nbdkit_shutdown

Displaying 20 results from an estimated 34 matches for "nbdkit_shutdown".

2020 Mar 04
0
[PATCH nbdkit 2/4] server: Add nbdkit_shutdown() call.
...rs can call L<exit(3)> in the configuration phase +(before and including C<.get_ready>, but not in connected callbacks). + +Once nbdkit has started serving connections, plugins and filters +should not call L<exit(3)>. However they may instruct nbdkit to shut +down by calling C<nbdkit_shutdown>: + + void nbdkit_shutdown (void); + +This function requests an asynchronous shutdown and returns (I<note> +that it does I<not> exit the process immediately). It ensures that +the plugin and all filters are unloaded cleanly which may take some +time. Further callbacks from nbdkit i...
2020 Mar 06
1
Re: [PATCH nbdkit 2/4] server: Add nbdkit_shutdown() call.
On 3/4/20 9:17 AM, Richard W.M. Jones wrote: > Plugins and filters may call this to initiate an asynchronous shutdown > of the server. This would only be used in the connected phase — > plugins should still call exit(3) directly for configuration failure. > > It is equivalent to sending a kill signal to self, but it's cleaner to > have an API for this and better for
2020 Mar 04
7
[PATCH nbdkit 0/4] server: Add nbdkit_shutdown() call and two new filters.
This adds a new nbdkit_shutdown() API whereby plugins and filters can request that the server shuts down (asynchronously) during the serving phase. Two new filters are added, one of which depends on this feature and the other not needing it but being somewhat related. Rich.
2020 Mar 26
0
[PATCH nbdkit 5/9 patch split 5/5] server: Indirect slow path, non-self-contained functions through the server.
...diff --git a/server/internal.h b/server/internal.h index a3f4d1f1..9ef0b066 100644 --- a/server/internal.h +++ b/server/internal.h @@ -153,6 +153,7 @@ extern int quit_fd; extern void set_up_quit_pipe (void); extern void close_quit_pipe (void); extern void handle_quit (int sig); +extern void do_nbdkit_shutdown (void); /* signals.c */ extern void set_up_signals (void); @@ -473,6 +474,7 @@ extern int backend_cache (struct backend *b, extern struct backend *plugin_register (size_t index, const char *filename, void *dl, struct nbdkit_plugin *(*plugin_init) (void)...
2020 Mar 24
2
Re: nbdkit / mingw support
On 3/24/20 3:12 PM, Eric Blake wrote: >> (For non-mingw platforms) this breaks the source API promises rather >> seriously, so if I understand your proposal correctly I don't think >> this is a good idea.  It's possibly something we can consider for >> internal plugins, or for the V3 API. > > How does it break API to request that someone link against a
2020 Mar 25
2
Re: nbdkit / mingw support
...t_debug, nbdkit_error, nbdkit_*extents). > > Unfortunately some functions depend themselves on internals > of the server: > > * nbdkit_nanosleep, nbdkit_export_name, nbdkit_peer_name call > threadlocal_get_conn > * nbdkit_set_error calls threadlocal_set_error > * nbdkit_shutdown must set the quit global (or call a server function) Yeah, there's some awkward dependencies to figure out. It's obvious the library has to export public nbdkit_* interfaces for the sake of plugins, but can it also export one additional symbol _nbdkit_init() for internal use? Then we c...
2020 Mar 25
0
Re: nbdkit / mingw support
...(eg. nbdkit_parse_*, nbdkit_realpath, nbdkit_debug, nbdkit_error, nbdkit_*extents). Unfortunately some functions depend themselves on internals of the server: * nbdkit_nanosleep, nbdkit_export_name, nbdkit_peer_name call threadlocal_get_conn * nbdkit_set_error calls threadlocal_set_error * nbdkit_shutdown must set the quit global (or call a server function) I guess we can deal with the first ones by moving threadlocal.c into the same library, although it's a bit awkward. The quit flag is still more awkward because you have to move a lot of quit pipe handling code into the library which has kno...
2020 May 02
0
ANNOUNCE: nbdkit 1.20 - high performance NBD server
...ed (Eric Blake). Language bindings Plugins may now be written in Golang, see nbdkit-golang-plugin(3) (thanks Dan Berrangé, James Shubin). OCaml plugins can now access "nbdkit_realpath", "nbdkit_nanosleep", "nbdkit_export_name" and "nbdkit_shutdown". Python plugins now transparently support fail-fast zero (Eric Blake). Filters New nbdkit-exitlast-filter(1) causes nbdkit to exit after the last client connection. New nbdkit-limit-filter(1) allows you to limit the number of clients which can simultan...
2020 Aug 18
0
[PATCH nbdkit 8/9] include: Prefix all exports with NBDKIT_DLLEXPORT.
...n int nbdkit_stdio_safe (void); -extern int nbdkit_read_password (const char *value, char **password); -extern char *nbdkit_realpath (const char *path); -extern int nbdkit_nanosleep (unsigned sec, unsigned nsec); -extern int nbdkit_peer_name (struct sockaddr *addr, socklen_t *addrlen); -extern void nbdkit_shutdown (void); +extern NBDKIT_DLLEXPORT char *nbdkit_absolute_path (const char *path); +extern NBDKIT_DLLEXPORT int64_t nbdkit_parse_size (const char *str); +extern NBDKIT_DLLEXPORT int nbdkit_parse_bool (const char *str); +extern NBDKIT_DLLEXPORT int nbdkit_parse_int (const char *what, +...
2020 Mar 23
0
[PATCH nbdkit 1/3] include: Function indirection for PE DLL
...st char *msg, ...) ATTRIBUTE_FORMAT_PRINTF (1, 2); extern void nbdkit_verror (const char *msg, va_list args) ATTRIBUTE_FORMAT_PRINTF (1, 0); @@ -113,9 +118,133 @@ extern const char *nbdkit_export_name (void); extern int nbdkit_peer_name (struct sockaddr *addr, socklen_t *addrlen); extern void nbdkit_shutdown (void); -struct nbdkit_extents; extern int nbdkit_add_extent (struct nbdkit_extents *, uint64_t offset, uint64_t length, uint32_t type); +#else +static void nbdkit_error (const char *msg, ...) + ATTRIBUTE_FORMAT_PRINTF (1, 2); +static void nbdkit_error (const char...
2020 Mar 04
0
[PATCH nbdkit 1/4] tests: Rename test-shutdown.sh to test-delay-shutdown.sh.
This is testing the delay filter, and we want to use the name ‘test-shutdown’ in a later commit to test the new nbdkit_shutdown() API, so let’s rename it. --- tests/Makefile.am | 4 ++-- tests/{test-shutdown.sh => test-delay-shutdown.sh} | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index effe1857..2dc35309 100644 --- a/tes...
2020 Mar 23
6
[PATCH nbdkit 0/3] msys2 support for review
I pushed a few of the msys2 patches upstream. I changed the way that $(SHARED_LDFLAGS) works so it's more to my liking, and the others were pushed unchanged. Three patches remain which I'm posting on the mailing list for proper review. Rich.
2020 Aug 25
0
[nbdkit PATCH 3/5] api: Add nbdkit_string_intern helper
...100644 --- a/include/nbdkit-common.h +++ b/include/nbdkit-common.h @@ -120,6 +120,8 @@ NBDKIT_EXTERN_DECL (int, nbdkit_nanosleep, (unsigned sec, unsigned nsec)); NBDKIT_EXTERN_DECL (int, nbdkit_peer_name, (struct sockaddr *addr, socklen_t *addrlen)); NBDKIT_EXTERN_DECL (void, nbdkit_shutdown, (void)); +NBDKIT_EXTERN_DECL (const char *, nbdkit_string_intern, + (const char *str)); struct nbdkit_extents; NBDKIT_EXTERN_DECL (int, nbdkit_add_extent, diff --git a/server/internal.h b/server/internal.h index 8c8448e6..9993d92a 100644 --- a/server/internal.h +++ b/server/i...
2020 Aug 27
0
[nbdkit PATCH v2 4/8] api: Add nbdkit_str[n]dup_intern helper
...00644 --- a/include/nbdkit-common.h +++ b/include/nbdkit-common.h @@ -120,6 +120,10 @@ NBDKIT_EXTERN_DECL (int, nbdkit_nanosleep, (unsigned sec, unsigned nsec)); NBDKIT_EXTERN_DECL (int, nbdkit_peer_name, (struct sockaddr *addr, socklen_t *addrlen)); NBDKIT_EXTERN_DECL (void, nbdkit_shutdown, (void)); +NBDKIT_EXTERN_DECL (const char *, nbdkit_strdup_intern, + (const char *str)); +NBDKIT_EXTERN_DECL (const char *, nbdkit_strndup_intern, + (const char *str, size_t n)); struct nbdkit_extents; NBDKIT_EXTERN_DECL (int, nbdkit_add_extent, diff --git a...
2020 Mar 25
0
Re: nbdkit / mingw support
...xtents). > > > >Unfortunately some functions depend themselves on internals > >of the server: > > > > * nbdkit_nanosleep, nbdkit_export_name, nbdkit_peer_name call > > threadlocal_get_conn > > * nbdkit_set_error calls threadlocal_set_error > > * nbdkit_shutdown must set the quit global (or call a server function) > > Yeah, there's some awkward dependencies to figure out. It's obvious > the library has to export public nbdkit_* interfaces for the sake of > plugins, but can it also export one additional symbol _nbdkit_init() > for in...
2020 Mar 23
0
[PATCH nbdkit 2/3] server: Inject API functions for Windows
..._t = nbdkit_parse_uint64_t; + functions->read_password = nbdkit_read_password; + functions->realpath = nbdkit_realpath; + functions->nanosleep = nbdkit_nanosleep; + functions->export_name = nbdkit_export_name; + functions->peer_name = dummy_peer_name; + functions->shutdown = nbdkit_shutdown; + functions->add_extent = nbdkit_add_extent; + functions->extents_new = nbdkit_extents_new; + functions->extents_free = nbdkit_extents_free; + functions->extents_count = nbdkit_extents_count; + functions->get_extent = nbdkit_get_extent; +} +#endif + int main (int argc, char *...
2020 Mar 26
9
[PATCH nbdkit 5/9 patch split 1/5] Create libnbdkit.so.
This is the previous 5/9 patch posted earlier today, split into reviewable chunks. This passes bisection with -x 'make && make check', but I didn't work very hard on the commit messages, so I refer you back to the original patch to explain how it works: https://www.redhat.com/archives/libguestfs/2020-March/msg00248.html Rich.
2020 Oct 03
0
[PATCH nbdkit v2 1/3] server: Add new APIs for reading the client’s SO_PEERCRED.
...ec)); NBDKIT_EXTERN_DECL (int, nbdkit_peer_name, (struct sockaddr *addr, socklen_t *addrlen)); +NBDKIT_EXTERN_DECL (int, nbdkit_peer_pid, (void)); +NBDKIT_EXTERN_DECL (int, nbdkit_peer_uid, (void)); +NBDKIT_EXTERN_DECL (int, nbdkit_peer_gid, (void)); NBDKIT_EXTERN_DECL (void, nbdkit_shutdown, (void)); NBDKIT_EXTERN_DECL (const char *, nbdkit_strdup_intern, diff --git a/server/nbdkit.syms b/server/nbdkit.syms index 1eb18bb0..3d6b2235 100644 --- a/server/nbdkit.syms +++ b/server/nbdkit.syms @@ -67,7 +67,10 @@ nbdkit_parse_uint32_t; nbdkit_parse_uint64_t; nbdkit_parse_un...
2020 Apr 14
0
[nbdkit PATCH v2 1/3] server: Add nbdkit_stdio_safe
...*nbdkit_realpath (const char *path); extern int nbdkit_nanosleep (unsigned sec, unsigned nsec); diff --git a/server/nbdkit.syms b/server/nbdkit.syms index 111223f2..20c390a9 100644 --- a/server/nbdkit.syms +++ b/server/nbdkit.syms @@ -65,6 +65,7 @@ nbdkit_realpath; nbdkit_set_error; nbdkit_shutdown; + nbdkit_stdio_safe; nbdkit_vdebug; nbdkit_verror; diff --git a/server/public.c b/server/public.c index 3fd11253..4bb1f2e0 100644 --- a/server/public.c +++ b/server/public.c @@ -1,5 +1,5 @@ /* nbdkit - * Copyright (C) 2013-2019 Red Hat Inc. + * Copyright (C) 2013-2020 Red Hat Inc....
2020 Apr 04
0
[nbdkit PATCH 1/2] server: Add nbdkit_stdio_safe
...be used in this combination\n", program_name); exit (EXIT_FAILURE); } diff --git a/server/nbdkit.syms b/server/nbdkit.syms index 111223f2..20c390a9 100644 --- a/server/nbdkit.syms +++ b/server/nbdkit.syms @@ -65,6 +65,7 @@ nbdkit_realpath; nbdkit_set_error; nbdkit_shutdown; + nbdkit_stdio_safe; nbdkit_vdebug; nbdkit_verror; diff --git a/server/public.c b/server/public.c index 3fd11253..f19791bc 100644 --- a/server/public.c +++ b/server/public.c @@ -1,5 +1,5 @@ /* nbdkit - * Copyright (C) 2013-2019 Red Hat Inc. + * Copyright (C) 2013-2020 Red Hat Inc....