search for: errno_einval

Displaying 20 results from an estimated 20 matches for "errno_einval".

2016 Jul 07
2
Re: [PATCH 1/3] mllib: add checking for btrfs subvolume
...t ~mount_opts_fn:(fun _ -> "ro") > + > +let is_btrfs_subvolume g fs = > + let device = g#mountable_device fs in > + let subvol = > + try > + g#mountable_subvolume fs > + with Guestfs.Error msg as exn -> > + if g#last_errno () = Guestfs.Errno.errno_EINVAL then "" > + else raise exn in > + device <> "" && subvol <> "" Firstly I think device <> "" is always true. Secondly it wasn't obvious to me until I thought about it that you're testing if subvol is not equal to...
2015 Jun 18
3
[PATCH v2 0/3] daemon: parted: Always use -s option even with -m.
version 2: - Turn the "unrecognised disk label" error into errno == EINVAL - Fix virt-alignment-scan - Rework the fix for virt-v2v bug 1232192 (see description of patch 3/3)
2016 Jul 07
0
Re: [PATCH 1/3] mllib: add checking for btrfs subvolume
...uot;) > > + > > +let is_btrfs_subvolume g fs = > > + let device = g#mountable_device fs in > > + let subvol = > > + try > > + g#mountable_subvolume fs > > + with Guestfs.Error msg as exn -> > > + if g#last_errno () = Guestfs.Errno.errno_EINVAL then "" > > + else raise exn in > > + device <> "" && subvol <> "" > > Firstly I think device <> "" is always true. > > Secondly it wasn't obvious to me until I thought about it that you're &gt...
2016 Jul 07
7
[PATCH 0/3] fix btrfs subvolume procession in tools
This patcheset fixes errors in virt-sysprep and virt-sparsify. Here we have a common functionality: is_btrfs_subvolume. Doesn't it make sense to turn it into guestfs API? Also I found an issue. In 'virt-sysprep fs-uuids', the uuids for ALL filesystems are regenerated as many times as many roots are in guest. Is it done intentionally? Maxim Perevedentsev (3): mllib: add checking
2015 Aug 24
3
[PATCH 1/3] ocaml: dynamically generate the content of Guestfs.Errno
...uot;ESRCH"; +] + (* Generate the OCaml bindings interface. *) let rec generate_ocaml_mli () = generate_header OCamlStyle LGPLv2plus; @@ -132,10 +140,12 @@ val last_errno : t -> int which you can use to test the return value of {!Guestfs.last_errno}. *) module Errno : sig - val errno_EINVAL : int - val errno_ENOTSUP : int - val errno_EPERM : int - val errno_ESRCH : int +"; + List.iter ( + fun e -> + pr " val errno_%s : int\n" e + ) ocaml_errnos; + pr "\ end "; @@ -287,14 +297,15 @@ external event_to_string : event list -> string exter...
2016 Jun 13
1
[PATCH] v2v: Fix get_firmware_bootable_device.
I'm going to push this because it's a test blocker, but FYI. Rich.
2016 Jul 07
0
[PATCH 1/3] mllib: add checking for btrfs subvolume
...ect_mount_root_ro = inspect_mount_root ~mount_opts_fn:(fun _ -> "ro") + +let is_btrfs_subvolume g fs = + let device = g#mountable_device fs in + let subvol = + try + g#mountable_subvolume fs + with Guestfs.Error msg as exn -> + if g#last_errno () = Guestfs.Errno.errno_EINVAL then "" + else raise exn in + device <> "" && subvol <> "" diff --git a/mllib/common_utils.mli b/mllib/common_utils.mli index 5b0b9bb..d2ed30c 100644 --- a/mllib/common_utils.mli +++ b/mllib/common_utils.mli @@ -330,3 +330,6 @@ val inspect_mou...
2016 Jul 08
0
[PATCHv2 1/3] mllib: add checking for btrfs subvolume
...ect_mount_root g ?mount_opts_fn root = let inspect_mount_root_ro = inspect_mount_root ~mount_opts_fn:(fun _ -> "ro") + +let is_btrfs_subvolume g fs = + try + ignore (g#mountable_subvolume fs); true + with Guestfs.Error msg as exn -> + if g#last_errno () = Guestfs.Errno.errno_EINVAL then false + else raise exn diff --git a/mllib/common_utils.mli b/mllib/common_utils.mli index 5b0b9bb..d2ed30c 100644 --- a/mllib/common_utils.mli +++ b/mllib/common_utils.mli @@ -330,3 +330,6 @@ val inspect_mount_root : Guestfs.guestfs -> ?mount_opts_fn:(string -> string) -> val insp...
2018 Sep 20
2
Re: [PATCH 2/2] Introduce a --key option in tools that accept keys
This would have been a bit easier to review if the keystore changes had been broken out from the tools changes. On Wed, Sep 19, 2018 at 12:37:01PM +0200, Pino Toscano wrote: > @@ -599,13 +621,21 @@ let is_btrfs_subvolume g fs = > if g#last_errno () = Guestfs.Errno.errno_EINVAL then false > else raise exn > > -let inspect_decrypt g = > +let inspect_decrypt g ks = > + (* Turn the keys in the key_store into a simpler struct, so it is possible > + * to read it using the C API. > + *) > + let keys_as_list = Hashtbl.fold ( > + fun k v...
2016 Jul 08
4
[PATCHv2 0/3] fix btrfs subvolume procession in tools
sparsify case: modified guestfs_is_lv mllib: fixed is_btrfs_subvolume Maxim Perevedentsev (3): mllib: add checking for btrfs subvolume lvm: modify guestfs_is_lv to take mountable sysprep: fix btrfs subvolume processing in fs-uuids daemon/lvm.c | 6 ++++-- generator/actions.ml | 6 +++--- mllib/common_utils.ml | 7 +++++++
2020 Jan 22
0
[PATCH] mltools, options: support --allow-discards when decrypting LUKS devices
...stdin : unit -> unit = "guestfs_int_mllib_set_keys_from_stdin" "noalloc" external c_rfc3339_date_time_string : unit -> string = "guestfs_int_mllib_rfc3339_date_time_string" @@ -650,7 +650,7 @@ let is_btrfs_subvolume g fs = if g#last_errno () = Guestfs.Errno.errno_EINVAL then false else raise 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....
2016 Sep 19
0
[PATCH 2/3] mllib: expose disk decrypt functionalities
...s_"Read passphrases from stdin"; + ] + else []) in Getopt.create argspec ?anon_fun usage_msg (* Compare two version strings intelligently. *) @@ -998,3 +1010,11 @@ let is_btrfs_subvolume g fs = with Guestfs.Error msg as exn -> if g#last_errno () = Guestfs.Errno.errno_EINVAL then false else raise 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. +...
2016 Jun 10
0
Re: [PATCH 1/2] v2v: fill the list of the EFI system partitions
...; + sprintf "%s%d" dev (Int32.to_int partnum) > and parttype_is_gpt dev = > try g#part_get_parttype dev = "gpt" > with G.Error msg as exn -> > @@ -164,14 +166,25 @@ and has_uefi_bootable_device g = > if g#last_errno () <> G.Errno.errno_EINVAL then raise exn; > debug "%s (ignored)" msg; > false > - and is_uefi_bootable_device dev = > - parttype_is_gpt dev && ( > - let partitions = Array.to_list (g#part_list dev) in > - List.exists (is_uefi_ESP dev) partitions > -...
2020 Jan 27
3
[PATCH v2 1/2] mltools, options: support --allow-discards when decrypting LUKS devices
...stdin : unit -> unit = "guestfs_int_mllib_set_keys_from_stdin" "noalloc" external c_rfc3339_date_time_string : unit -> string = "guestfs_int_mllib_rfc3339_date_time_string" @@ -650,7 +650,7 @@ let is_btrfs_subvolume g fs = if g#last_errno () = Guestfs.Errno.errno_EINVAL then false else raise 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....
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 +-
2020 Jan 21
12
[PATCH 0/1] WIP: Support LUKS-encrypted partitions
The following patch attempts to implement sparsification of LUKS-encrypted partitions. It uses lsblk to pair the underlying LUKS block device with its mapped name. Also, --allow-discards was added by default to luks_open(). There are several potential issues that I can think of: 1) If and entire device is encrypted (not just one of more partitions), the lsblk trick might not work. 2) The
2016 May 22
0
[PATCH 2/2] ocaml tools: Use a common debug function.
...%s" (string_of_inspect inspect); sanity_check_inspection inspect; @@ -162,7 +162,7 @@ and has_uefi_bootable_device g = with G.Error msg as exn -> (* If it's _not_ "unrecognised disk label" then re-raise it. *) if g#last_errno () <> G.Errno.errno_EINVAL then raise exn; - if verbose () then printf "%s (ignored)\n" msg; + debug "%s (ignored)" msg; false and is_uefi_bootable_device dev = parttype_is_gpt dev && ( diff --git a/v2v/linux.ml b/v2v/linux.ml index bffe566..01aaf7d 100644 --- a/v...
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.
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
2018 Sep 19
0
[PATCH 2/2] Introduce a --key option in tools that accept keys
...(machine_read else []) in let getopt = Getopt.create argspec ?anon_fun usage_msg in { - getopt; + getopt; ks; } (* Run an external command, slurp up the output as a list of lines. *) @@ -599,13 +621,21 @@ let is_btrfs_subvolume g fs = if g#last_errno () = Guestfs.Errno.errno_EINVAL then false else raise exn -let inspect_decrypt g = +let inspect_decrypt g ks = + (* Turn the keys in the key_store into a simpler struct, so it is possible + * to read it using the C API. + *) + let keys_as_list = Hashtbl.fold ( + fun k v acc -> + (k, v) :: acc + ) ks.keys...