Displaying 20 results from an estimated 28 matches for "mem_assoc".
2015 Oct 06
1
[PATCH] builder: Remove duplicate planner transition.
...+++ b/builder/builder.ml
@@ -456,10 +456,9 @@ let main () =
* Don't run 'qemu-img resize' on an auto format. This is to
* force an explicit conversion step to a real format.
*)
- else if output_size > old_size && is_not `Template && List.mem_assoc `Format itags then (
+ else if output_size > old_size && is_not `Template
+ && List.mem_assoc `Format itags then
tr `Disk_resize 60 ((`Size, Int64.to_string output_size) :: itags);
- tr `Disk_resize 60 ((`Size, Int64.to_string output_size) :: ita...
2015 Dec 04
1
[PATCH] builder: create temporary images in the cachedir (RHBZ#1288201)
.../builder.ml
index 957bc37..3750e5f 100644
--- a/builder/builder.ml
+++ b/builder/builder.ml
@@ -378,6 +378,8 @@ let main () =
goal_must, goal_must_not in
+ let cache_dir = (open_guestfs ())#get_cachedir () in
+
(* Planner: Transitions. *)
let transitions itags =
let is t = List.mem_assoc t itags in
@@ -394,7 +396,7 @@ let main () =
(* Since the final plan won't run in parallel, we don't only need
* to choose unique tempfiles per transition, so this is OK:
*)
- let tempfile = Filename.temp_file "vb" ".img" in
+ let tempfile = Filena...
2014 Jan 22
2
[PATCH] builder: read all the available notes from the index
Switch the internal storage for the notes of each entry to a sorted list
with all the subkeys available (which should represent the translations
to various languages).
The current outputs are the same (i.e. still the untranslated notes), so
this is just internal refactoring/preparation.
---
builder/builder.ml | 4 ++--
builder/index_parser.ml | 19 +++++++++++++++----
2014 Jan 22
0
Re: [PATCH] builder: read all the available notes from the index
...tes *)
which will print the first set of notes that happen to be in the index
(in any language), which is fine for the current index that only has
one set of notes per template.
Later when you actually implement language support you're going to
have to use List.assoc, so:
| notes when List.mem_assoc "en" notes ->
printf "notes = %s" (List.assoc "en" notes)
| [] ->
printf "no notes"
(or something cleverer to deal with the current locale).
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-df l...
2017 Oct 08
0
[PATCH v2 1/4] common/mlstdutils: Extend the List module.
...l find_all : ('a -> bool) -> 'a list -> 'a list
+ val partition : ('a -> bool) -> 'a list -> 'a list * 'a list
+ val assoc : 'a -> ('a * 'b) list -> 'b
+ val assq : 'a -> ('a * 'b) list -> 'b
+ val mem_assoc : 'a -> ('a * 'b) list -> bool
+ val mem_assq : 'a -> ('a * 'b) list -> bool
+ val remove_assoc : 'a -> ('a * 'b) list -> ('a * 'b) list
+ val remove_assq : 'a -> ('a * 'b) list -> ('a * 'b) list
+ v...
2020 May 15
1
[PATCH] v2v: fix UEFI bootloader for linux guests
...r %s %d") distro distro_ver;
+ cant_fix_uefi ()
+ )
+
(* Grub1 (AKA grub-legacy) representation. *)
class bootloader_grub1 (g : G.guestfs) inspect grub_config =
let () =
@@ -60,6 +170,16 @@ class bootloader_grub1 (g : G.guestfs) inspect grub_config =
fun path -> List.mem_assoc path mounts
) [ "/boot/grub"; "/boot" ]
with Not_found -> "" in
+
+ let uefi_active =
+ match inspect.i_firmware with
+ | I_UEFI _ -> true
+ | _ -> false in
+
+ let arch = inspect.i_arch in
+ let distro = inspect.i_distro in
+ let dist...
2014 Jan 23
2
Re: [PATCH] builder: read all the available notes from the index
...nothing if there
are notes[..]= entries but no notes= one.
Other than that, sorting the list will help later when printing all the
translated notes to JSON.
> Later when you actually implement language support you're going to
>
> have to use List.assoc, so:
> | notes when List.mem_assoc "en" notes ->
>
> printf "notes = %s" (List.assoc "en" notes)
>
> | [] ->
>
> printf "no notes"
>
> (or something cleverer to deal with the current locale).
Yes, that's my step following this one, i.e. print...
2016 Aug 15
2
[PATCH v2] v2v: factor out bootloader handling
...+(* Grub1 (AKA grub-legacy) representation. *)
+class bootloader_grub1 (g : G.guestfs) inspect grub_config =
+ (* Grub prefix? Usually "/boot". *)
+ let grub_prefix =
+ let mounts = g#inspect_get_mountpoints inspect.i_root in
+ try
+ List.find (
+ fun path -> List.mem_assoc path mounts
+ ) [ "/boot/grub"; "/boot" ]
+ with Not_found -> "" in
+object
+ inherit bootloader
+
+ method name = "grub1"
+
+ method augeas_device_patterns = [
+ "/files" ^ grub_config ^ "/*/kernel/root";
+ "/file...
2017 Oct 03
0
[PATCH v2 2/2] builder: Choose better weights in the planner.
...((`Size, Int64.to_string output_size) ::
(`Filename, tempfile) ::
(`Format, output_format) :: (remove `Template itags))
@@ -485,15 +531,15 @@ let main () =
*)
else if output_size > old_size && is_not `Template
&& List.mem_assoc `Format itags then
- tr `Disk_resize 60 ((`Size, Int64.to_string output_size) :: itags);
+ tr `Disk_resize ((`Size, Int64.to_string output_size) :: itags);
(* qemu-img convert is always possible, and quicker. It doesn't
* resize, but it does change the format....
2015 Nov 20
0
[PATCH] v2v: factor out bootloader handling
...d.*)\\(.*\\)" in
+ Str.replace_first rex "\\1" path
+
+(* Grub1 (AKA grub-legacy) representation. *)
+class bootloader_grub1 g inspect grub_config =
+ let prefix =
+ let mounts = g#inspect_get_mountpoints inspect.i_root in
+ try
+ List.find (
+ fun path -> List.mem_assoc path mounts
+ ) [ "/boot/grub"; "/boot" ]
+ with Not_found -> "" in
+object
+ inherit bootloader
+
+ method name = "grub1"
+
+ method augeas_device_patterns = [
+ "/files" ^ grub_config ^ "/*/kernel/root";
+ "/file...
2016 Aug 15
0
Re: [PATCH v2] v2v: factor out bootloader handling
...entation. *)
> +class bootloader_grub1 (g : G.guestfs) inspect grub_config =
> + (* Grub prefix? Usually "/boot". *)
> + let grub_prefix =
> + let mounts = g#inspect_get_mountpoints inspect.i_root in
> + try
> + List.find (
> + fun path -> List.mem_assoc path mounts
> + ) [ "/boot/grub"; "/boot" ]
> + with Not_found -> "" in
> +object
> + inherit bootloader
> +
> + method name = "grub1"
> +
> + method augeas_device_patterns = [
> + "/files" ^ grub_config ^...
2016 Aug 25
2
[PATCH v2] v2v: factor out bootloader handling
...boot/efi/EFI/redhat/grub.conf" then (
- g#aug_transform "grub" "/boot/efi/EFI/redhat/grub.conf";
- Linux.augeas_reload g;
- );
-
- let mounts = g#inspect_get_mountpoints inspect.i_root in
- try
- List.find (
- fun path -> List.mem_assoc path mounts
- ) [ "/boot/grub"; "/boot" ]
- with Not_found -> "" in
+ (* Detect the installed bootloader. *)
+ let bootloader = Linux_bootloaders.detect_bootloader g inspect in
+ Linux.augeas_reload g;
(* What kernel/kernel-like packages are inst...
2019 Sep 20
0
[PATCH v4 01/12] v2v: Factor out the nbdkit VDDK code into a new module.
...right path in the ‘-io vddk-libdir’ option, or your copy of the VDDK directory is incomplete. There should be a library called ’<libdir>/%s/libvixDiskLib.so.?’.
-
-See also the virt-v2v-input-vmware(1) manual.") libNN
- )
- in
-
let error_unless_thumbprint () =
if not (List.mem_assoc "thumbprint" vddk_options) then
error (f_"You must pass the ‘-io vddk-thumbprint’ option with the SSL thumbprint of the VMware server. To find the thumbprint, see the nbdkit-vddk-plugin(1) manual. See also the virt-v2v-input-vmware(1) manual.")
in
- (* Check that...
2017 Oct 04
2
[PATCH v3 0/2] builder: Choose better weights in the planner.
v2 -> v3:
- Drop gnulib fallback.
2017 Oct 02
3
[PATCH 0/2] builder: Choose better weights in the planner.
It started out as "this'll be just a simple fix ..."
and turned into something a bit over-engineered in the end.
Here it is anyway.
Rich.
2017 Oct 03
4
[PATCH v2 0/2] builder: Choose better weights in the planner.
v1 -> v2:
- Removed the f_type field from StatVFS.statvfs structure.
- New function StatVFS.filesystem_is_remote, written in C.
[Thinking about it, this should probably be called
?is_network_filesystem?, but I can change that before
pushing].
- Use statvfs instead of fstatvfs, and statfs instead of fstatfs.
- Rejigged the comments in builder/builder.ml to make them simpler
2018 Mar 22
0
[PATCH v7 4/6] v2v: Add general mechanism for input and output options (-io/-oo).
...ons.vddk_thumbprint = None then
- error (f_"You must pass the ‘--vddk-thumbprint’ option with the SSL thumbprint of the VMware server. To find the thumbprint, see the nbdkit-vddk-plugin(1) manual. See also \"INPUT FROM VDDK\" in the virt-v2v(1) manual.")
+ if not (List.mem_assoc "vddk-thumbprint" vddk_options) then
+ error (f_"You must pass the ‘-io vddk-thumbprint’ option with the SSL thumbprint of the VMware server. To find the thumbprint, see the nbdkit-vddk-plugin(1) manual. See also \"INPUT FROM VDDK\" in the virt-v2v(1) manual.")...
2018 Mar 27
1
Re: [PATCH v7 4/6] v2v: Add general mechanism for input and output options (-io/-oo).
...humbprint = None then
> - error (f_"You must pass the ‘--vddk-thumbprint’ option with the SSL thumbprint of the VMware server. To find the thumbprint, see the nbdkit-vddk-plugin(1) manual. See also \"INPUT FROM VDDK\" in the virt-v2v(1) manual.")
> + if not (List.mem_assoc "vddk-thumbprint" vddk_options) then
> + error (f_"You must pass the ‘-io vddk-thumbprint’ option with the SSL thumbprint of the VMware server. To find the thumbprint, see the nbdkit-vddk-plugin(1) manual. See also \"INPUT FROM VDDK\" in the virt-v2v(1) manual.&qu...
2018 Mar 22
4
[PATCH INCOMPLETE 0/4] v2v: Add general mechanism for input and output options.
This patch isn't quite complete (see ‘assert false’).
Currently we have a bunch of ad hoc options like --vddk* and --vdsm*
(and proposed to add --rhv*) to handle extra parameters for input and
output modes/transports. This complicates the command line parsing
and also the clarity of the command line (becauseit's not very obvious
which options apply to which side of the conversion).
2019 Apr 08
12
[PATCH 00/11] v2v: Change virt-v2v to use nbdkit for input in several modes.
This series (except the last one) changes virt-v2v to use nbdkit for
several input modes:
-i vmx -it vddk: No change in functionality, as this already uses
nbdkit-vddk-plugin, but the code is refactored for the other modes to
use.
-i libvirtxml: Use nbdkit-curl-plugin instead of qemu curl.
vCenter: Use nbdkit-curl-plugin instead of qemu curl.
xen: Use nbdkit-ssh-plugin instead of qemu