Displaying 20 results from an estimated 141 matches for "machine_readable".
2018 Aug 20
0
[PATCH 2/2] OCaml tools: simplify machine-readable handling
...etions(-)
diff --git a/builder/cmdline.ml b/builder/cmdline.ml
index fa8a83d3e..9c854ed49 100644
--- a/builder/cmdline.ml
+++ b/builder/cmdline.ml
@@ -104,8 +104,6 @@ let parse_cmdline () =
* Getopt handling of Symbol. *)
list_format := List_entries.list_format_of_string arg in
- let machine_readable = ref false in
-
let memsize = ref None in
let set_memsize arg = memsize := Some arg in
@@ -155,7 +153,6 @@ let parse_cmdline () =
[ L"long" ], Getopt.Unit list_set_long, s_"Shortcut for --list-format long";
[ L"list-format" ], Getopt.Symbol (fo...
2018 Aug 20
2
[PATCH 1/2] mlstdutils/mltools: factorize the machine-readable option
...ff --git a/common/mlstdutils/std_utils.ml b/common/mlstdutils/std_utils.ml
index df443058f..6499b3535 100644
--- a/common/mlstdutils/std_utils.ml
+++ b/common/mlstdutils/std_utils.ml
@@ -645,6 +645,10 @@ let verbose = ref false
let set_verbose () = verbose := true
let verbose () = !verbose
+let machine_readable = ref false
+let set_machine_readable () = machine_readable := true
+let machine_readable () = !machine_readable
+
let with_open_in filename f =
let chan = open_in filename in
protect ~f:(fun () -> f chan) ~finally:(fun () -> close_in chan)
diff --git a/common/mlstdutils/std_utils.mli...
2018 Aug 23
0
[PATCH v2 2/2] OCaml tools: add output selection for --machine-readable
...| 6 ++-
builder/virt-builder-repository.pod | 5 ++
builder/virt-builder.pod | 5 ++
common/mlstdutils/std_utils.ml | 4 --
common/mlstdutils/std_utils.mli | 7 +--
common/mltools/Makefile.am | 35 ++++++++++++-
common/mltools/machine_readable_tests.ml | 41 +++++++++++++++
common/mltools/test-machine-readable.sh | 67 ++++++++++++++++++++++++
common/mltools/tools_utils.ml | 53 ++++++++++++++++++-
common/mltools/tools_utils.mli | 10 ++++
dib/cmdline.ml | 8 +--
dib/virt-dib.pod...
2018 Aug 23
3
[PATCH v2 0/2] add output selection for --machine-readable
...estimate for virt-v2v [1] could print
human output (just like the --print-source), while printing e.g. JSON to
the machine-readable stream.
[1] https://www.redhat.com/archives/libguestfs/2018-August/msg00158.html
Changes from v1:
- adjusted the formatting for help text in patch #1
- moved all the machine_readable machinery in Tools_utils
- expose all in a single machine_readable () function
- add a test
- add the documentation bits
Thanks,
Pino Toscano (2):
common/mltools: getopt: add Getopt.OptString
OCaml tools: add output selection for --machine-readable
.gitignore...
2018 Sep 19
0
[PATCH 1/2] mltools: create a cmdline_options struct
...easy to
add more data needed for handling standard command line options.
This is mostly refactoring, with no functional changes.
---
builder/cmdline.ml | 2 +-
builder/repository_main.ml | 2 +-
common/mltools/getopt_tests.ml | 2 +-
common/mltools/machine_readable_tests.ml | 2 +-
common/mltools/tools_utils.ml | 9 ++++++++-
common/mltools/tools_utils.mli | 10 ++++++++--
customize/customize_main.ml | 2 +-
dib/cmdline.ml | 2 +-
get-kernel/get_kernel.ml | 2 +-
resize/resize.ml...
2018 Aug 22
1
Re: [PATCH 2/2] OCaml tools: add output selection for --machine-readable
On Tue, Aug 21, 2018 at 05:44:30PM +0200, Pino Toscano wrote:
> +let machine_readable_printf fs =
> + let get_machine_readable_channel () =
> + let open_machine_readable_channel () =
> + match !machine_readable_output with
> + | NoOutput ->
> + (* Trying to use machine_readable_printf when --machine-readable was
> + * not enabled, an...
2015 Nov 11
1
[PATCH] sparsify: Make the interface between cmdline.ml and sparsify.ml explicit.
...sify/cmdline.ml
+++ b/sparsify/cmdline.ml
@@ -25,9 +25,18 @@ open Common_utils
open Utils
-type mode_t =
-| Mode_copying of string * check_t * bool * string option * string option *
- string option
+type cmdline = {
+ indisk : string;
+ format : string option;
+ ignores : string list;
+ machine_readable : bool;
+ zeroes : string list;
+ mode : mode_t;
+}
+
+and mode_t =
+| Mode_copying of
+ string * check_t * bool * string option * string option * string option
| Mode_in_place
and check_t = [`Ignore|`Continue|`Warn|`Fail]
@@ -175,4 +184,10 @@ read the man page virt-sparsify(1).
else...
2018 Sep 20
1
Re: [PATCH 1/2] mltools: create a cmdline_options struct
On Wed, Sep 19, 2018 at 12:37:00PM +0200, Pino Toscano wrote:
> diff --git a/common/mltools/tools_utils.mli b/common/mltools/tools_utils.mli
> index 2b8c2b78a..99984bfa1 100644
> --- a/common/mltools/tools_utils.mli
> +++ b/common/mltools/tools_utils.mli
> @@ -74,7 +74,13 @@ val machine_readable : unit -> machine_readable_fn option
> readable output to, in case it was enabled via
> [--machine-readable]. *)
>
> -val create_standard_options : Getopt.speclist -> ?anon_fun:Getopt.anon_fun -> ?key_opts:bool -> ?machine_readable:bool -> Getopt.usage_msg -&g...
2018 Aug 21
0
[PATCH 2/2] OCaml tools: add output selection for --machine-readable
...ions(-)
diff --git a/builder/cmdline.ml b/builder/cmdline.ml
index 9c854ed49..1771ef046 100644
--- a/builder/cmdline.ml
+++ b/builder/cmdline.ml
@@ -218,12 +218,12 @@ read the man page virt-builder(1).
(* No arguments and machine-readable mode? Print some facts. *)
if args = [] && machine_readable () then (
- printf "virt-builder\n";
- printf "arch\n";
- printf "config-file\n";
- printf "customize\n";
- printf "json-list\n";
- if Pxzcat.using_parallel_xzcat () then printf "pxzcat\n";
+ machine_readable_printf &q...
2018 Aug 21
4
[PATCH 0/2] RFC: add output selection for --machine-readable
Hi,
this is a first approach (hence RFC, since it misses tests &
documentation) in selecting the output for --machine-readable.
The possible choices are:
* --machine-readable: to stdout, like before
* --machine-readable=file:name-of-file: to the specified file
* --machine-readable=stream:stdout: explicitly to stdout
* --machine-readable=stream:stderr: explicitly to stderr
This makes it
2015 Dec 14
4
[PATCH 0/2] resize: Split out the command line parsing into Cmdline
Some simple refactoring of virt-resize.
I originally had the idea that we could turn virt-resize into a
library (cf. virt-customize) and use it from virt-builder, but I now
don't think that would make any meaningful difference. In particular
we'd still have to open the handle the same number of times.
These two patches are left over from my work on that.
Rich.
2015 Nov 04
1
[PATCH 0/1] sparsify: Let --in-place capture ^C and shut down gracefully
This patch is easier to read if you use the 'git show -w' option.
Also observe that:
fun a -> ( fun () -> (* code *) )
(ie. returning a closure) is identical to:
fun a () -> (* code *)
Rich.
2016 Aug 05
6
[PATCH 0/4] sparsify: Warn instead of error if a filesystem cannot be fstrimmed.
Fix for
https://bugzilla.redhat.com/show_bug.cgi?id=1364347
2019 Mar 25
1
Re: [PATCH 2/4] common/mltools: make sure machine readable output is flushed
...| 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
> + in
> + ksprintf out fs
> in
> Some { pr }
I was looki...
2015 Aug 28
1
[PATCH] handle --debug-gc universally via at_exit hook
...e.ml
@@ -152,7 +152,7 @@ let string_of_expand_content_method = function
(* Main program. *)
let main () =
let infile, outfile, align_first, alignment, copy_boot_loader,
- debug_gc, deletes,
+ deletes,
dryrun, expand, expand_content, extra_partition, format, ignores,
lv_expands, machine_readable, ntfsresize_force, output_format,
resizes, resizes_force, shrink, sparse =
@@ -162,7 +162,6 @@ let main () =
let align_first = ref "auto" in
let alignment = ref 128 in
let copy_boot_loader = ref true in
- let debug_gc = ref false in
let deletes = ref [] in...
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
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
2014 Jun 13
3
[PATCH 0/2] sparsify: Add --tmp option to allow specifying temporary directory or block device.
The first patch is just some simple refactoring. See the second patch
for a description of the new virt-sparsify --tmp option.
I tested this using a loopback device as my temporary block device,
and it seems to work fine for me.
Federico .. this needs a BZ :-)
Rich.
2018 Sep 19
5
[PATCH 0/2] RFC: --key option for tools
...| 12 +-
cat/virt-cat.pod | 17 +++
cat/virt-log.pod | 17 +++
cat/virt-ls.pod | 17 +++
cat/virt-tail.pod | 17 +++
common/mltools/getopt_tests.ml | 2 +-
common/mltools/machine_readable_tests.ml | 2 +-
common/mltools/tools_utils-c.c | 44 ++++++-
common/mltools/tools_utils.ml | 43 ++++++-
common/mltools/tools_utils.mli | 20 ++-
common/options/decrypt.c | 4 +-
common/options/inspect.c | 4 +-
common/options...
2014 Mar 11
21
[PATCH v2 00/18] Add discard support.
This still isn't working at the moment. See:
http://marc.info/?t=139457409300003&r=1&w=2
This set of patches:
- Adds new APIs to support discard in libguestfs.
- Adds discard support to virt-format.
- Adds discard support to virt-sysprep.
- Implements virt-sparsify --in-place.
Rich.