search for: format4

Displaying 20 results from an estimated 42 matches for "format4".

Did you mean: format
2017 May 26
2
[PATCH 0/2] mllib: Export some more functions to the generator.
These functions are already linked to the generator, they're just not exported. Rich.
2020 Oct 05
2
Re: [PATCH nbdkit v2 3/3] ocaml: Add bindings for nbdkit_peer_{pid, uid, gid}.
...l/NBDKit.mli > index ececd5fd..8abfeb49 100644 > --- a/plugins/ocaml/NBDKit.mli > +++ b/plugins/ocaml/NBDKit.mli > @@ -162,3 +162,10 @@ val shutdown : unit -> unit > > (** Print a debug message when nbdkit is in verbose mode. *) > val debug : ('a, unit, string, unit) format4 -> 'a > + > +(** Binding for [nbdkit_peer_pid]. *) > +val peer_pid : unit -> int > +(** Binding for [nbdkit_peer_uid]. *) > +val peer_uid : unit -> int > +(** Binding for [nbdkit_peer_gid]. *) > +val peer_gid : unit -> int Is int sufficient on 32-bit platforms,...
2018 Mar 16
0
[PATCH v2 4/5] tools: Add machine_output function.
...on options * (e.g. debug, tracing) already set. *) diff --git a/common/mltools/tools_utils.mli b/common/mltools/tools_utils.mli index dac6b4120..d40e0aa9b 100644 --- a/common/mltools/tools_utils.mli +++ b/common/mltools/tools_utils.mli @@ -36,6 +36,17 @@ val debug : ('a, unit, string, unit) format4 -> 'a the command line. As with libguestfs debugging messages, it is sent to [stderr]. *) +val machine_output : ('a, unit, string, unit) format4 -> 'a +(** Output meant to be parsed by another program. + + It is printed with no wrapping or other interpretation as:...
2019 Mar 28
0
[PATCH v2 1/4] common/mltools: move the code for machine readable up
...c_set_echo_keys : unit -> unit = "guestfs_int_mllib_set_echo_keys" "noalloc" external c_set_keys_from_stdin : unit -> unit = "guestfs_int_mllib_set_keys_from_stdin" "noalloc" +type machine_readable_fn = { + pr : 'a. ('a, unit, string, unit) format4 -> 'a; +} (* [@@unboxed] *) + +type machine_readable_output_type = + | NoOutput + | Channel of out_channel + | File of string +let machine_readable_output = ref NoOutput +let machine_readable_channel = ref None +let machine_readable () = + let chan = + if !machine_readable_channel = N...
2015 Nov 10
0
[PATCH 4/4] mllib, v2v: Allow open_guestfs to set the handle identifier.
...entifier; g (* All the OCaml virt-* programs use this wrapper to catch exceptions diff --git a/mllib/common_utils.mli b/mllib/common_utils.mli index d8f63d5..44b8c93 100644 --- a/mllib/common_utils.mli +++ b/mllib/common_utils.mli @@ -152,7 +152,7 @@ val warning : ('a, unit, string, unit) format4 -> 'a val info : ('a, unit, string, unit) format4 -> 'a (** Standard info function. Note: Use full sentences for this. *) -val open_guestfs : unit -> Guestfs.guestfs +val open_guestfs : ?identifier:string -> unit -> Guestfs.guestfs (** Common function to create a ne...
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 Apr 01
2
[PATCH] OCaml tools: fix 3999 -> 3339 typo
...rnal c_rfc3999_date_time_string : unit -> string = "guestfs_int_mllib_rfc3999_date_time_string" +external c_rfc3339_date_time_string : unit -> string = "guestfs_int_mllib_rfc3339_date_time_string" type machine_readable_fn = { pr : 'a. ('a, unit, string, unit) format4 -> 'a; @@ -93,7 +93,7 @@ let log_as_json msgtype msg = | Some { pr } -> let json = [ "message", JSON.String msg; - "timestamp", JSON.String (c_rfc3999_date_time_string ()); + "timestamp", JSON.String (c_rfc3339_date_time_string ());...
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):
2015 Nov 10
7
[PATCH 0/4]: mllib: Add 'may' function, and refactoring.
The 'may' function is a higher-order function (HOF) that replaces: match x with | None -> () | Some x -> f x with: may f x The idea comes from lablgtk (OCaml Gtk bindings) where it is widely used. If this change is clearer than previous code, then this could be used in many more places. However I previously steered clear from using HOFs like this because they can be
2020 Oct 03
0
[PATCH nbdkit v2 3/3] ocaml: Add bindings for nbdkit_peer_{pid, uid, gid}.
...ins/ocaml/NBDKit.mli b/plugins/ocaml/NBDKit.mli index ececd5fd..8abfeb49 100644 --- a/plugins/ocaml/NBDKit.mli +++ b/plugins/ocaml/NBDKit.mli @@ -162,3 +162,10 @@ val shutdown : unit -> unit (** Print a debug message when nbdkit is in verbose mode. *) val debug : ('a, unit, string, unit) format4 -> 'a + +(** Binding for [nbdkit_peer_pid]. *) +val peer_pid : unit -> int +(** Binding for [nbdkit_peer_uid]. *) +val peer_uid : unit -> int +(** Binding for [nbdkit_peer_gid]. *) +val peer_gid : unit -> int diff --git a/plugins/ocaml/NBDKit.ml b/plugins/ocaml/NBDKit.ml index 73921...
2019 Mar 22
0
[PATCH 3/4] common/mltools: allow fd for machine readable output
...set_keys_from_stdin : unit -> unit = "guestfs_int_mllib_set_keys_from_stdin" "noalloc" +external c_out_channel_from_fd : int -> out_channel = "guestfs_int_mllib_open_out_channel_from_fd" type machine_readable_fn = { pr : 'a. ('a, unit, string, unit) format4 -> 'a; @@ -41,6 +42,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 = ref None let machine_readable () = @@ -50,7 +52,8 @@ let machine_readable ()...
2014 Dec 05
3
[PATCH] customize, sysprep: add a short SELinux note
Add a short paragraph about SELinux, mostly to point to the documentation about it provided in the documentation of virt-builder. --- customize/virt-customize.pod | 8 ++++++++ sysprep/virt-sysprep.pod | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/customize/virt-customize.pod b/customize/virt-customize.pod index a666be7..8dbdfef 100644 --- a/customize/virt-customize.pod +++
2018 Mar 16
7
[PATCH v2 0/5] Add --print-target with machine-readable version.
This adds --print-target. In addition, v2 provides a machine-readable version (in JSON format). All of the record -> JSON boilerplate in this patch could be eliminated if we moved the baseline to OCaml 4.02. Rich.
2012 Apr 06
2
[PATCH] virt-sysprep:add logging feature
Hi Rich, I tried to implement the logging feature, but I can't though compiling with this patch now, could you please give me some comments? The error message is below, --- ocamlfind ocamlopt -g -warn-error CDEFLMPSUVYZX -package unix -I ../src/.libs -I ../ocaml -c sysprep_operation.ml -o sysprep_operation.cmx File "sysprep_operation.ml", line 1, characters 0-1: Error: The
2019 Mar 22
0
[PATCH 4/4] OCaml tools: output messages into JSON for machine readable
...ernal c_out_channel_from_fd : int -> out_channel = "guestfs_int_mllib_open_out_channel_from_fd" +external c_rfc3999_date_time_string : unit -> string = "guestfs_int_mllib_rfc3999_date_time_string" type machine_readable_fn = { pr : 'a. ('a, unit, string, unit) format4 -> 'a; @@ -85,12 +86,24 @@ let ansi_magenta ?(chan = stdout) () = let ansi_restore ?(chan = stdout) () = if colours () || istty chan then output_string chan "\x1b[0m" +let log_as_json msgtype msg = + match machine_readable () with + | None -> () + | Some { pr } -> +...
2015 May 15
5
[PATCH 0/4] Only tell people to use -v -x when reporting bugs if they're not using those flags.
.. and a lot of refactoring. https://bugzilla.redhat.com/show_bug.cgi?id=1167623 Rich.
2015 May 15
6
[PATCH v2 0/4] Only tell people to use -v -x when reporting bugs if they're not using those flags.
https://bugzilla.redhat.com/show_bug.cgi?id=1167623
2016 May 22
0
[PATCH 2/2] ocaml tools: Use a common debug function.
...a new Guestfs handle, with common options * (e.g. debug, tracing) already set. *) diff --git a/mllib/common_utils.mli b/mllib/common_utils.mli index b862cd0..666e023 100644 --- a/mllib/common_utils.mli +++ b/mllib/common_utils.mli @@ -191,6 +191,13 @@ val warning : ('a, unit, string, unit) format4 -> 'a val info : ('a, unit, string, unit) format4 -> 'a (** Standard info function. Note: Use full sentences for this. *) +val debug : ('a, unit, string, unit) format4 -> 'a +(** Standard debug function. + + The message is only emitted if the verbose ([-v]) flag...
2016 May 22
4
ocaml tools: Use a common debug function.
Add a Common_utils.debug function for printing messages only when in verbose mode. Rich.
2015 Sep 01
3
[PATCH 1/3] mllib: make few command line options stuff private
...line options. --- mllib/common_utils.mli | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/mllib/common_utils.mli b/mllib/common_utils.mli index 79032bc..24f8f83 100644 --- a/mllib/common_utils.mli +++ b/mllib/common_utils.mli @@ -90,10 +90,6 @@ val info : ('a, unit, string, unit) format4 -> 'a val run_main_and_handle_errors : (unit -> unit) -> unit (** Common function for handling pretty-printing exceptions. *) -val print_version_and_exit : unit -> unit -(** Print the version number and exit. Implements [--version] flag in - the OCaml tools. *) - val genera...