Displaying 20 results from an estimated 26 matches for "filter_regist".
Did you mean:
filter_register
2019 Aug 30
0
[nbdkit PATCH 1/9] server: Fewer dereferences in filter
...lags, err);
else
- return f->backend.next->cache (f->backend.next, conn,
- count, offset, flags, err);
+ return b->next->cache (b->next, conn, count, offset, flags, err);
}
static struct backend filter_functions = {
@@ -858,7 +846,7 @@ filter_register (struct backend *next, size_t index, const char *filename,
if (f->filename == NULL) goto out_of_memory;
f->dl = dl;
- debug ("registering filter %s", f->filename);
+ debug ("registering filter %s", filename);
/* Call the initialization function which retu...
2019 Aug 27
3
[nbdkit PATCH 0/2] RFC: tighter filter versions
This is not intended for v1.14. In fact, we may decide that the
second patch is too gross, although the first one still seems like a
useful improvement in isolation.
I will also point out that all our filters are in-tree, and set the
user-controlled field .version to the current release string. We
could replace the second patch with a simpler one that just checks
._api_version as an int (as
2019 Aug 30
0
[nbdkit PATCH 2/9] server: Consolidate common backend tasks into new backend.c
...@@ filter_cache (struct backend *b, struct connection *conn,
static struct backend filter_functions = {
.free = filter_free,
.thread_model = filter_thread_model,
- .name = filter_name,
.plugin_name = plugin_name,
.usage = filter_usage,
.version = filter_version,
@@ -826,7 +799,6 @@ filter_register (struct backend *next, size_t index, const char *filename,
{
struct backend_filter *f;
const struct nbdkit_filter *filter;
- size_t i, len;
union overlay {
const char *str;
unsigned int api;
@@ -834,19 +806,12 @@ filter_register (struct backend *next, size_t index, const char...
2018 Jan 17
0
[PATCH 7/9] Implement filters.
...te,
+ .can_flush = filter_can_flush,
+ .is_rotational = filter_is_rotational,
+ .can_trim = filter_can_trim,
+ .pread = filter_pread,
+ .pwrite = filter_pwrite,
+ .flush = filter_flush,
+ .trim = filter_trim,
+ .zero = filter_zero,
+};
+
+/* Register and load a filter. */
+struct backend *
+filter_register (struct backend *next, size_t index, const char *filename,
+ void *dl, struct nbdkit_filter *(*filter_init) (void))
+{
+ struct backend_filter *f;
+ const struct nbdkit_filter *filter;
+ size_t i, len, size;
+
+ f = calloc (1, sizeof *f);
+ if (f == NULL) {
+ out_of_memory:...
2019 Jan 02
0
[PATCH nbdkit v2 1/2] Annotate internal function parameters with attribute((nonnull)).
...nst char *filename,
+ void *dl, struct nbdkit_plugin *(*plugin_init) (void))
+ __attribute__((__nonnull__ (2, 3, 4)));
+extern void set_debug_flags (void *dl, const char *name)
+ __attribute__((__nonnull__ (1, 2)));
/* filters.c */
-extern struct backend *filter_register (struct backend *next, size_t index, const char *filename, void *dl, struct nbdkit_filter *(*filter_init) (void));
+extern struct backend *filter_register (struct backend *next, size_t index,
+ const char *filename, void *dl,
+...
2018 Aug 01
0
[PATCH v2 nbdkit 3/6] filters: Print filter name in debugging messages.
...- count, offset, flags);
+ debug ("%s: zero count=%" PRIu32 " offset=%" PRIu64 " flags=0x%" PRIx32,
+ f->name, count, offset, flags);
if (f->filter.zero)
return f->filter.zero (&next_ops, &nxdata, handle,
@@ -719,7 +719,7 @@ filter_register (struct backend *next, size_t index, const char *filename,
debug ("registered filter %s (name %s)", f->filename, f->name);
/* Call the on-load callback if it exists. */
- debug ("%s: load", f->filename);
+ debug ("%s: load", f->name);
if (f-&...
2020 Mar 26
0
[PATCH nbdkit 5/9 patch split 5/5] server: Indirect slow path, non-self-contained functions through the server.
...tern struct backend *plugin_register (size_t index, const char *filename,
void *dl, struct nbdkit_plugin *(*plugin_init) (void))
__attribute__((__nonnull__ (2, 3, 4)));
+extern void do_nbdkit_set_error (int err);
/* filters.c */
extern struct backend *filter_register (struct backend *next, size_t index,
@@ -515,6 +517,11 @@ extern void *threadlocal_buffer (size_t size);
extern void threadlocal_set_conn (struct connection *conn);
extern struct connection *threadlocal_get_conn (void);
+/* public.c */
+extern int do_nbdkit_nanosleep (unsigned sec, unsigned n...
2019 Jan 02
4
[PATCH nbdkit v2 0/2] Use of attribute(()).
v1 was here:
https://www.redhat.com/archives/libguestfs/2019-January/msg00008.html
In v2 I have provided two patches:
The first patch extends attribute((nonnull)) to most internal
functions, but not to the external API.
The second patch uses a macro so that attribute((format)) is only used
in the public API on GCC or Clang. At least in theory these headers
could be used by a C compiler which
2018 Jan 24
0
[nbdkit PATCH 2/3] filter: Add .can_zero/.can_fua overrides
...*buf, uint32_t count, uint64_t offset,
@@ -582,6 +628,8 @@ static struct backend filter_functions = {
.flush = filter_flush,
.trim = filter_trim,
.zero = filter_zero,
+ .can_zero = filter_can_zero,
+ .can_fua = filter_can_fua,
};
/* Register and load a filter. */
@@ -626,15 +674,23 @@ filter_register (struct backend *next, size_t index, const char *filename,
exit (EXIT_FAILURE);
}
- /* Since the filter might be much older than the current version of
- * nbdkit, only copy up to the self-declared _struct_size of the
- * filter and zero out the rest. If the filter is much newer th...
2019 Aug 30
15
[nbdkit PATCH 0/9] can_FOO caching, more filter validation
It's easy to use the sh script to demonstrate that nbdkit is
inefficiently calling into .get_size, .can_fua, and friends more than
necessary. We've also commented on the list in the past that it would
be nice to ensure that when filters call into next_ops, they are not
violating constraints (as we've have to fix several bugs in the past
where we did not have such checking to protect
2018 Jan 19
0
[PATCH nbdkit filters-v2 2/5] Introduce filters.
...te,
+ .can_flush = filter_can_flush,
+ .is_rotational = filter_is_rotational,
+ .can_trim = filter_can_trim,
+ .pread = filter_pread,
+ .pwrite = filter_pwrite,
+ .flush = filter_flush,
+ .trim = filter_trim,
+ .zero = filter_zero,
+};
+
+/* Register and load a filter. */
+struct backend *
+filter_register (struct backend *next, size_t index, const char *filename,
+ void *dl, struct nbdkit_filter *(*filter_init) (void))
+{
+ struct backend_filter *f;
+ const struct nbdkit_filter *filter;
+ size_t i, len, size;
+
+ f = calloc (1, sizeof *f);
+ if (f == NULL) {
+ out_of_memory:...
2018 Jan 19
0
[PATCH nbdkit filters-v3 3/7] Introduce filters.
...te,
+ .can_flush = filter_can_flush,
+ .is_rotational = filter_is_rotational,
+ .can_trim = filter_can_trim,
+ .pread = filter_pread,
+ .pwrite = filter_pwrite,
+ .flush = filter_flush,
+ .trim = filter_trim,
+ .zero = filter_zero,
+};
+
+/* Register and load a filter. */
+struct backend *
+filter_register (struct backend *next, size_t index, const char *filename,
+ void *dl, struct nbdkit_filter *(*filter_init) (void))
+{
+ struct backend_filter *f;
+ const struct nbdkit_filter *filter;
+ size_t i, len, size;
+
+ f = calloc (1, sizeof *f);
+ if (f == NULL) {
+ out_of_memory:...
2018 Jan 24
8
[nbdkit PATCH 0/3] Add nozero filter
I still need to add testsuite coverage. Perhaps it might be easier
if I create a new '--filter=log logfile=foo' filter that produces
a log of which commands a client sent, then compare the log using
a known client that uses write_zeroes (qemu-io works well) both
with and without --filter=nozero to prove that the change in
advertisement changes the commands sent over the wire (that would
2019 Aug 30
1
[nbdkit PATCH v2] filters: Stronger version match requirements
...16f 100644
--- a/server/filters.c
+++ b/server/filters.c
@@ -102,7 +102,7 @@ filter_version (struct backend *b)
{
struct backend_filter *f = container_of (b, struct backend_filter, backend);
- return f->filter.version;
+ return f->filter._version;
}
static void
@@ -730,14 +730,24 @@ filter_register (struct backend *next, size_t index, const char *filename,
}
/* We do not provide API or ABI guarantees for filters, other than
- * the ABI position of _api_version that will let us diagnose
- * mismatch when the API changes.
+ * the ABI position and API contents of _api_version and...
2019 Nov 04
3
[PATCH nbdkit v2 0/2] Implement fuzzing using Clang's libFuzzer.
v1 was here:
https://www.redhat.com/archives/libguestfs/2019-November/msg00003.html
This version depends on:
https://www.redhat.com/archives/libguestfs/2019-November/msg00004.html
and this series:
https://www.redhat.com/archives/libguestfs/2019-November/msg00009.html
The delta has been reduced slightly because of changes made possible
by cleaning up and fixing the quit path in nbdkit. It's
2019 Nov 02
2
[PATCH nbdkit 0/2] Implement fuzzing using Clang's libFuzzer.
libFuzzer is Clang's fuzzer, and alternative to using AFL:
https://llvm.org/docs/LibFuzzer.html
I implemented an alternative method of fuzzing for libnbd earlier
today and it's pretty simple:
https://github.com/libguestfs/libnbd/commit/c19a6fbae9a21a7d4693418706c59e81ed256875
However it's considerably more difficult to use libFuzzer with
non-library code -- in this case nbdkit.
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 Mar 19
5
[nbdkit PATCH 0/2] More caching of initial setup
When I added .can_FOO caching in 1.16, I missed the case that the sh
plugin itself was calling .can_flush twice in some situations (in
order to default .can_fua). Then right after, I regressed it to call
.can_zero twice (in order to default .can_fast_zero). I also missed
that .thread_model could use better caching, because at the time, I
did not add testsuite coverage. Fix that now.
Eric Blake
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
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