Displaying 20 results from an estimated 39 matches for "ocaml_handl".
Did you mean:
ocaml_handle
2017 Mar 07
0
[PATCH v4 7/9] dib: move do_cp to mllib.Commun_utils
...lt;> '\n' then str ^ "\n"
else str
diff --git a/mllib/common_utils.ml b/mllib/common_utils.ml
index e1d63292e..945728b5e 100644
--- a/mllib/common_utils.ml
+++ b/mllib/common_utils.ml
@@ -1167,3 +1167,8 @@ let inspect_decrypt g =
* function.
*)
c_inspect_decrypt g#ocaml_handle (Guestfs.c_pointer g#ocaml_handle)
+
+let do_cp src destdir =
+ let cmd = [ "cp"; "-t"; destdir; "-a"; src ] in
+ if run_command cmd <> 0 then
+ error (f_"copy of %s to %s failed") src destdir
diff --git a/mllib/common_utils.mli b/mllib/common_uti...
2017 Mar 23
0
[PATCH v5 07/10] dib: move do_cp to mllib.Commun_utils
...lt;> '\n' then str ^ "\n"
else str
diff --git a/mllib/common_utils.ml b/mllib/common_utils.ml
index e1d63292e..945728b5e 100644
--- a/mllib/common_utils.ml
+++ b/mllib/common_utils.ml
@@ -1167,3 +1167,8 @@ let inspect_decrypt g =
* function.
*)
c_inspect_decrypt g#ocaml_handle (Guestfs.c_pointer g#ocaml_handle)
+
+let do_cp src destdir =
+ let cmd = [ "cp"; "-t"; destdir; "-a"; src ] in
+ if run_command cmd <> 0 then
+ error (f_"copy of %s to %s failed") src destdir
diff --git a/mllib/common_utils.mli b/mllib/common_uti...
2017 Apr 12
0
[PATCH v6 07/10] dib: move do_cp to mllib.Commun_utils
...lt;> '\n' then str ^ "\n"
else str
diff --git a/mllib/common_utils.ml b/mllib/common_utils.ml
index 63d8dd92e..ceac57711 100644
--- a/mllib/common_utils.ml
+++ b/mllib/common_utils.ml
@@ -1186,3 +1186,8 @@ let inspect_decrypt g =
* function.
*)
c_inspect_decrypt g#ocaml_handle (Guestfs.c_pointer g#ocaml_handle)
+
+let do_cp src destdir =
+ let cmd = [ "cp"; "-t"; destdir; "-a"; src ] in
+ if run_command cmd <> 0 then
+ error (f_"copy of %s to %s failed") src destdir
diff --git a/mllib/common_utils.mli b/mllib/common_uti...
2017 Sep 12
0
[PATCH v8 5/7] mllib: add do_mv helper function to Common_utils
.../common_utils.mli | 3 +++
2 files changed, 9 insertions(+)
diff --git a/mllib/common_utils.ml b/mllib/common_utils.ml
index 597128967..1126f233b 100644
--- a/mllib/common_utils.ml
+++ b/mllib/common_utils.ml
@@ -561,3 +561,9 @@ let inspect_decrypt g =
* function.
*)
c_inspect_decrypt g#ocaml_handle (Guestfs.c_pointer g#ocaml_handle)
+
+let do_mv src dest =
+ let cmd = [ "mv"; src; dest ] in
+ let r = run_command cmd in
+ if r <> 0 then
+ error (f_"moving file '%s' to '%s' failed") src dest
diff --git a/mllib/common_utils.mli b/mllib/common_util...
2015 Nov 09
2
[PATCH 1/2] customize: check for file existence with --edit (RHBZ#1275806)
Check that a path provided to --edit exists already; while the is_file
call later will fail for non-existing files, with an explicit check a
better error message can be provided.
---
customize/customize_run.ml | 3 +++
1 file changed, 3 insertions(+)
diff --git a/customize/customize_run.ml b/customize/customize_run.ml
index ff7bd0d..054ee53 100644
--- a/customize/customize_run.ml
+++
2018 Sep 20
2
Re: [PATCH 2/2] Introduce a --key option in tools that accept keys
...(* Note we pass original 'g' even though it is not used by the
> * callee. This is so that 'g' is kept as a root on the stack, and
> * so cannot be garbage collected while we are in the c_inspect_decrypt
> * function.
> *)
> c_inspect_decrypt g#ocaml_handle (Guestfs.c_pointer g#ocaml_handle)
> + keys_as_list
An array would be even easier, but I guess you've written
the list code now :-)
- - -
I think Eric's / qemu's shared key stuff sounds very complex, and I
wonder who uses it. But in any case what you've proposed is
extens...
2020 Jan 22
0
[PATCH] mltools, options: support --allow-discards when decrypting LUKS devices
...exn
-let inspect_decrypt g ks =
+let inspect_decrypt g ?(allow_discards = false) ks =
(* Turn the keys in the key_store into a simpler struct, so it is possible
* to read it using the C API.
*)
@@ -664,7 +664,7 @@ let inspect_decrypt g ks =
* function.
*)
c_inspect_decrypt g#ocaml_handle (Guestfs.c_pointer g#ocaml_handle)
- keys_as_list
+ keys_as_list allow_discards
let with_timeout op timeout ?(sleep = 2) fn =
let start_t = Unix.gettimeofday () in
diff --git a/mltools/tools_utils.mli b/mltools/tools_utils.mli
index ab70f58..309a033 100644
--- a/mltools/tools_utils.mli...
2016 Sep 19
0
[PATCH 2/3] mllib: expose disk decrypt functionalities
...exn
+
+let inspect_decrypt g =
+ (* Note we pass original 'g' even though it is not used by the
+ * callee. This is so that 'g' is kept as a root on the stack, and
+ * so cannot be garbage collected while we are in the c_edit_file
+ * function.
+ *)
+ c_inspect_decrypt g#ocaml_handle (Guestfs.c_pointer g#ocaml_handle)
diff --git a/mllib/common_utils.mli b/mllib/common_utils.mli
index de95f9d..68c0d54 100644
--- a/mllib/common_utils.mli
+++ b/mllib/common_utils.mli
@@ -260,10 +260,13 @@ val parse_resize : int64 -> string -> int64
val human_size : int64 -> string
(**...
2016 Dec 14
1
Re: [PATCH v2 3/4] sysprep: Add a new operation to remove editor backup files (RHBZ#1401320).
...> ["/"] in
There's a similar list also in customize/customize_run.ml for the
`SSHInject operation -- I guess an helper function could be added to
Common_utils.
> + List.iter (
> + fun fs ->
> + if g#is_dir ~followsymlinks:false fs then (
> + visit g#ocaml_handle fs (
> + fun dir filename { G.st_mode = mode } _ ->
> + match dir, filename, mode with
> + (* Ignore root directory and non-regular files. *)
> + | _, None, _ -> ()
> + | _, Some _, mode when not (is_reg mode) -> ()
>...
2016 Dec 14
6
[PATCH v2 0/4] sysprep: Remove various backup files.
In v2:
- The backup-files operation now operates on a conservative whitelist
of filesystems, so it won't touch anything in /usr. Consequently
it also runs much more quickly, about 4 seconds on the barebones
virt-builder fedora-25 image.
- Call Gc.compact () in visit_tests.
- Added documentation to fnmatch.mli.
2016 Dec 14
4
[PATCH 0/4] sysprep: Remove various backup files.
https://bugzilla.redhat.com/show_bug.cgi?id=1401320
This series contains two new operations.
The second -- and least controversial -- is "passwd-backups" which
removes files such as /etc/passwd-, /etc/shadow- and so on.
The first one ("backup-files") searches the whole guest filesystem for
any regular file which looks like an editor backup file, such as "*~"
and
2016 Dec 14
5
[PATCH v3 0/5] sysprep: Remove various backup files.
v3:
- Split out test for "unix-like" guest OSes into separate commit.
- Add guestfish --format=qcow2 to the test (x2).
Rich.
2015 Nov 09
0
[PATCH 2/2] customize: allow editing symlinked files
...if not (g#exists path) then
error (f_"%s does not exist in the guest") path;
- if not (g#is_file path) then
+ if not (g#is_file ~followsymlinks:true path) then
error (f_"%s is not a regular file in the guest") path;
Perl_edit.edit_file g#ocaml_handle path expr
--
2.1.0
2015 Sep 30
0
[PATCH 2/2] ocaml: Improve ocamldoc.
...vent_callback : event_callback -> event list -> event_handle
+ (** See {!Guestfs.set_event_callback} *)
method delete_event_callback : event_handle -> unit
+ (** See {!Guestfs.delete_event_callback} *)
method last_errno : unit -> int
+ (** See {!Guestfs.last_errno} *)
method ocaml_handle : t
+ (** Return the {!Guestfs.t} handle *)
";
List.iter (
- fun { name = name; style = style; non_c_aliases = non_c_aliases } ->
+ fun ({ name = name; style = style; non_c_aliases = non_c_aliases } as f) ->
(match style with
| _, [], _ ->
pr "...
2020 Jan 27
3
[PATCH v2 1/2] mltools, options: support --allow-discards when decrypting LUKS devices
...exn
-let inspect_decrypt g ks =
+let inspect_decrypt g ?(allow_discards = false) ks =
(* Turn the keys in the key_store into a simpler struct, so it is possible
* to read it using the C API.
*)
@@ -664,7 +664,7 @@ let inspect_decrypt g ks =
* function.
*)
c_inspect_decrypt g#ocaml_handle (Guestfs.c_pointer g#ocaml_handle)
- keys_as_list
+ keys_as_list allow_discards
let with_timeout op timeout ?(sleep = 2) fn =
let start_t = Unix.gettimeofday () in
diff --git a/mltools/tools_utils.mli b/mltools/tools_utils.mli
index ab70f58..ac11a58 100644
--- a/mltools/tools_utils.mli...
2015 Sep 30
3
[PATCH 1/2] ocaml: Use ocamlfind to run ocamldoc.
Using 'ocamlfind ocamldoc' is much faster than running 'ocamldoc'
directly, because ocamlfind will run the native code program
'ocamldoc.opt' if it is available.
This change approximately halves the time taken to compile the ocaml
bindings.
---
ocaml/Makefile.am | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ocaml/Makefile.am b/ocaml/Makefile.am
index
2016 Sep 19
6
[PATCH 0/3] add crypto/LUKS support in some OCaml-based tools
Hi,
this series refactors some guestfish code (not much), and exposes it
via Common_utils, so it is possible to decrypt LUKS partitions when
using virt-customize, virt-get-kernel, virt-sparsify, and virt-sysprep.
This brings them closer in features with C tools.
Most probably a couple more of other OCaml-based tools (virt-v2v to
convert encrypted guests, and virt-builder to use encrypted
2016 Dec 14
0
[PATCH v2 3/4] sysprep: Add a new operation to remove editor backup files (RHBZ#1401320).
...| "hurd"
+ | "linux"
+ | "minix" -> unix_whitelist
+ | f when String.is_suffix f "bsd" -> unix_whitelist
+ | _ -> ["/"] in
+
+ List.iter (
+ fun fs ->
+ if g#is_dir ~followsymlinks:false fs then (
+ visit g#ocaml_handle fs (
+ fun dir filename { G.st_mode = mode } _ ->
+ match dir, filename, mode with
+ (* Ignore root directory and non-regular files. *)
+ | _, None, _ -> ()
+ | _, Some _, mode when not (is_reg mode) -> ()
+ | dir, Some filen...
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 +-
2015 Feb 27
5
[PATCH 0/4] firstboot: assorted enhancements
This patchset attempts to address a number of shortcomings in the
firstboot infrastructure I came across while working with v2v conversion
of various Windows VMs.
Roman Kagan (4):
firstboot: consolidate line ending conversion
firstboot: enhance firstboot driver script for Windows
firstboot: make script naming descriptive
convert_windows: split firstboot into steps