Re: [Libguestfs] [nbdkit PATCH 0/3] Add nozero filter

Richard W.M. Jones
2018-01-24T14:18:45Z

On Tue, Jan 23, 2018 at 10:10:12PM -0600, Eric Blake
wrote:
> 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
> also test the log filter at the same time...).
>
> I'll wait for a review on this series, particularly since patch 2
> intentionally breaks filter ABI (more ABI/API breaks on the way
> when I resubmit my FUA work; it would be nice to make all the API
> breaks before v1.1.29, rather than releasing versions while things
> are still in flux).
>
> Note that even if we try hard to let newer nbdkit load an older
> filter (which I did not do here), we absolutely cannot let older
> nbdkit load a newer filter - while we have sizing limits to
> guarantee we don't call beyond the end of an older filter's
> smaller struct, there are no sizing limits in the other
> direction to prevent a newer filter to know that it cannot call
> beyond the end of our smaller nbdkit_next_ops.

Hmm, yes, this is a good point that I didn't think about.

Probably we're going to have to forget about the filter._api_version
and filter._struct_size fields and instead encode the version of
nbdkit it was compiled against and check that rigorously.  It seems
like maintaining a filter ABI is hopeless.

Rich.

> Eric Blake (3):
>   connections: Don't advertise TRIM on readonly connection
>   filter: Add .can_zero/.can_fua overrides
>   filters: Add nozero filter
>
>  TODO                                    |  2 +-
>  configure.ac                            |  3 +-
>  docs/nbdkit-filter.pod                  | 30 +++++++++++-
>  docs/nbdkit.pod                         |  1 +
>  filters/Makefile.am                     |  1 +
>  filters/nozero/Makefile.am              | 62 ++++++++++++++++++++++++
>  filters/nozero/nbdkit-nozero-filter.pod | 84
+++++++++++++++++++++++++++++++++
>  filters/nozero/nozero.c                 | 68 ++++++++++++++++++++++++++
>  include/nbdkit-filter.h                 |  8 +++-
>  src/connections.c                       | 45 +++++++++++++-----
>  src/filters.c                           | 70 ++++++++++++++++++++++++---
>  src/internal.h                          |  2 +
>  src/plugins.c                           | 22 +++++++++
>  13 files changed, 376 insertions(+), 22 deletions(-)
>  create mode 100644 filters/nozero/Makefile.am
>  create mode 100644 filters/nozero/nbdkit-nozero-filter.pod
>  create mode 100644 filters/nozero/nozero.c
>
> --
> 2.14.3
>
> _______________________________________________
> Libguestfs mailing list
> Libguestfs@redhat.com
> https://www.redhat.com/mailman/listinfo/libguestfs

--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
libguestfs lets you edit virtual machines.  Supports shell scripting,
bindings from many languages.  http://libguestfs.org