search for: debug_funct

Displaying 20 results from an estimated 31 matches for "debug_funct".

2019 Oct 11
3
[PATCH NOT WORKING nbdkit v2 0/2] vddk: Restructure plugin to allow greater parallelism.
This is my second attempt at this. The first version (also not working) was here: https://www.redhat.com/archives/libguestfs/2019-October/msg00062.html In part 1/2 I introduce a new .ready_to_serve plugin method which is called after forking and just before accepting any client connection. The idea would be that plugins could start background threads here. However this doesn't work well in
2019 Oct 11
0
[PATCH NOT WORKING nbdkit v2 1/2] server: Add .ready_to_serve plugin method.
...est-layers-filter.c @@ -65,7 +65,7 @@ test_layers_filter_config (nbdkit_next_config *next, void *nxdata, static int test_layers_filter_config_complete (nbdkit_next_config_complete *next, - void *nxdata) + void *nxdata) { DEBUG_FUNCTION; return next (nxdata); @@ -74,6 +74,14 @@ test_layers_filter_config_complete (nbdkit_next_config_complete *next, #define test_layers_filter_config_help \ "test_layers_" layer "_config_help" +static int +test_layers_filter_ready_to_serve (nbdkit_next_ready_to...
2019 Oct 03
0
[nbdkit PATCH 4/4] server: Better documentation of .open ordering
...== -1) diff --git a/tests/test-layers-filter.c b/tests/test-layers-filter.c index cccfb654..d590cf95 100644 --- a/tests/test-layers-filter.c +++ b/tests/test-layers-filter.c @@ -79,11 +79,12 @@ test_layers_filter_open (nbdkit_next_open *next, void *nxdata, int readonly) { static int handle; - DEBUG_FUNCTION; - if (next (nxdata, readonly) == -1) return NULL; + /* Debug after recursing, to show opposite order from .close */ + DEBUG_FUNCTION; + return &handle; } diff --git a/tests/test-layers.c b/tests/test-layers.c index 93b7770c..eac7f152 100644 --- a/tests/test-layers.c +++ b/te...
2019 Oct 10
1
[PATCH NOT WORKING nbdkit] vddk: Restructure plugin to allow greater parallelism.
We had a query yesterday about the VDDK plugin and making it actually obey the weird "Multithreading Considerations" rules in the VDDK documentation (https://vdc-download.vmware.com/vmwb-repository/dcr-public/8f96698a-0e7b-4d67-bb6c-d18a1d101540/ef536a47-27cd-481a-90ef-76b38e75353c/vsphere-vddk-671-programming-guide.pdf) This patch is my attempt to implement this. The idea is that the
2019 Jan 04
0
[PATCH nbdkit 1/7] server: Implement NBD_FLAG_CAN_MULTI_CONN.
...s_filter_can_fua (struct nbdkit_next_ops *next_ops, void *nxdata, return next_ops->can_fua (nxdata); } +static int +test_layers_filter_can_multi_conn (struct nbdkit_next_ops *next_ops, + void *nxdata, + void *handle) +{ + DEBUG_FUNCTION; + return next_ops->can_multi_conn (nxdata); +} + static int test_layers_filter_pread (struct nbdkit_next_ops *next_ops, void *nxdata, void *handle, void *buf, @@ -233,6 +242,7 @@ static struct nbdkit_filter filter = { .can_trim = test_layers_filter_...
2020 Aug 07
0
[nbdkit PATCH 2/3] server: Expose final thread_model to filter's .get_ready
...ts/test-layers-filter.c @@ -84,7 +84,7 @@ test_layers_filter_config_complete (nbdkit_next_config_complete *next, static int test_layers_filter_get_ready (nbdkit_next_get_ready *next, - void *nxdata) + void *nxdata, int thread_model) { DEBUG_FUNCTION; return next (nxdata); -- 2.28.0
2020 Feb 22
2
Re: Plans for nbdkit 1.18 release?
Eric: Did you want to take this one any further? It might be one that we save for > 1.18: https://www.redhat.com/archives/libguestfs/2020-February/thread.html#00206 Another thing I've been thinking about for some time is splitting .config_complete into .config_complete + .get_ready (new name TBD). At the moment .config_complete is both the place where we finish processing config, and
2020 May 07
1
[PATCH nbdkit] vddk: Suppress errors in can_extents test (RHBZ#1709211).
...if (init_called) { + DEBUG_CALL ("VixDiskLib_Exit", ""); + VixDiskLib_Exit (); + } + if (dl) + dlclose (dl); + free (config); + free (libdir); + free (password); + pthread_key_delete (error_suppression); +} + static void trim (char *str) { @@ -133,12 +164,37 @@ debug_function (const char *fs, va_list args) nbdkit_debug ("%s", str); } +/* If the thread-local error_suppression pointer is non-NULL (we don't + * care about the actual value) then we will suppress error messages + * from VDDK in this thread. + */ +static void +set_error_suppression (voi...
2020 Feb 22
1
Re: Plans for nbdkit 1.18 release?
...ayers_filter_config_complete (nbdkit_next_config_complete *next, #define test_layers_filter_config_help \ "test_layers_" layer "_config_help" +static int +test_layers_filter_get_ready (nbdkit_next_get_ready *next, + void *nxdata) +{ + DEBUG_FUNCTION; + return next (nxdata); +} + static int test_layers_filter_preconnect (nbdkit_next_preconnect *next, void *nxdata, int readonly) @@ -349,6 +357,7 @@ static struct nbdkit_filter filter = { .config = test_layers_filter_config, .config_complete...
2019 Oct 03
7
[nbdkit PATCH 0/4] More work with retry safety
I'm still working on another set of patches to have reopen call .finalize/.prepare (so that another filter can safely appear between retry and the plugin), but for tonight, these are the patches I think are ready to go. Eric Blake (4): retry: Handle can_fua and can_fast_zero changes tests: Test retry with different fua/fast-zero flags server: Close backends if a filter's .open fails
2020 Apr 04
0
[nbdkit PATCH 2/2] server: Sanitize stdin/out before running plugin code
...stdlib.h> #include <stdint.h> #include <string.h> +#include <unistd.h> #define NBDKIT_API_VERSION 2 #include <nbdkit-plugin.h> @@ -75,7 +76,16 @@ test_layers_plugin_config_complete (void) static int test_layers_plugin_get_ready (void) { + char c = 'X'; DEBUG_FUNCTION; + + /* Test that stdin/stdout have been sanitized */ + if (write (STDOUT_FILENO, &c, 1) != 1 || + read (STDIN_FILENO, &c, 1) != 0) { + nbdkit_error ("unusual stdio behavior"); + return -1; + } + return 0; } diff --git a/tests/test-layers.c b/tests/test-layer...
2020 Aug 25
0
[nbdkit PATCH 1/5] api: Add .default_export
...lter_list_exports (nbdkit_next_list_exports *next, void *nxdata, return next (nxdata, readonly, default_only, exports); } +static const char * +test_layers_filter_default_export (nbdkit_next_default_export *next, + void *nxdata, int readonly, int is_tls) +{ + DEBUG_FUNCTION; + return next (nxdata, readonly); +} + static void * test_layers_filter_open (nbdkit_next_open *next, void *nxdata, int readonly, const char *exportname, int is_tls) @@ -380,6 +388,7 @@ static struct nbdkit_filter filter = { .after_fork = test_layers_filte...
2019 May 10
11
[nbdkit PATCH 0/9] RFC: implement NBD_CMD_CACHE
I'm still working my way through the filters before this series will be complete, but this is enough of a start to at least get some feedback on the idea of implementing another NBD protocol extension. Eric Blake (9): server: Internal hooks for implementing NBD_CMD_CACHE plugins: Add .cache callback file, split: Implement .cache with posix_fadvise nbd: Implement NBD_CMD_CACHE
2020 Feb 25
6
[PATCH nbdkit 0/5] server: Add .get_ready callback.
I like this change. I think we were overloading the config_complete method before to do two different things (complete configuration; do any allocation/housekeeping necessary before we can start serving). The only questions in my mind are whether we want this before 1.18, and whether the name ("get_ready") is a good one. Rich.
2020 Aug 10
2
Re: [nbdkit PATCH 2/3] server: Expose final thread_model to filter's .get_ready
...4,7 @@ test_layers_filter_config_complete (nbdkit_next_config_complete *next, > > static int > test_layers_filter_get_ready (nbdkit_next_get_ready *next, > - void *nxdata) > + void *nxdata, int thread_model) > { > DEBUG_FUNCTION; > return next (nxdata); > -- > 2.28.0 > > _______________________________________________ > Libguestfs mailing list > Libguestfs@redhat.com > https://www.redhat.com/mailman/listinfo/libguestfs -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.co...
2020 Feb 18
0
[nbdkit PATCH v7 2/2] vddk: Drive library loading from libdir parameter.
...debug_fn, &error_fn, &error_fn, %s, %s", VDDK_MAJOR, VDDK_MINOR, - libdir ? : VDDK_LIBDIR, config ? : "NULL"); + libdir, config ? : "NULL"); err = VixDiskLib_InitEx (VDDK_MAJOR, VDDK_MINOR, &debug_function, /* log function */ &error_function, /* warn function */ &error_function, /* panic function */ - libdir ? : VDDK_LIBDIR, config); + libdir, config); if (err != VIX_OK) { VD...
2020 Apr 04
6
[nbdkit PATCH 0/2] stdin/out cleanups
This is what I've been playing with in response to my earlier question about what to do with 'nbdkit -s sh -' (https://www.redhat.com/archives/libguestfs/2020-April/msg00032.html) I'm still open to ideas on a better name, and/or whether adding <stdbool.h> to our public include files is a good idea (if not, returning int instead of bool is tolerable). Eric Blake (2):
2019 Jan 04
10
[PATCH nbdkit 0/7] server: Implement NBD_FLAG_CAN_MULTI_CONN.
First thing to say is that I need to do a *lot* more testing on this, so this is just an early peek. In particular, although it passed ‘make check && make check-valgrind’ I have *not* tested it against a multi-conn-aware client such as the Linux kernel >= 4.9. This implements NBD_FLAG_CAN_MULTI_CONN, described in the protocol doc as: "NBD_FLAG_CAN_MULTI_CONN: Indicates that
2019 Oct 11
2
Re: [PATCH NOT WORKING nbdkit v2 1/2] server: Add .ready_to_serve plugin method.
...st_layers_filter_config (nbdkit_next_config *next, void *nxdata, > > static int > test_layers_filter_config_complete (nbdkit_next_config_complete *next, > - void *nxdata) > + void *nxdata) > { > DEBUG_FUNCTION; > return next (nxdata); > @@ -74,6 +74,14 @@ test_layers_filter_config_complete (nbdkit_next_config_complete *next, > #define test_layers_filter_config_help \ > "test_layers_" layer "_config_help" > > +static int > +test_layers_filt...
2019 Jan 05
15
[PATCH nbdkit v2 01/11] server: Implement NBD_FLAG_CAN_MULTI_CONN.
For existing commits, this is almost identical to v1, except that I updated some commit messages and reordered the commits in a somewhat more logical sequence. The main changes are the extra commits: [06/11] plugins: Return NBD_FLAG_CAN_MULTI_CONN from some readonly plugins. - Readonly plugins that can set the flag unconditionally. [09/11] partitioning: Return NBD_FLAG_CAN_MULTI_CONN. [10/11]