search for: ade4cb37f

Displaying 7 results from an estimated 7 matches for "ade4cb37f".

2019 Mar 25
1
Re: [PATCH 2/4] common/mltools: make sure machine readable output is flushed
...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 a/common/mltools/tools_utils.ml b/common/mltools/tools_utils.ml > index 5a35708cd..ade4cb37f 100644 > --- a/common/mltools/tools_utils.ml > +++ b/common/mltools/tools_utils.ml > @@ -59,7 +59,11 @@ let machine_readable () = > | None -> None > | Some chan -> > let pr fs = > - ksprintf (output_string chan) fs > + let out s = > + out...
2019 Mar 22
8
[PATCH 0/4] OCaml tools: output messages as JSON machine
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 (4): common/mltools: move the code for machine readable up common/mltools: make sure machine
2019 Mar 28
8
[PATCH v2 0/4] OCaml tools: output messages as JSON machine
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. Changes from v1: - use Obj.magic to convert int -> Unix.file_descr - add tests Pino Toscano (4):
2019 Mar 22
0
[PATCH 2/4] common/mltools: make sure machine readable output is flushed
...ter 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 a/common/mltools/tools_utils.ml b/common/mltools/tools_utils.ml index 5a35708cd..ade4cb37f 100644 --- a/common/mltools/tools_utils.ml +++ b/common/mltools/tools_utils.ml @@ -59,7 +59,11 @@ let machine_readable () = | None -> None | Some chan -> let pr fs = - ksprintf (output_string chan) fs + let out s = + output_string chan s; + flush chan +...
2019 Mar 28
0
[PATCH v2 2/4] common/mltools: make sure machine readable output is flushed
...ter 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 a/common/mltools/tools_utils.ml b/common/mltools/tools_utils.ml index 5a35708cd..ade4cb37f 100644 --- a/common/mltools/tools_utils.ml +++ b/common/mltools/tools_utils.ml @@ -59,7 +59,11 @@ let machine_readable () = | None -> None | Some chan -> let pr fs = - ksprintf (output_string chan) fs + let out s = + output_string chan s; + flush chan +...
2019 Mar 28
0
[PATCH v2 3/4] common/mltools: allow fd for machine readable output
...r 2>&1 >/dev/null | wc -l) -eq 2 + +# Output "fd:". +fn="$tmpdir/fdfile" +exec 4>"$fn" +$t --machine-readable=fd:4 +exec 4>&- +test $(cat "$fn" | wc -l) -eq 1 diff --git a/common/mltools/tools_utils.ml b/common/mltools/tools_utils.ml index ade4cb37f..35478f39e 100644 --- a/common/mltools/tools_utils.ml +++ b/common/mltools/tools_utils.ml @@ -41,6 +41,7 @@ type machine_readable_output_type = | NoOutput | Channel of out_channel | File of string + | Fd of int let machine_readable_output = ref NoOutput let machine_readable_channel = re...
2019 Mar 22
0
[PATCH 3/4] common/mltools: allow fd for machine readable output
...from_fd (value fdv) +{ + CAMLparam1 (fdv); + struct channel *chan; + + chan = caml_open_descriptor_out (Int_val (fdv)); + if (!chan) + caml_raise_out_of_memory (); + + CAMLreturn (caml_alloc_channel (chan)); +} diff --git a/common/mltools/tools_utils.ml b/common/mltools/tools_utils.ml index ade4cb37f..3c54cd4a0 100644 --- a/common/mltools/tools_utils.ml +++ b/common/mltools/tools_utils.ml @@ -32,6 +32,7 @@ and key_store_key = external c_inspect_decrypt : Guestfs.t -> int64 -> (string * key_store_key) list -> unit = "guestfs_int_mllib_inspect_decrypt" external c_set_echo_key...