search for: nbdkit_cxx_lang_c

Displaying 20 results from an estimated 26 matches for "nbdkit_cxx_lang_c".

2018 Jan 19
1
Re: [PATCH nbdkit filters-v2 2/5] Introduce filters.
...ned NBDKIT_FILTER_H #error this file should not be directly included #endif nbdkit-plugin.h: #ifdef NBDKIT_FILTER_H #error cannot mix filter and plugin in one code base #endif nbdkit-filter.h: #ifdef NBDKIT_PLUGIN_H #error cannot mix filter and plugin in one code base #endif > + > +#ifndef NBDKIT_CXX_LANG_C > +#ifdef __cplusplus > +#define NBDKIT_CXX_LANG_C extern "C" > +#else > +#define NBDKIT_CXX_LANG_C /* nothing */ > +#endif > +#endif and a common header would be a nicer place for things like NBDKIT_CXX_LANG_C, rather than having to repeat our #ifndef definitions in tw...
2017 Feb 20
1
Re: Fwd: nbdkit async
The concern is a client is blocked while processing a request. The nbdkit server design requires a thread per request being processed regardless of the number of connections or clients. We want to run 1000's of requests in parallel without needing a thread at nbdkit layer per request in flight. Our plugin layer is built around boost asio and a few threads in a worker pool running an io
2020 Mar 23
0
[PATCH nbdkit 1/3] include: Function indirection for PE DLL
...+ return _nbdkit_functions.get_extent(extents, size); +} +#endif /* Filter struct. */ struct nbdkit_filter { @@ -204,6 +224,24 @@ struct nbdkit_filter { int *err); }; +#if defined(WINDOWS_COMPAT) +#define NBDKIT_REGISTER_FILTER(filter) \ + NBDKIT_CXX_LANG_C __declspec(dllexport) \ + struct nbdkit_filter * \ + filter_init (void) \ + { \ + (filter)._api_v...
2018 Aug 07
1
nbdkit build broken
...ers_plugin_la-test-layers-plugin.Tpo -c test-layers-plugin.c -fPIC -DPIC -o .libs/test_layers_plugin_la-test-layers-plugin.o test-layers-plugin.c: In function ‘test_layers_plugin_can_fua’: test-layers-plugin.c:137:10: error: ‘NBDKIT_FUA_NATIVE’ undeclared (first use in this function); did you mean ‘NBDKIT_CXX_LANG_C’? return NBDKIT_FUA_NATIVE; ^~~~~~~~~~~~~~~~~ NBDKIT_CXX_LANG_C test-layers-plugin.c:137:10: note: each undeclared identifier is reported only once for each function it appears in test-layers-plugin.c: At top level: test-layers-plugin.c:197:4: error: ‘struct nbdkit_plugin’ ha...
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.
2017 Feb 01
0
[PATCH] Really fix C++ support in the <nbdkit-plugin.h> header file (RHBZ#1418328).
...ALIZE_ALL_REQUESTS 1 #define NBDKIT_THREAD_MODEL_SERIALIZE_REQUESTS 2 @@ -108,7 +108,14 @@ extern void nbdkit_vdebug (const char *msg, va_list args); extern char *nbdkit_absolute_path (const char *path); extern int64_t nbdkit_parse_size (const char *str); +#ifdef __cplusplus +#define NBDKIT_CXX_LANG_C extern "C" +#else +#define NBDKIT_CXX_LANG_C /* nothing */ +#endif + #define NBDKIT_REGISTER_PLUGIN(plugin) \ + NBDKIT_CXX_LANG_C \ struct nbdkit_plugin *...
2017 Feb 01
1
[PATCH nbdkit v2] Really fix C++ support in the <nbdkit-plugin.h>
This version uses Eric's subtype suggestion: https://bugzilla.redhat.com/show_bug.cgi?id=1418328#c6 Rich.
2017 Feb 01
1
[PATCH nbdkit v3] Really fix C++ support in the <nbdkit-plugin.h>
This version uses a static initializer function (https://bugzilla.redhat.com/show_bug.cgi?id=1418328#c9). Rich.
2018 Mar 08
0
[nbdkit PATCH v3 15/15] RFC: plugins: Add back-compat for new plugin with old nbdkit
...(*_unused2) (void *, const void *, uint32_t, uint64_t, uint32_t); int (*_unused3) (void *, uint32_t); @@ -125,6 +129,7 @@ struct nbdkit_plugin { extern void nbdkit_set_error (int err); +#if NBDKIT_PLUGIN_LEVEL == 1 #define NBDKIT_REGISTER_PLUGIN(plugin) \ NBDKIT_CXX_LANG_C \ struct nbdkit_plugin * \ @@ -136,6 +141,58 @@ extern void nbdkit_set_error (int err); return &(plugin); \ } +#else +#define NBDKIT_R...
2018 Jan 19
0
[PATCH nbdkit filters-v2 2/5] Introduce filters.
...void *handle); + int (*trim) (struct nbdkit_next_ops *next_ops, void *nxdata, + void *handle, uint32_t count, uint64_t offset); + int (*zero) (struct nbdkit_next_ops *next_ops, void *nxdata, + void *handle, uint32_t count, uint64_t offset, int may_trim); +}; + +#ifndef NBDKIT_CXX_LANG_C +#ifdef __cplusplus +#define NBDKIT_CXX_LANG_C extern "C" +#else +#define NBDKIT_CXX_LANG_C /* nothing */ +#endif +#endif + +#define NBDKIT_REGISTER_FILTER(filter) \ + NBDKIT_CXX_LANG_C \ + struct nbdki...
2018 Jan 16
2
[nbdkit] Proposed (new) filter API
...xdata, void *handle); int (*trim) (struct nbdkit_next *next, void *nxdata, void *handle, uint32_t count, uint64_t offset); int (*zero) (struct nbdkit_next *next, void *nxdata, void *handle, uint32_t count, uint64_t offset, int may_trim); }; #ifndef NBDKIT_CXX_LANG_C #ifdef __cplusplus #define NBDKIT_CXX_LANG_C extern "C" #else #define NBDKIT_CXX_LANG_C /* nothing */ #endif #endif #define NBDKIT_REGISTER_FILTER(filter) \ NBDKIT_CXX_LANG_C \ struct nbdkit_filter *...
2018 Jan 19
10
[PATCH nbdkit filters-v2 0/5] Introduce filters.
Rebased filters patch. Requires current git master + the locks / thread model fix (https://www.redhat.com/archives/libguestfs/2018-January/msg00128.html) So a few changes here since last time: The "introduce filters" and "implement filters" patches are squashed together. I introduced a concept of .prepare and .finalize. These run before and after the data serving phase
2018 Jan 14
10
[PATCH nbdkit INCOMPLETE 0/6] Introduce filters to nbdkit.
This patch isn't complete (patch 6/6 isn't finished) so it's just for discussion, although it does compile and run. This introduces to nbdkit a concept of "filters" which can be placed in front of plugins to modify their behaviour. Some examples where you might use filters: * Serve a subset of the data, such as (offset, range) or a single partition from a disk image.
2020 Aug 18
0
[PATCH nbdkit 8/9] include: Prefix all exports with NBDKIT_DLLEXPORT.
...name (void); -extern int nbdkit_is_tls (void); +extern NBDKIT_DLLEXPORT void nbdkit_set_error (int err); +extern NBDKIT_DLLEXPORT const char *nbdkit_export_name (void); +extern NBDKIT_DLLEXPORT int nbdkit_is_tls (void); #define NBDKIT_REGISTER_PLUGIN(plugin) \ NBDKIT_CXX_LANG_C \ diff --git a/server/main.c b/server/main.c index a96ac88b..f6ffd9b2 100644 --- a/server/main.c +++ b/server/main.c @@ -171,6 +171,8 @@ dump_config (void) #endif } +extern NBDKIT_DLLEXPORT int nbdkit_main (int argc, char *argv[]); + int nbd...
2018 Jan 17
14
[PATCH 0/9] Add filters to nbdkit.
The first three patches are identical to: https://www.redhat.com/archives/libguestfs/2018-January/msg00079.html "[PATCH nbdkit v2 0/3] Refactor plugin_* functions into a backend" The rest of the patches add filters using the new filter API previously described here: https://www.redhat.com/archives/libguestfs/2018-January/msg00073.html This needs a lot more testing -- and tests --
2018 Jan 19
9
[PATCH nbdkit filters-v3 0/7] Introduce filters.
This is still tentative and needs a lot of work, but: - partition filter works, supporting MBR & GPT - prepare and finalize methods fixed - open method can now be changed (allowing readonly flag to be modified) - thread_model can be limited I believe I made most of the changes which were previously suggested in email. I think the only one I didn't was preventing inclusion of both
2018 Jan 19
2
[nbdkit PATCH] Update filters to support FUA flags.
...void *handle, uint32_t count, uint64_t offset, uint32_t flags); int (*zero) (struct nbdkit_next_ops *next_ops, void *nxdata, - void *handle, uint32_t count, uint64_t offset, int may_trim); + void *handle, uint32_t count, uint64_t offset, uint32_t flags); }; #ifndef NBDKIT_CXX_LANG_C diff --git a/src/filters.c b/src/filters.c index 9a2022c..9768f20 100644 --- a/src/filters.c +++ b/src/filters.c @@ -280,43 +280,40 @@ next_can_trim (void *nxdata) } static int -next_pread (void *nxdata, void *buf, uint32_t count, uint64_t offset) +next_pread (void *nxdata, void *buf, uint32_t c...
2018 Jan 19
16
[nbdkit PATCH v2 00/13] Add filters + FUA support to nbdkit
A combination of the work that both Rich and I have been doing lately, where filters use only the new API with flags on every command that the client can send over the wire (we can then add support for more flags in nbdkit without having to add new callbacks, as NBD adds more flags upstream). Eric Blake (4): protocol: Split flags from cmd field in requests backend: Pass flags argument through
2018 Jan 16
9
[nbdkit PATCH 0/7] Initial implementation of FUA flag passthrough
Tested via: term1$ qemu-nbd -k $PWD/sock -t -f raw -x foo junk --trace=nbd_\* term2$ ./nbdkit -f -v -e bar nbd socket=$PWD/sock export=foo term3$ qemu-io -t none -f raw nbd://localhost:10809/bar --trace=nbd_\* and checking the traces to see that 'w 0 1' vs. 'w -f 0 1' was able to influence whether the FUA flag showed up at the server in term1. Still to go: figure out how to
2020 Aug 07
0
[nbdkit PATCH 1/3] server: Implement nbdkit_is_tls for use during .open
.../include/nbdkit-plugin.h +++ b/include/nbdkit-plugin.h @@ -146,6 +146,7 @@ struct nbdkit_plugin { extern void nbdkit_set_error (int err); extern const char *nbdkit_export_name (void); +extern int nbdkit_is_tls (void); #define NBDKIT_REGISTER_PLUGIN(plugin) \ NBDKIT_CXX_LANG_C \ diff --git a/server/internal.h b/server/internal.h index f84696ca..d043225a 100644 --- a/server/internal.h +++ b/server/internal.h @@ -367,7 +367,8 @@ struct backend { int (*preconnect) (struct backend *, int readonly); int (*list_exports)...