[Libguestfs] [nbdkit PATCH 3/5] plugins: Add callback for writing zeroes

2017-01-20 Thread Eric Blake
Similar to .trim, except that it guarantees that zeroes are read back, and also clients must obey the may_trim argument with regards to whether a hole may be used or whether the file must remain allocated with actual zeroes written. If the callback is not implemented, or if the callback fails with

[Libguestfs] [nbdkit PATCH 4/5] protocol: Implement NBD_CMD_WRITE_ZEROES

2017-01-20 Thread Eric Blake
We always advertise this to the client (for writable exports), even when the plugin does not have any optimized implementation, because it allows for more efficient network traffic. Signed-off-by: Eric Blake --- src/connections.c | 26 -- src/protocol.h| 17 ++

[Libguestfs] [nbdkit PATCH 5/5] file: Support punching holes for write zero

2017-01-20 Thread Eric Blake
On Linux, use fallocate() to punch holes as a more efficient way of writing zeroes. If hole punching is not allowed, or if we can't use fallocate (whether because this is not Linux, or because the file system on Linux doesn't support it), gracefully fall back to the write method. If wdelayms is s

[Libguestfs] [nbdkit PATCH 2/5] protocol: Validate request flags

2017-01-20 Thread Eric Blake
Reject rather than silently ignoring unknown client request flags. Signed-off-by: Eric Blake --- src/connections.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/connections.c b/src/connections.c index 16c6584..44b7530 100644 --- a/src/connections.c +++ b/src/con

[Libguestfs] [nbdkit PATCH 0/5] Add WRITE_ZEROES support

2017-01-20 Thread Eric Blake
The upstream protocol recently promoted NBD_CMD_WRITE_ZEROES from experimental to a documented extension. Exposing support for this allows plugin writers to create sparse files when driven by a client that knows how to use the extension; meanwhile, even if a plugin does not support this extension,

[Libguestfs] [nbdkit PATCH 1/5] protocol: Support NBD_FLAG_NO_ZEROES

2017-01-20 Thread Eric Blake
The upstream NBD protocol allows a reduction in the length of the handshake by both sides agreeing to skip the 124 bytes of padding in the final server reply. Signed-off-by: Eric Blake --- src/connections.c | 14 +++--- src/protocol.h| 1 + 2 files changed, 12 insertions(+), 3 delet

[Libguestfs] [PATCH] p2v: log also environment on conversion server

2017-01-20 Thread Pino Toscano
Save the content of the environment on the conversion server, so it is one additional help when debugging failed conversions. --- p2v/conversion.c | 5 + p2v/virt-p2v.pod | 6 ++ 2 files changed, 11 insertions(+) diff --git a/p2v/conversion.c b/p2v/conversion.c index 3c379cb..b8bab34 1006

[Libguestfs] [PATCH 5/5] fish: Move fishcommon library to common/options.

2017-01-20 Thread Richard W.M. Jones
This is mostly code motion but I had to remove the compile-time COMPILING_GUESTFISH and COMPILING_VIRT_RESCUE macros and replace them with runtime constants and checks. --- Makefile.am| 2 +- align/Makefile.am | 3 +- align/scan.c

[Libguestfs] [PATCH 3/5] Rename src/ to lib/

2017-01-20 Thread Richard W.M. Jones
--- .gitignore | 40 - Makefile.am | 2 +- align/Makefile.am| 4 +- builder/Makefile.am | 8 +- cat/Makefile.am | 20 ++--- cfg.mk

[Libguestfs] [PATCH 0/5] Rename src/ to lib/ and move common code to common/

2017-01-20 Thread Richard W.M. Jones
This patch series moves some files and directories around but is only code motion (or supposed to be). A new directory, common/, is created for all of the common code which is currently shared in random ways between parts of the project. And src/ becomes lib/ (the largest change, but mostly mechan

[Libguestfs] [PATCH 1/5] lib: Share common protocol and errnostring libraries with the library and daemon.

2017-01-20 Thread Richard W.M. Jones
This commit, which is just code motion, moves the common XDR protocol code (libprotocol) and the common errno handling (liberrnostring) into libraries which are each built once and shared between the library and daemon. --- .gitignore | 20 + Makefile.am

[Libguestfs] [PATCH 2/5] lib: Move utilities to new directory common/utils.

2017-01-20 Thread Richard W.M. Jones
Just code motion. This commit makes it clearer what is a utility and what is part of the library. It also makes it clear that we should rename: guestfs-internal-frontend.h -> utils.h guestfs-internal-frontend-cleanups.h -> cleanups.h (?) but this commit does not make that change. --- .giti

[Libguestfs] [PATCH 4/5] cat: Move visit library to new directory common/visit.

2017-01-20 Thread Richard W.M. Jones
Just code motion. --- Makefile.am | 3 +++ cat/Makefile.am | 6 +++--- common/visit/Makefile.am | 33 + {cat => common/visit}/visit.c | 0 {cat => common/visit}/visit.h | 0 configure.ac | 1 + diff/Makefile