search for: shutdown_get_size

Displaying 3 results from an estimated 3 matches for "shutdown_get_size".

2020 Mar 04
0
[PATCH nbdkit 2/4] server: Add nbdkit_shutdown() call.
...tdio.h> +#include <stdlib.h> +#include <string.h> + +#include <nbdkit-plugin.h> + +static void +shutdown_unload (void) +{ + nbdkit_debug ("clean shutdown"); +} + +static void * +shutdown_open (int readonly) +{ + return NBDKIT_HANDLE_NOT_NEEDED; +} + +static int64_t +shutdown_get_size (void *handle) +{ + 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. */ +s...
2020 Mar 06
1
Re: [PATCH nbdkit 2/4] server: Add nbdkit_shutdown() call.
...fine, nbdkit should still be running afterwards. > +for i in 1 2 3; do > + qemu-img info "nbd:unix:$sock" qemu-img should support nbd+unix:///?socket=$sock URIs; any reason we aren't using them here? > +++ b/tests/test-shutdown-plugin.c > + > +static int64_t > +shutdown_get_size (void *handle) > +{ > + return INT64_C (1024*1024); This looks fishy. POSIX says that: https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/stdint.h.html#tag_13_48 "The argument in any instance of these macros shall be an unsuffixed integer constant with a value that does not ex...
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.