[Libguestfs] [PATCH libnbd] python: Add AIO buffer is_zero method.

Richard W.M. Jones rjones at redhat.com
Thu Jan 30 14:29:21 UTC 2020


On Thu, Jan 30, 2020 at 08:16:30AM -0600, Eric Blake wrote:
> On 1/30/20 8:05 AM, Richard W.M. Jones wrote:
> >Fast testing whether the AIO buffer (or regions within it) contain all
> >zeroes, which allows Python code to quickly do sparsification when
> >copying.
> >
> >This includes the iszero.h header from nbdkit which is distributed
> >under a compatible license.
> >---
> >  common/include/Makefile.am  |  5 +--
> >  common/include/iszero.h     | 63 +++++++++++++++++++++++++++++++++++++
> >  generator/generator         | 17 ++++++++--
> >  python/Makefile.am          |  3 +-
> >  python/handle.c             | 47 +++++++++++++++++++++++++++
> >  python/t/580-aio-is-zero.py | 53 +++++++++++++++++++++++++++++++
> >  6 files changed, 183 insertions(+), 5 deletions(-)
> 
> ACK.
> 
> 
> >+++ b/common/include/Makefile.am
> >@@ -1,5 +1,5 @@
> >  # nbd client library in userspace
> >-# Copyright (C) 2013-2019 Red Hat Inc.
> >+# Copyright (C) 2013-2020 Red Hat Inc.
> 
> Unrelated question: we are just now making our first libnbd commits
> of 2020.  Should we have the 'nbdsh --version' output a copyright
> date?

I guess the first line of output must remain as it is now, but we
could add further lines if we wanted to.  Seems like GNU tools follow
some kind of standard where they print <name> <version> on the first
line, then copyright and license information on subsequent lines.

> And if so, should we automate the process to automatically update it
> to the current year, rather than remembering to touch files manually
> when making the first commit in a year?

Need to be careful about not breaking reproducible builds.  This was a
problem in the past with libguestfs where it would insert a copyright
year into certain output files based on the time of compilation.

https://github.com/libguestfs/libguestfs/commit/4d39faaa30eace5f52e92e344d3a62dcce52d71c

> Should we
> manually update the copyright date in ALL files in a single pass,
> rather than one-off edits as we make per-file changes (if so, the
> gnulib project has a nice script for automating a tree-wide
> copyright range update).

We could run the following command over all repository:

https://github.com/libguestfs/libguestfs/commit/05d4fcb64d98d4ff1d57560c566ca8e66b695277

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine.  Supports Linux and Windows.
http://people.redhat.com/~rjones/virt-df/




More information about the Libguestfs mailing list