search for: shutdown_pwrit

Displaying 2 results from an estimated 2 matches for "shutdown_pwrit".

Did you mean: shutdown_pwrite
2020 Mar 04
0
[PATCH nbdkit 2/4] server: Add nbdkit_shutdown() call.
...dle) +{ + return INT64_C (1024*1024); +} + +#define THREAD_MODEL NBDKIT_THREAD_MODEL_PARALLEL + +static int +shutdown_pread (void *handle, void *buf, uint32_t count, uint64_t offset) +{ + memset (buf, 0, count); + return 0; +} + +/* Writing 0x55 to any location causes a shutdown. */ +static int +shutdown_pwrite (void *handle, const void *buf, uint32_t count, uint64_t offset) +{ + if (memchr (buf, 0x55, count) != NULL) { + nbdkit_debug ("shutdown triggered!"); + nbdkit_shutdown (); + } + return 0; +} + +static struct nbdkit_plugin plugin = { + .name = "shutdown",...
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.