Re: [Libguestfs] [RFC PATCH] protocol: Add NBD_CMD_FLAG_FAST_ZERO

2019-03-22 Thread Richard W.M. Jones
On Fri, Mar 22, 2019 at 12:17:59PM -0500, Eric Blake wrote: > On 3/22/19 11:42 AM, Eric Blake wrote: > > > > > Hence, it is desirable to have a way for clients to specify that a > > particular write zero request is being attempted for a fast wipe, and > > get an immediate failure if the zero requ

Re: [Libguestfs] [RFC PATCH] protocol: Add NBD_CMD_FLAG_FAST_ZERO

2019-03-22 Thread Eric Blake
On 3/22/19 2:42 PM, Nir Soffer wrote: >> Add a protocol flag and corresponding transmission advertisement flag >> to make it easier for clients to inform the server of their intent. If >> the server advertises NBD_FLAG_SEND_FAST_ZERO, then it promises two >> things: to perform a fallback to write

Re: [Libguestfs] [RFC PATCH] protocol: Add NBD_CMD_FLAG_FAST_ZERO

2019-03-22 Thread Nir Soffer
On Fri, Mar 22, 2019 at 6:43 PM Eric Blake wrote: > While it may be counterintuitive at first, the introduction of > NBD_CMD_WRITE_ZEROES and NBD_CMD_BLOCK_STATUS has caused a performance > regression in qemu [1], when copying a sparse file. When the > destination file must contain the same conte

Re: [Libguestfs] [RFC PATCH] protocol: Add NBD_CMD_FLAG_FAST_ZERO

2019-03-22 Thread Eric Blake
On 3/22/19 11:42 AM, Eric Blake wrote: > > Hence, it is desirable to have a way for clients to specify that a > particular write zero request is being attempted for a fast wipe, and > get an immediate failure if the zero request would otherwise take the > same time as a write. Conversely, if the

[Libguestfs] [RFC PATCH] protocol: Add NBD_CMD_FLAG_FAST_ZERO

2019-03-22 Thread Eric Blake
While it may be counterintuitive at first, the introduction of NBD_CMD_WRITE_ZEROES and NBD_CMD_BLOCK_STATUS has caused a performance regression in qemu [1], when copying a sparse file. When the destination file must contain the same contents as the source, but it is not known in advance whether th

[Libguestfs] [PATCH 0/4] OCaml tools: output messages as JSON machine

2019-03-22 Thread Pino Toscano
Enhance the output in machine parseable mode, by outputting all the messages of OCaml tools as JSON to the machine parseable stream. Related, although not strictly needed for this (and thus can be split if requested), is the addition of the fd format for the machine readable stream. Pino Toscano

[Libguestfs] [PATCH 3/4] common/mltools: allow fd for machine readable output

2019-03-22 Thread Pino Toscano
Allow to specify a file descriptor for the machine readable output. Sadly, the OCaml C glue for the channels is not public API, so enable the internals for this... --- common/mltools/tools_utils-c.c | 17 + common/mltools/tools_utils.ml | 10 +- lib/guestfs.pod

[Libguestfs] [PATCH 1/4] common/mltools: move the code for machine readable up

2019-03-22 Thread Pino Toscano
Move the code for handling machine readable up in the file, so it can be used by other functions. Only code motion, no behaviour changes. --- common/mltools/tools_utils.ml | 60 +-- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/common/mltools/tool

[Libguestfs] [PATCH 4/4] OCaml tools: output messages into JSON for machine readable

2019-03-22 Thread Pino Toscano
When the machine readable mode is enabled, print all the messages (progress, info, warning, and errors) also as JSON in the machine readable stream: this way, users can easily parse the status of the OCaml tool, and report that back. The formatting of the current date time into the RFC 3999 format

[Libguestfs] [PATCH 2/4] common/mltools: make sure machine readable output is flushed

2019-03-22 Thread Pino Toscano
Enhance the helper printf function for machine readable output to always flush after each string: this way, readers of the machine readable stream can get the output as soon as it is outputted. --- common/mltools/tools_utils.ml | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git

Re: [Libguestfs] [PATCH v2 2/3] v2v: allow alternative directories for distributions

2019-03-22 Thread Pino Toscano
On Thursday, 21 March 2019 10:52:54 CET Pino Toscano wrote: > > @@ -340,9 +354,9 @@ and copy_from_virtio_win g inspect srcdir destdir > > filter missing = > >g2#launch (); > >let vio_root = "/" in > >g2#mount_ro "/dev/sda" vio_root; > > - let srcdir = vio_root ^ "/" ^

Re: [Libguestfs] [PATCH 0/3] RFC: v2v: add -o json output mode

2019-03-22 Thread Tomáš Golembiovský
On Mon, 25 Feb 2019 17:22:49 +0100 Pino Toscano wrote: > This series adds a new output mode for virt-v2v, called -o json. > It produces local files, just like -o local, although the metadata > produced is a JSON file with data that v2v collected in the conversion > process. This can be useful fo