search for: prerr_endlin

Displaying 20 results from an estimated 27 matches for "prerr_endlin".

Did you mean: prerr_endline
2018 Mar 16
0
[PATCH v2 4/5] tools: Add machine_output function.
...++++++ 2 files changed, 19 insertions(+) diff --git a/common/mltools/tools_utils.ml b/common/mltools/tools_utils.ml index 09f1bb544..f7abd5c3e 100644 --- a/common/mltools/tools_utils.ml +++ b/common/mltools/tools_utils.ml @@ -102,6 +102,14 @@ let debug fs = let display str = if verbose () then prerr_endline str in ksprintf display fs +let machine_output fs = + let display str = + print_endline "__MACHINEBEGIN__"; + print_endline str; + print_endline "__MACHINEEND__" + in + ksprintf display fs + (* Common function to create a new Guestfs handle, with common option...
2018 Sep 19
0
[PATCH 1/2] mltools: create a cmdline_options struct
...@@ -30,7 +30,7 @@ let usage_msg = sprintf "%s: test the --machine-readable functionality" prog let opthandle = create_standard_options [] ~machine_readable:true usage_msg let () = - Getopt.parse opthandle; + Getopt.parse opthandle.getopt; print_endline "on-stdout"; prerr_endline "on-stderr"; diff --git a/common/mltools/tools_utils.ml b/common/mltools/tools_utils.ml index c4f230275..2b2d43db9 100644 --- a/common/mltools/tools_utils.ml +++ b/common/mltools/tools_utils.ml @@ -259,6 +259,10 @@ let machine_readable () = in Some { pr } +type cmdline_option...
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
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.
2016 Feb 18
0
[PATCH 3/3] Add and use an helper error function
...ls.ml b/src/utils.ml index 87c9cf7..4223be4 100644 --- a/src/utils.ml +++ b/src/utils.ml @@ -28,6 +28,13 @@ let (//) = Filename.concat let quote = Filename.quote let quoted_list names = String.concat " " (List.map quote names) +let error ?(exit_code = 1) fs = + let display str = + prerr_endline (sprintf "supermin: %s" str); + exit exit_code + in + ksprintf display fs + let dir_exists name = try (stat name).st_kind = S_DIR with Unix_error _ -> false @@ -59,31 +66,25 @@ let run_command_get_lines cmd = (match stat with | WEXITED 0 -> () | WEXITED i -&g...
2016 Feb 18
4
[PATCH 0/3] supermin: miscellaneous cleanups
Hi, few cleanups in the supermin codebase; no actual functional change. Thanks, -- Pino Toscano (3): ext2: simplify tracking of visited modules utils: remove unused run_python function Add and use an helper error function src/build.ml | 20 +++++----------- src/dpkg.ml | 4 +--- src/ext2_initrd.ml | 10 ++++---- src/kernel.ml | 27
2018 Aug 23
0
[PATCH v2 2/2] OCaml tools: add output selection for --machine-readable
..._utils +open Tools_utils +open Getopt.OptionName + +let usage_msg = sprintf "%s: test the --machine-readable functionality" prog + +let opthandle = create_standard_options [] ~machine_readable:true usage_msg +let () = + Getopt.parse opthandle; + + print_endline "on-stdout"; + prerr_endline "on-stderr"; + + match machine_readable () with + | Some { pr } -> + pr "machine-readable\n" + | None -> () diff --git a/common/mltools/test-machine-readable.sh b/common/mltools/test-machine-readable.sh new file mode 100755 index 000000000..1162c58e9 --- /dev/null +...
2015 Mar 10
0
[PATCH] v2v: Add the test-harness used by external tests.
...h is absolute. *) + let abs_boot_disk = Sys.getcwd () // boot_disk in + Xml.set_prop node "file" abs_boot_disk + | _ -> assert false in + + (* Test boot the guest. *) + (try test_boot boot_disk boot_xml_doc + with + | Libvirt.Virterror err -> + prerr_endline (Libvirt.Virterror.to_string err) + | exn -> raise exn + ); + + (* If there's a post-boot callback, run it now. *) + (match test_plan.post_boot_test with + | None -> () + | Some fn -> + let g, root = inspect_and_mount_disk boot_disk in + fn g root converte...
2015 Mar 10
2
[PATCH 0/1] v2v: Add the test-harness used by external tests.
As I'm now working through the enormous virt-v2v/virt-p2v bug list, we need a high quality set of tests to ensure that we don't accidentally regress some old OS/hypervisor combination while making changes. The test cases are going to be huge, so we cannot possibly distribute them in libguestfs. Furthermore many of them have licensing problems which means we cannot redistribute them at
2017 Jul 14
0
[PATCH 02/27] daemon: Allow parts of the daemon and APIs to be written in OCaml.
...fd; + + chdir t.chroot; + chroot t.chroot; + + let ret = + try Either (func arg) + with exn -> Or exn in + + try + let chan = out_channel_of_descr wfd in + output_value chan ret; + Pervasives.flush chan; + Exit._exit 0 + with + exn -> + prerr_endline (Printexc.to_string exn); + Exit._exit 1 + ); + + (* Parent. *) + close wfd; + + let _, status = waitpid [] pid in + (match status with + | WEXITED 0 -> () + | WEXITED i -> + close rfd; + failwithf "chroot ‘%s’ exited with non-zero error %d" t.name i + |...
2016 May 22
0
[PATCH 2/2] ocaml tools: Use a common debug function.
...t; diff --git a/mllib/common_utils.ml b/mllib/common_utils.ml index e1317a7..0ffa92c 100644 --- a/mllib/common_utils.ml +++ b/mllib/common_utils.ml @@ -384,6 +384,11 @@ let info fs = in ksprintf display fs +(* Print a debug message. *) +let debug fs = + let display str = if verbose () then prerr_endline str in + ksprintf display fs + (* Common function to create 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 @...
2018 Aug 23
3
[PATCH v2 0/2] add output selection for --machine-readable
Hi, this adds the possibility to select the output for --machine-readable in OCaml tools. 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 possible to add additional output for
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.
2017 Jun 03
3
[PATCH 0/3]: daemon: Reimplement ‘file’ API in OCaml.
This patch series is just FYI at the moment. However it does pass the tests. The daemon is a self-contained program. We don't need to write it all in C. Writing parts of it in OCaml would make it simpler and less error-prone. In particular if the daemon was written in a more sane programming language then we could move the inspection code to run entirely inside the appliance, which would
2017 Jul 21
0
[PATCH v2 01/23] daemon: Allow parts of the daemon and APIs to be written in OCaml.
...fd; + + chdir t.chroot; + chroot t.chroot; + + let ret = + try Either (func arg) + with exn -> Or exn in + + try + let chan = out_channel_of_descr wfd in + output_value chan ret; + Pervasives.flush chan; + Exit._exit 0 + with + exn -> + prerr_endline (Printexc.to_string exn); + Exit._exit 1 + ); + + (* Parent. *) + close wfd; + + let _, status = waitpid [] pid in + (match status with + | WEXITED 0 -> () + | WEXITED i -> + close rfd; + failwithf "chroot ‘%s’ exited with non-zero error %d" t.name i + |...
2018 Sep 19
5
[PATCH 0/2] RFC: --key option for tools
Hi, the following series adds a --key option in the majority of tools: this makes it possible to pass LUKS credentials programmatically, avoid the need to manually input them, or unsafely pass them via stdin. Thanks, Pino Toscano (2): mltools: create a cmdline_options struct Introduce a --key option in tools that accept keys builder/cmdline.ml | 2 +-
2012 Mar 28
2
[PATCH v2] New APIs: mount-local and umount-local using FUSE
This version doesn't crash or cause hung processes or stuck mountpoints, so that's an improvement. Rich.
2012 Mar 29
3
[PATCH v3] New APIs: mount-local, mount-local-run and umount-local using FUSE
This changes the proposed API slightly. Previously 'mount-local' generating a 'mounted' event when the filesystem was ready, and from the 'mounted' event you had to effectively do a fork. Now, 'mount-local' just initializes the mountpoint and you have to call 'mount-local-run' to enter the FUSE main loop. Between these calls you can do a fork or whatever
2017 Jun 03
12
[PATCH v2 00/12] Allow APIs to be implemented in OCaml.
Version 1 was here: https://www.redhat.com/archives/libguestfs/2017-June/msg00003.html This patch series reimplements a few more APIs in OCaml, including some very important core APIs like ?list_filesystems? and ?mount?. All the tests pass after this. The selection of APIs that I have moved may look a little random, but in fact they are all APIs consumed by the inspection code (and some more
2017 Jun 05
19
[PATCH v3 00/19] Allow APIs to be implemented in OCaml.
v2 was here: https://www.redhat.com/archives/libguestfs/2017-June/msg00008.html This series gets as far as a working (and faster) reimplementation of ‘guestfs_list_filesystems’. I also have another patch series on top of this one which reimplements the inspection APIs inside the daemon, but that needs a bit more work still, since inspection turns out to be a very large piece of code. Rich.