Rebase to guestfs-tools 1.50.1
resolves: rhbz#2168626 Fix virt-drivers inspection of RHEL 9.2 guests resolves: rhbz#2184963
This commit is contained in:
parent
85fb9e087c
commit
66a8e05233
@ -1,4 +1,4 @@
|
||||
From 3c9689e96d8b0fb6476eff22953b9c512421b9fc Mon Sep 17 00:00:00 2001
|
||||
From b4f4e1906b8de6286889690047e35969d2dfaa91 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Tue, 7 Jul 2015 09:28:03 -0400
|
||||
Subject: [PATCH] RHEL: Reject use of libguestfs-winsupport features except for
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 10a4be467d84f5733cc696b7a0ed971fc1f35f3f Mon Sep 17 00:00:00 2001
|
||||
From 01ebf5d7d5656b45168de9081906522a32008080 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Mon, 21 Nov 2022 13:03:22 +0000
|
||||
Subject: [PATCH] RHEL: builder: Disable opensuse repository
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 7259f17fbb6d4e8bd8810541d77d06baebb24370 Mon Sep 17 00:00:00 2001
|
||||
From e9f49fd262d0ce5e18789cb2e03225246fc65658 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Tue, 7 Feb 2023 13:20:36 +0000
|
||||
Subject: [PATCH] Remove virt-dib
|
||||
@ -142,7 +142,7 @@ index b93a00118..bb9a71ebf 100644
|
||||
{
|
||||
_guestfs_virttools "virt-df" 1
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 1f8acced2..e7fcff136 100644
|
||||
index 24a89d640..34c66b80e 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -136,7 +136,6 @@ AC_CONFIG_FILES([Makefile
|
||||
@ -661,7 +661,7 @@ index 5c82efd60..000000000
|
||||
-val parse_cmdline : unit -> cmdline
|
||||
diff --git a/dib/dib.ml b/dib/dib.ml
|
||||
deleted file mode 100644
|
||||
index a4ba36040..000000000
|
||||
index 9ae154b86..000000000
|
||||
--- a/dib/dib.ml
|
||||
+++ /dev/null
|
||||
@@ -1,1007 +0,0 @@
|
||||
@ -1388,8 +1388,8 @@ index a4ba36040..000000000
|
||||
-
|
||||
- let g, tmpdisk, tmpdiskfmt, drive_partition =
|
||||
- let g = open_guestfs () in
|
||||
- Option.may g#set_memsize cmdline.memsize;
|
||||
- Option.may g#set_smp cmdline.smp;
|
||||
- Option.iter g#set_memsize cmdline.memsize;
|
||||
- Option.iter g#set_smp cmdline.smp;
|
||||
- g#set_network cmdline.network;
|
||||
-
|
||||
- (* Main disk with the built image. *)
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 850f26459cdd568db8ee870d41b317f886854750 Mon Sep 17 00:00:00 2001
|
||||
From ec06f62df5340cd0a9466a532aa9806fb0e2e560 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Sat, 18 Feb 2023 12:04:04 +0000
|
||||
Subject: [PATCH] drivers: Look up vendor and device names in PCI and USB IDs
|
||||
@ -7,7 +7,6 @@ Subject: [PATCH] drivers: Look up vendor and device names in PCI and USB IDs
|
||||
(cherry picked from commit ca21ee4918cd7d4472bd875a495752a03a03fa87)
|
||||
---
|
||||
.gitignore | 1 +
|
||||
common | 2 +-
|
||||
configure.ac | 1 +
|
||||
drivers/Makefile.am | 6 +-
|
||||
drivers/drivers.ml | 31 +++++
|
||||
@ -18,7 +17,7 @@ Subject: [PATCH] drivers: Look up vendor and device names in PCI and USB IDs
|
||||
drivers/test-virt-drivers-windows.sh | 13 +-
|
||||
m4/guestfs-libraries.m4 | 3 +
|
||||
po/POTFILES-ml | 2 +
|
||||
12 files changed, 334 insertions(+), 4 deletions(-)
|
||||
11 files changed, 333 insertions(+), 3 deletions(-)
|
||||
create mode 100644 drivers/hwdata.ml
|
||||
create mode 100644 drivers/hwdata.mli
|
||||
create mode 100644 drivers/hwdata_config.ml.in
|
||||
@ -36,125 +35,8 @@ index b0ada2e3c..c0ca330a3 100644
|
||||
/drivers/virt-drivers
|
||||
/diff/virt-diff
|
||||
/edit/virt-edit
|
||||
Submodule common 007d0506c..90e0077e2:
|
||||
diff --git a/common/mlstdutils/std_utils.ml b/common/mlstdutils/std_utils.ml
|
||||
index 323bfec..0d2fa22 100644
|
||||
--- a/common/mlstdutils/std_utils.ml
|
||||
+++ b/common/mlstdutils/std_utils.ml
|
||||
@@ -139,13 +139,19 @@ module String = struct
|
||||
done;
|
||||
if not !r then s else Bytes.to_string b2
|
||||
|
||||
+ let break n str =
|
||||
+ let len = String.length str in
|
||||
+ if n < 0 then "", str
|
||||
+ else if n >= len then str, ""
|
||||
+ else sub str 0 n, sub str n (len-n)
|
||||
+
|
||||
let rec split sep str =
|
||||
- let len = length sep in
|
||||
- let seplen = length str in
|
||||
+ let seplen = length sep in
|
||||
+ let strlen = length str in
|
||||
let i = find str sep in
|
||||
if i = -1 then str, ""
|
||||
else (
|
||||
- sub str 0 i, sub str (i + len) (seplen - i - len)
|
||||
+ sub str 0 i, sub str (i + seplen) (strlen - i - seplen)
|
||||
)
|
||||
|
||||
and nsplit ?(max = 0) sep str =
|
||||
@@ -287,6 +293,25 @@ module List = struct
|
||||
| x :: xs when f x -> x :: takewhile f xs
|
||||
| _ -> []
|
||||
|
||||
+ let take n xs =
|
||||
+ if n <= 0 then []
|
||||
+ else (
|
||||
+ (* This optimisation avoids copying xs. *)
|
||||
+ let len = List.length xs in
|
||||
+ if len <= n then xs
|
||||
+ else (
|
||||
+ let rec take n = function
|
||||
+ | x :: xs when n >= 1 -> x :: take (n-1) xs
|
||||
+ | _ -> []
|
||||
+ in
|
||||
+ take n xs
|
||||
+ )
|
||||
+ )
|
||||
+ let rec drop n xs =
|
||||
+ if n <= 0 then xs
|
||||
+ else if xs = [] then []
|
||||
+ else drop (n-1) (List.tl xs)
|
||||
+
|
||||
let rec filter_map f = function
|
||||
| [] -> []
|
||||
| x :: xs ->
|
||||
diff --git a/common/mlstdutils/std_utils.mli b/common/mlstdutils/std_utils.mli
|
||||
index d576243..a39ac5f 100644
|
||||
--- a/common/mlstdutils/std_utils.mli
|
||||
+++ b/common/mlstdutils/std_utils.mli
|
||||
@@ -87,6 +87,10 @@ module String : sig
|
||||
[str] with [s2]. *)
|
||||
val replace_char : string -> char -> char -> string
|
||||
(** Replace character in string. *)
|
||||
+ val break : int -> string -> string * string
|
||||
+ (** [break n str] breaks a string at the nth byte, returning the
|
||||
+ first and second parts. If [n] is beyond the end of the
|
||||
+ string it returns [(str, "")]. *)
|
||||
val split : string -> string -> string * string
|
||||
(** [split sep str] splits [str] at the first occurrence of the
|
||||
separator [sep], returning the part before and the part after.
|
||||
@@ -193,6 +197,16 @@ module List : sig
|
||||
|
||||
For any list [xs] and function [f],
|
||||
[xs = takewhile f xs @ dropwhile f xs] *)
|
||||
+
|
||||
+ val take : int -> 'a list -> 'a list
|
||||
+ (** [take n xs] returns the first [n] elements of [xs]. If [xs] is
|
||||
+ shorter than [n], then it returns [xs]. Note it never fails
|
||||
+ for any input. *)
|
||||
+ val drop : int -> 'a list -> 'a list
|
||||
+ (** [drop n xs] returns the suffix of [xs] after the first [n]
|
||||
+ elements. If [xs] is shorter than [n], then it returns the empty
|
||||
+ list. Note it never fails for any input. *)
|
||||
+
|
||||
val filter_map : ('a -> 'b option) -> 'a list -> 'b list
|
||||
(** [filter_map f xs] applies [f] to each element of [xs]. If
|
||||
[f x] returns [Some y] then [y] is added to the returned list. *)
|
||||
diff --git a/common/mlstdutils/std_utils_tests.ml b/common/mlstdutils/std_utils_tests.ml
|
||||
index d161b5e..3f5bb1a 100644
|
||||
--- a/common/mlstdutils/std_utils_tests.ml
|
||||
+++ b/common/mlstdutils/std_utils_tests.ml
|
||||
@@ -85,6 +85,18 @@ let test_string_find ctx =
|
||||
assert_equal_int (-1) (String.find "" "baz");
|
||||
assert_equal_int (-1) (String.find "foobar" "baz")
|
||||
|
||||
+(* Test Std_utils.String.break. *)
|
||||
+let test_string_break ctx =
|
||||
+ assert_equal_stringpair ("a", "b") (String.break 1 "ab");
|
||||
+ assert_equal_stringpair ("", "ab") (String.break 0 "ab");
|
||||
+ assert_equal_stringpair ("", "ab") (String.break (-1) "ab");
|
||||
+ assert_equal_stringpair ("ab", "") (String.break 2 "ab");
|
||||
+ assert_equal_stringpair ("ab", "") (String.break 3 "ab");
|
||||
+ assert_equal_stringpair ("abc", "def") (String.break 3 "abcdef");
|
||||
+ assert_equal_stringpair ("", "") (String.break 0 "");
|
||||
+ assert_equal_stringpair ("", "") (String.break (-2) "");
|
||||
+ assert_equal_stringpair ("", "") (String.break 2 "")
|
||||
+
|
||||
(* Test Std_utils.String.split. *)
|
||||
let test_string_split ctx =
|
||||
assert_equal_stringpair ("a", "b") (String.split " " "a b");
|
||||
@@ -169,6 +181,7 @@ let suite =
|
||||
"char.mem" >:: test_char_mem;
|
||||
"strings.is_prefix" >:: test_string_is_prefix;
|
||||
"strings.is_suffix" >:: test_string_is_suffix;
|
||||
+ "strings.break" >:: test_string_break;
|
||||
"strings.find" >:: test_string_find;
|
||||
"strings.split" >:: test_string_split;
|
||||
"strings.nsplit" >:: test_string_nsplit;
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index e7fcff136..059cfbf90 100644
|
||||
index 34c66b80e..e9fadcc9b 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -138,6 +138,7 @@ AC_CONFIG_FILES([Makefile
|
@ -1,23 +0,0 @@
|
||||
From f89df0e54aef85fe1dec995064f7d3ba6453409e Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Sat, 18 Feb 2023 12:03:26 +0000
|
||||
Subject: [PATCH] drivers/drivers.mli: Fix copy and paste error in comment
|
||||
|
||||
(cherry picked from commit de7e4ec1245d40a189dd97a50f28a85b9a80e718)
|
||||
---
|
||||
drivers/drivers.mli | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/drivers.mli b/drivers/drivers.mli
|
||||
index 4437e461c..8a67b77a2 100644
|
||||
--- a/drivers/drivers.mli
|
||||
+++ b/drivers/drivers.mli
|
||||
@@ -1,4 +1,4 @@
|
||||
-(* virt-get-kernel
|
||||
+(* virt-drivers
|
||||
* Copyright (C) 2013-2023 Red Hat Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
--
|
||||
2.31.1
|
||||
|
@ -1,312 +0,0 @@
|
||||
From a84c1359ed0943e5140e9170fa05126b590c2873 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Mon, 20 Feb 2023 12:01:21 +0000
|
||||
Subject: [PATCH] Rework Std_utils.Option so it works like the OCaml stdlib
|
||||
module
|
||||
|
||||
OCaml 4.08 introduces a stdlib Option module which looks a bit like
|
||||
ours but has a number of differences. In particular our functions
|
||||
Option.may and Option.default have no corresponding functions in
|
||||
stdlib, although there are close enough equivalents.
|
||||
|
||||
This change was automated using this command:
|
||||
|
||||
$ perl -pi.bak \
|
||||
-e 's/Option.may/Option.iter/g; s/Option.default /Option.value ~default:/g' \
|
||||
`git ls-files`
|
||||
|
||||
Update common module to include:
|
||||
|
||||
commit cffa077323fafcdfcf78e230c022afa891a6b3ff
|
||||
Author: Richard W.M. Jones <rjones@redhat.com>
|
||||
Date: Mon Feb 20 12:11:51 2023 +0000
|
||||
|
||||
mlstdutils: Rework the Option module to be compatible with stdlib
|
||||
|
||||
commit 007d0506c538db0a43fec7e9986a95ecdcd48b56
|
||||
Author: Richard W.M. Jones <rjones@redhat.com>
|
||||
Date: Mon Feb 20 12:18:29 2023 +0000
|
||||
|
||||
mltools: Replace Option.may with Option.iter
|
||||
|
||||
(cherry picked from commit 65bde3b531a2bcb7891a940a692c5a249c2f9340)
|
||||
---
|
||||
builder/builder.ml | 6 +++---
|
||||
builder/index.ml | 18 +++++++++---------
|
||||
builder/index_parser.ml | 14 +++++++-------
|
||||
builder/list_entries.ml | 8 ++++----
|
||||
common | 2 +-
|
||||
customize/customize_main.ml | 4 ++--
|
||||
resize/resize.ml | 8 ++++----
|
||||
sysprep/sysprep_operation.ml | 4 ++--
|
||||
8 files changed, 32 insertions(+), 32 deletions(-)
|
||||
|
||||
diff --git a/builder/builder.ml b/builder/builder.ml
|
||||
index 727aa8b23..15ece4e60 100644
|
||||
--- a/builder/builder.ml
|
||||
+++ b/builder/builder.ml
|
||||
@@ -723,8 +723,8 @@ let main () =
|
||||
let g =
|
||||
let g = open_guestfs () in
|
||||
|
||||
- Option.may g#set_memsize cmdline.memsize;
|
||||
- Option.may g#set_smp cmdline.smp;
|
||||
+ Option.iter g#set_memsize cmdline.memsize;
|
||||
+ Option.iter g#set_smp cmdline.smp;
|
||||
g#set_network cmdline.network;
|
||||
|
||||
(* The output disk is being created, so use cache=unsafe here. *)
|
||||
@@ -818,6 +818,6 @@ let main () =
|
||||
Pervasives.flush Pervasives.stdout;
|
||||
Pervasives.flush Pervasives.stderr;
|
||||
|
||||
- Option.may print_string stats
|
||||
+ Option.iter print_string stats
|
||||
|
||||
let () = run_main_and_handle_errors main
|
||||
diff --git a/builder/index.ml b/builder/index.ml
|
||||
index 03680f051..341a62356 100644
|
||||
--- a/builder/index.ml
|
||||
+++ b/builder/index.ml
|
||||
@@ -58,12 +58,12 @@ let print_entry chan (name, { printable_name; file_uri; arch; osinfo;
|
||||
notes; aliases; hidden }) =
|
||||
let fp fs = fprintf chan fs in
|
||||
fp "[%s]\n" name;
|
||||
- Option.may (fp "name=%s\n") printable_name;
|
||||
- Option.may (fp "osinfo=%s\n") osinfo;
|
||||
+ Option.iter (fp "name=%s\n") printable_name;
|
||||
+ Option.iter (fp "osinfo=%s\n") osinfo;
|
||||
fp "file=%s\n" file_uri;
|
||||
fp "arch=%s\n" (string_of_arch arch);
|
||||
- Option.may (fp "sig=%s\n") signature_uri;
|
||||
- Option.may (
|
||||
+ Option.iter (fp "sig=%s\n") signature_uri;
|
||||
+ Option.iter (
|
||||
List.iter (
|
||||
fun c ->
|
||||
fp "checksum[%s]=%s\n"
|
||||
@@ -71,16 +71,16 @@ let print_entry chan (name, { printable_name; file_uri; arch; osinfo;
|
||||
)
|
||||
) checksums;
|
||||
fp "revision=%s\n" (string_of_revision revision);
|
||||
- Option.may (fp "format=%s\n") format;
|
||||
+ Option.iter (fp "format=%s\n") format;
|
||||
fp "size=%Ld\n" size;
|
||||
- Option.may (fp "compressed_size=%Ld\n") compressed_size;
|
||||
- Option.may (fp "expand=%s\n") expand;
|
||||
- Option.may (fp "lvexpand=%s\n") lvexpand;
|
||||
+ Option.iter (fp "compressed_size=%Ld\n") compressed_size;
|
||||
+ Option.iter (fp "expand=%s\n") expand;
|
||||
+ Option.iter (fp "lvexpand=%s\n") lvexpand;
|
||||
List.iter (
|
||||
fun (lang, notes) ->
|
||||
match lang with
|
||||
| "" -> fp "notes=%s\n" notes
|
||||
| lang -> fp "notes[%s]=%s\n" lang notes
|
||||
) notes;
|
||||
- Option.may (fun l -> fp "aliases=%s\n" (String.concat " " l)) aliases;
|
||||
+ Option.iter (fun l -> fp "aliases=%s\n" (String.concat " " l)) aliases;
|
||||
if hidden then fp "hidden=true\n"
|
||||
diff --git a/builder/index_parser.ml b/builder/index_parser.ml
|
||||
index b4cb81e78..1c5bc26ca 100644
|
||||
--- a/builder/index_parser.ml
|
||||
+++ b/builder/index_parser.ml
|
||||
@@ -284,11 +284,11 @@ let write_entry chan (name, { Index.printable_name; file_uri; arch; osinfo;
|
||||
aliases; hidden}) =
|
||||
let fp fs = fprintf chan fs in
|
||||
fp "[%s]\n" name;
|
||||
- Option.may (fp "name=%s\n") printable_name;
|
||||
- Option.may (fp "osinfo=%s\n") osinfo;
|
||||
+ Option.iter (fp "name=%s\n") printable_name;
|
||||
+ Option.iter (fp "osinfo=%s\n") osinfo;
|
||||
fp "file=%s\n" file_uri;
|
||||
fp "arch=%s\n" (Index.string_of_arch arch);
|
||||
- Option.may (fp "sig=%s\n") signature_uri;
|
||||
+ Option.iter (fp "sig=%s\n") signature_uri;
|
||||
(match checksums with
|
||||
| None -> ()
|
||||
| Some checksums ->
|
||||
@@ -299,11 +299,11 @@ let write_entry chan (name, { Index.printable_name; file_uri; arch; osinfo;
|
||||
) checksums
|
||||
);
|
||||
fp "revision=%s\n" (string_of_revision revision);
|
||||
- Option.may (fp "format=%s\n") format;
|
||||
+ Option.iter (fp "format=%s\n") format;
|
||||
fp "size=%Ld\n" size;
|
||||
- Option.may (fp "compressed_size=%Ld\n") compressed_size;
|
||||
- Option.may (fp "expand=%s\n") expand;
|
||||
- Option.may (fp "lvexpand=%s\n") lvexpand;
|
||||
+ Option.iter (fp "compressed_size=%Ld\n") compressed_size;
|
||||
+ Option.iter (fp "expand=%s\n") expand;
|
||||
+ Option.iter (fp "lvexpand=%s\n") lvexpand;
|
||||
|
||||
let format_notes notes =
|
||||
String.concat "\n " (String.nsplit "\n" notes) in
|
||||
diff --git a/builder/list_entries.ml b/builder/list_entries.ml
|
||||
index 470d1b6ed..0690d5858 100644
|
||||
--- a/builder/list_entries.ml
|
||||
+++ b/builder/list_entries.ml
|
||||
@@ -47,7 +47,7 @@ and list_entries_short index =
|
||||
if not hidden then (
|
||||
printf "%-24s" name;
|
||||
printf " %-10s" (Index.string_of_arch arch);
|
||||
- Option.may (printf " %s") printable_name;
|
||||
+ Option.iter (printf " %s") printable_name;
|
||||
printf "\n"
|
||||
)
|
||||
) index
|
||||
@@ -73,13 +73,13 @@ and list_entries_long ~sources index =
|
||||
notes; aliases; hidden }) ->
|
||||
if not hidden then (
|
||||
printf "%-24s %s\n" "os-version:" name;
|
||||
- Option.may (printf "%-24s %s\n" (s_"Full name:")) printable_name;
|
||||
+ Option.iter (printf "%-24s %s\n" (s_"Full name:")) printable_name;
|
||||
printf "%-24s %s\n" (s_"Architecture:") (Index.string_of_arch arch);
|
||||
printf "%-24s %s\n" (s_"Minimum/default size:") (human_size size);
|
||||
- Option.may (fun size ->
|
||||
+ Option.iter (fun size ->
|
||||
printf "%-24s %s\n" (s_"Download size:") (human_size size)
|
||||
) compressed_size;
|
||||
- Option.may (
|
||||
+ Option.iter (
|
||||
fun l -> printf "%-24s %s\n" (s_"Aliases:") (String.concat " " l)
|
||||
) aliases;
|
||||
let notes = Languages.find_notes langs notes in
|
||||
Submodule common 53713420b..007d0506c:
|
||||
diff --git a/common/mlstdutils/std_utils.ml b/common/mlstdutils/std_utils.ml
|
||||
index ab6e71c..323bfec 100644
|
||||
--- a/common/mlstdutils/std_utils.ml
|
||||
+++ b/common/mlstdutils/std_utils.ml
|
||||
@@ -368,7 +368,7 @@ module List = struct
|
||||
end
|
||||
|
||||
module Option = struct
|
||||
- let may f = function
|
||||
+ let iter f = function
|
||||
| None -> ()
|
||||
| Some x -> f x
|
||||
|
||||
@@ -376,8 +376,9 @@ module Option = struct
|
||||
| None -> None
|
||||
| Some x -> Some (f x)
|
||||
|
||||
- let default def = function
|
||||
- | None -> def
|
||||
+ let value x ~default =
|
||||
+ match x with
|
||||
+ | None -> default
|
||||
| Some x -> x
|
||||
end
|
||||
|
||||
diff --git a/common/mlstdutils/std_utils.mli b/common/mlstdutils/std_utils.mli
|
||||
index 782d8fd..d576243 100644
|
||||
--- a/common/mlstdutils/std_utils.mli
|
||||
+++ b/common/mlstdutils/std_utils.mli
|
||||
@@ -277,16 +277,19 @@ end
|
||||
(** Override the List module from stdlib. *)
|
||||
|
||||
module Option : sig
|
||||
- val may : ('a -> unit) -> 'a option -> unit
|
||||
- (** [may f (Some x)] runs [f x]. [may f None] does nothing. *)
|
||||
+ val iter : ('a -> unit) -> 'a option -> unit
|
||||
+ (** [iter f o] is [f v] if [o] is [Some v] and [()] otherwise *)
|
||||
|
||||
val map : ('a -> 'b) -> 'a option -> 'b option
|
||||
(** [map f (Some x)] returns [Some (f x)]. [map f None] returns [None]. *)
|
||||
|
||||
- val default : 'a -> 'a option -> 'a
|
||||
- (** [default x (Some y)] returns [y]. [default x None] returns [x]. *)
|
||||
+ val value : 'a option -> default:'a -> 'a
|
||||
+ (** [value o ~default] is [v] if [o] is [Some v] and [default] otherwise. *)
|
||||
end
|
||||
-(** Functions for dealing with option types. *)
|
||||
+(** Functions for dealing with option types.
|
||||
+
|
||||
+ This module will be removed when we can use baseline OCaml 4.08
|
||||
+ since that version introduces a compatible [Option] module. *)
|
||||
|
||||
val ( // ) : string -> string -> string
|
||||
(** Concatenate directory and filename. *)
|
||||
diff --git a/common/mltools/tools_utils.ml b/common/mltools/tools_utils.ml
|
||||
index 562bfad..8b611e7 100644
|
||||
--- a/common/mltools/tools_utils.ml
|
||||
+++ b/common/mltools/tools_utils.ml
|
||||
@@ -218,7 +218,7 @@ let open_guestfs ?identifier () =
|
||||
g#parse_environment ();
|
||||
if trace () then g#set_trace true;
|
||||
if verbose () then g#set_verbose true;
|
||||
- Option.may g#set_identifier identifier;
|
||||
+ Option.iter g#set_identifier identifier;
|
||||
g
|
||||
|
||||
(* All the OCaml virt-* programs use this wrapper to catch exceptions
|
||||
@@ -523,8 +523,8 @@ and do_run ?(echo_cmd = true) ?stdout_fd ?stderr_fd args =
|
||||
Or 127
|
||||
|
||||
and do_teardown app outfd errfd exitstat =
|
||||
- Option.may Unix.close outfd;
|
||||
- Option.may Unix.close errfd;
|
||||
+ Option.iter Unix.close outfd;
|
||||
+ Option.iter Unix.close errfd;
|
||||
match exitstat with
|
||||
| Unix.WEXITED i ->
|
||||
i
|
||||
diff --git a/customize/customize_main.ml b/customize/customize_main.ml
|
||||
index f05375e1d..8622715ab 100644
|
||||
--- a/customize/customize_main.ml
|
||||
+++ b/customize/customize_main.ml
|
||||
@@ -163,8 +163,8 @@ read the man page virt-customize(1).
|
||||
(* Connect to libguestfs. *)
|
||||
let g =
|
||||
let g = open_guestfs () in
|
||||
- Option.may g#set_memsize memsize;
|
||||
- Option.may g#set_smp smp;
|
||||
+ Option.iter g#set_memsize memsize;
|
||||
+ Option.iter g#set_smp smp;
|
||||
(* [--no-network] from the command line takes precedence over the automatic
|
||||
* network enablement for [--key ID:clevis], so here we intentionally
|
||||
* don't check [key_store_requires_network opthandle.ks].
|
||||
diff --git a/resize/resize.ml b/resize/resize.ml
|
||||
index ee2fb2d92..3c3a5d7e3 100644
|
||||
--- a/resize/resize.ml
|
||||
+++ b/resize/resize.ml
|
||||
@@ -1072,7 +1072,7 @@ read the man page virt-resize(1).
|
||||
let ok =
|
||||
try
|
||||
g#part_init "/dev/sdb" parttype_string;
|
||||
- Option.may (g#part_set_disk_guid "/dev/sdb") disk_guid;
|
||||
+ Option.iter (g#part_set_disk_guid "/dev/sdb") disk_guid;
|
||||
true
|
||||
with G.Error error -> last_error := error; false in
|
||||
if ok then g, true
|
||||
@@ -1266,9 +1266,9 @@ read the man page virt-resize(1).
|
||||
if p.p_bootable then
|
||||
g#part_set_bootable "/dev/sdb" p.p_target_partnum true;
|
||||
|
||||
- Option.may (g#part_set_name "/dev/sdb" p.p_target_partnum) p.p_label;
|
||||
- Option.may (g#part_set_gpt_guid "/dev/sdb" p.p_target_partnum) p.p_guid;
|
||||
- Option.may (g#part_set_gpt_attributes "/dev/sdb" p.p_target_partnum)
|
||||
+ Option.iter (g#part_set_name "/dev/sdb" p.p_target_partnum) p.p_label;
|
||||
+ Option.iter (g#part_set_gpt_guid "/dev/sdb" p.p_target_partnum) p.p_guid;
|
||||
+ Option.iter (g#part_set_gpt_attributes "/dev/sdb" p.p_target_partnum)
|
||||
p.p_attributes;
|
||||
|
||||
match parttype, p.p_id with
|
||||
diff --git a/sysprep/sysprep_operation.ml b/sysprep/sysprep_operation.ml
|
||||
index 17c0440d4..0a5fce065 100644
|
||||
--- a/sysprep/sysprep_operation.ml
|
||||
+++ b/sysprep/sysprep_operation.ml
|
||||
@@ -190,8 +190,8 @@ let dump_pod () =
|
||||
if op.enabled_by_default then printf "*\n";
|
||||
printf "\n";
|
||||
printf "%s.\n\n" op.heading;
|
||||
- Option.may (printf "%s\n\n") op.pod_description;
|
||||
- Option.may (fun notes ->
|
||||
+ Option.iter (printf "%s\n\n") op.pod_description;
|
||||
+ Option.iter (fun notes ->
|
||||
printf "=head3 ";
|
||||
printf (f_"Notes on %s") op.name;
|
||||
printf "\n\n";
|
||||
--
|
||||
2.31.1
|
||||
|
@ -1,31 +0,0 @@
|
||||
From ac140e5031ca2e1a42427a0f187a9a9e34744b55 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Mon, 20 Feb 2023 15:54:22 +0000
|
||||
Subject: [PATCH] build: Remove non-existent ocaml/ directory from ocaml-dep
|
||||
script
|
||||
|
||||
This was left over from when we split out guestfs-tools from
|
||||
libguestfs. It was harmless except for a warning message about the
|
||||
absent directory when we rebuilt dependencies.
|
||||
|
||||
Fixes: commit 4354a3126152a2748cc9097cba139b3908ccc342
|
||||
(cherry picked from commit c7432768dedfc560618adf63877b8c3d1dda1a76)
|
||||
---
|
||||
ocaml-dep.sh.in | 1 -
|
||||
1 file changed, 1 deletion(-)
|
||||
|
||||
diff --git a/ocaml-dep.sh.in b/ocaml-dep.sh.in
|
||||
index a97403e18..9546a1d49 100755
|
||||
--- a/ocaml-dep.sh.in
|
||||
+++ b/ocaml-dep.sh.in
|
||||
@@ -43,7 +43,6 @@ common/mlutils
|
||||
common/mlvisit
|
||||
common/mlxml
|
||||
customize
|
||||
-ocaml
|
||||
"
|
||||
|
||||
# Output file is always created in the current directory.
|
||||
--
|
||||
2.31.1
|
||||
|
@ -1,48 +0,0 @@
|
||||
From 0488336bcce737b7dce33934d656ea7f07bb69bb Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Mon, 20 Feb 2023 17:39:22 +0000
|
||||
Subject: [PATCH] valgrind: Update for pcre2
|
||||
|
||||
I'm unclear why this error has suddenly appeared. We switched from
|
||||
pcre to pcre2 nearly two years ago. However it is clear that the
|
||||
existing suppression was incorrect and needs to be updated for pcre2.
|
||||
|
||||
==2036392== 154 bytes in 1 blocks are possibly lost in loss record 488 of 544
|
||||
==2036392== at 0x484186F: malloc (vg_replace_malloc.c:393)
|
||||
==2036392== by 0x4884035: pcre2_compile_8 (pcre2_compile.c:10250)
|
||||
==2036392== by 0x21DFA9: guestfs_int_pcre_compile (pcre-c.c:194)
|
||||
==2036392== by 0x2233F0: camlLinux_bootloaders__entry (linux_bootloaders.ml:4
|
||||
1)
|
||||
==2036392== by 0x20B138: caml_program (in /home/rjones/d/guestfs-tools/driver
|
||||
s/virt-drivers)
|
||||
==2036392== by 0x33B7E4: caml_start_program (in /home/rjones/d/guestfs-tools/
|
||||
drivers/virt-drivers)
|
||||
==2036392== by 0x33BB8E: caml_startup_common (in /home/rjones/d/guestfs-tools
|
||||
/drivers/virt-drivers)
|
||||
==2036392== by 0x33BBEC: caml_startup (in /home/rjones/d/guestfs-tools/driver
|
||||
s/virt-drivers)
|
||||
==2036392== by 0x20ABFF: main (in /home/rjones/d/guestfs-tools/drivers/virt-d
|
||||
rivers)
|
||||
|
||||
Fixes: commit 9ba454622b60d7550e892d8a49048014603b8e2a
|
||||
(cherry picked from commit f6c5f0c3d51bfd3cd764e81e5aeb035946643387)
|
||||
---
|
||||
valgrind-suppressions | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/valgrind-suppressions b/valgrind-suppressions
|
||||
index 4c8e37886..75d48f0a1 100644
|
||||
--- a/valgrind-suppressions
|
||||
+++ b/valgrind-suppressions
|
||||
@@ -197,7 +197,7 @@
|
||||
ocaml_pcre_globals
|
||||
Memcheck:Leak
|
||||
fun:malloc
|
||||
- fun:pcre_compile2
|
||||
+ fun:pcre2_compile_8
|
||||
...
|
||||
}
|
||||
|
||||
--
|
||||
2.31.1
|
||||
|
@ -1,53 +0,0 @@
|
||||
From e911cfc70371d572e71c26eaba4a6419a058241e Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Mon, 20 Feb 2023 17:46:55 +0000
|
||||
Subject: [PATCH] valgrind: Add another libvirt suppression
|
||||
|
||||
It seems as if this is just a variation on the previous libvirt
|
||||
suppression.
|
||||
|
||||
==2042391== 61 (48 direct, 13 indirect) bytes in 1 blocks are definitely lost in
|
||||
loss record 267 of 507
|
||||
==2042391== at 0x4846464: calloc (vg_replace_malloc.c:1340)
|
||||
==2042391== by 0x54EE318: g_malloc0 (gmem.c:163)
|
||||
==2042391== by 0x5017D4C: virClassNew (virobject.c:189)
|
||||
==2042391== by 0x523CCB9: virDataTypesOnce.lto_priv.0 (datatypes.c:111)
|
||||
==2042391== by 0x4D8BE42: __pthread_once_slow (pthread_once.c:116)
|
||||
==2042391== by 0x50345E1: virOnce (virthread.c:44)
|
||||
==2042391== by 0x523CD6A: virGetConnect (datatypes.c:121)
|
||||
==2042391== by 0x51FBC1F: virConnectOpenInternal (libvirt.c:893)
|
||||
==2042391== by 0x51FCC11: virConnectOpenAuth (libvirt.c:1271)
|
||||
==2042391== by 0x4A3ECAD: guestfs_int_open_libvirt_connection.constprop.0 (li
|
||||
bvirt-auth.c:224)
|
||||
==2042391== by 0x4A1D62A: launch_libvirt.lto_priv.0 (launch-libvirt.c:389)
|
||||
==2042391== by 0x4993739: guestfs_launch (launch.c:114)
|
||||
|
||||
(cherry picked from commit 8790af0266a808c8a04927bb5039be06cbc3da54)
|
||||
---
|
||||
valgrind-suppressions | 10 ++++++++++
|
||||
1 file changed, 10 insertions(+)
|
||||
|
||||
diff --git a/valgrind-suppressions b/valgrind-suppressions
|
||||
index 75d48f0a1..a13d82fb7 100644
|
||||
--- a/valgrind-suppressions
|
||||
+++ b/valgrind-suppressions
|
||||
@@ -329,6 +329,16 @@
|
||||
fun:virDataTypesOnce
|
||||
}
|
||||
|
||||
+{
|
||||
+ libvirt_leak_10
|
||||
+ Memcheck:Leak
|
||||
+ ...
|
||||
+ fun:g_malloc0
|
||||
+ fun:virClassNew
|
||||
+ ...
|
||||
+ fun:virOnce
|
||||
+}
|
||||
+
|
||||
# FUSE leaks the per-thread context (although the code looks
|
||||
# like it attempts to clean it up). In older fuse, it uses
|
||||
# malloc. In newer fuse it uses calloc.
|
||||
--
|
||||
2.31.1
|
||||
|
@ -1,60 +0,0 @@
|
||||
From 64ca97e910cc086af70b8cf0968cf5039afcb108 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Mon, 20 Feb 2023 17:03:41 +0000
|
||||
Subject: [PATCH] drivers: Swap the names of the tests
|
||||
|
||||
The names of the tests were reversed from what they actually did,
|
||||
causing confusion.
|
||||
|
||||
Fixes: commit d38d2ee5a3d4b09277cd97bc6f63004b7b7e697c
|
||||
(cherry picked from commit ecc562601b5f64778f5598d8663e3a052a0b6976)
|
||||
---
|
||||
drivers/test-virt-drivers-linux.sh | 10 +++++-----
|
||||
drivers/test-virt-drivers-windows.sh | 10 +++++-----
|
||||
2 files changed, 10 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/drivers/test-virt-drivers-linux.sh b/drivers/test-virt-drivers-linux.sh
|
||||
index df3f36c64..5404db1e5 100755
|
||||
--- a/drivers/test-virt-drivers-linux.sh
|
||||
+++ b/drivers/test-virt-drivers-linux.sh
|
||||
@@ -20,11 +20,11 @@ set -e
|
||||
|
||||
$TEST_FUNCTIONS
|
||||
skip_if_skipped
|
||||
-skip_unless_phony_guest windows.img
|
||||
+skip_unless_phony_guest fedora.img
|
||||
|
||||
-rm -f actual-windows.xml
|
||||
+rm -f actual-fedora.xml
|
||||
|
||||
-$VG virt-drivers --format=raw -a ../test-data/phony-guests/windows.img > actual-windows.xml
|
||||
-diff -ur -I "generated by" expected-windows.xml actual-windows.xml
|
||||
+$VG virt-drivers --format=raw -a ../test-data/phony-guests/fedora.img > actual-fedora.xml
|
||||
+diff -ur -I "generated by" expected-fedora.xml actual-fedora.xml
|
||||
|
||||
-rm actual-windows.xml
|
||||
+rm actual-fedora.xml
|
||||
diff --git a/drivers/test-virt-drivers-windows.sh b/drivers/test-virt-drivers-windows.sh
|
||||
index 5404db1e5..df3f36c64 100755
|
||||
--- a/drivers/test-virt-drivers-windows.sh
|
||||
+++ b/drivers/test-virt-drivers-windows.sh
|
||||
@@ -20,11 +20,11 @@ set -e
|
||||
|
||||
$TEST_FUNCTIONS
|
||||
skip_if_skipped
|
||||
-skip_unless_phony_guest fedora.img
|
||||
+skip_unless_phony_guest windows.img
|
||||
|
||||
-rm -f actual-fedora.xml
|
||||
+rm -f actual-windows.xml
|
||||
|
||||
-$VG virt-drivers --format=raw -a ../test-data/phony-guests/fedora.img > actual-fedora.xml
|
||||
-diff -ur -I "generated by" expected-fedora.xml actual-fedora.xml
|
||||
+$VG virt-drivers --format=raw -a ../test-data/phony-guests/windows.img > actual-windows.xml
|
||||
+diff -ur -I "generated by" expected-windows.xml actual-windows.xml
|
||||
|
||||
-rm actual-fedora.xml
|
||||
+rm actual-windows.xml
|
||||
--
|
||||
2.31.1
|
||||
|
@ -25,7 +25,7 @@
|
||||
|
||||
Summary: Tools to access and modify virtual machine disk images
|
||||
Name: guestfs-tools
|
||||
Version: 1.50.0
|
||||
Version: 1.50.1
|
||||
Release: 1%{?dist}
|
||||
License: GPLv2+
|
||||
|
||||
@ -58,13 +58,7 @@ Source3: copy-patches.sh
|
||||
Patch0001: 0001-RHEL-Reject-use-of-libguestfs-winsupport-features-ex.patch
|
||||
Patch0002: 0002-RHEL-builder-Disable-opensuse-repository.patch
|
||||
Patch0003: 0003-Remove-virt-dib.patch
|
||||
Patch0004: 0004-drivers-drivers.mli-Fix-copy-and-paste-error-in-comm.patch
|
||||
Patch0005: 0005-Rework-Std_utils.Option-so-it-works-like-the-OCaml-s.patch
|
||||
Patch0006: 0006-build-Remove-non-existent-ocaml-directory-from-ocaml.patch
|
||||
Patch0007: 0007-valgrind-Update-for-pcre2.patch
|
||||
Patch0008: 0008-valgrind-Add-another-libvirt-suppression.patch
|
||||
Patch0009: 0009-drivers-Swap-the-names-of-the-tests.patch
|
||||
Patch0010: 0010-drivers-Look-up-vendor-and-device-names-in-PCI-and-U.patch
|
||||
Patch0004: 0004-drivers-Look-up-vendor-and-device-names-in-PCI-and-U.patch
|
||||
|
||||
%if 0%{patches_touch_autotools}
|
||||
BuildRequires: autoconf, automake, libtool, gettext-devel
|
||||
@ -425,9 +419,11 @@ end
|
||||
|
||||
|
||||
%changelog
|
||||
* Thu Mar 02 2023 Richard W.M. Jones <rjones@redhat.com> - 1.50.0-1
|
||||
- Rebase to guestfs-tools 1.50.0
|
||||
* Thu Apr 06 2023 Richard W.M. Jones <rjones@redhat.com> - 1.50.1-1
|
||||
- Rebase to guestfs-tools 1.50.1
|
||||
resolves: rhbz#2168626
|
||||
- Fix virt-drivers inspection of RHEL 9.2 guests
|
||||
resolves: rhbz#2184963
|
||||
|
||||
* Thu Nov 24 2022 Richard W.M. Jones <rjones@redhat.com> - 1.48.2-8
|
||||
- Support Rocky Linux in virt-customize
|
||||
|
4
sources
4
sources
@ -1,2 +1,2 @@
|
||||
SHA512 (guestfs-tools-1.50.0.tar.gz) = 2ef136161e566bbbbe4e74eb046a954c755a27451469c9024c730cc1598be7326f9636ef9d1bf47ec6812370b6e780f825aaa59a819cc468e8e5d990f5a40315
|
||||
SHA512 (guestfs-tools-1.50.0.tar.gz.sig) = 1d2a35485ad328d40ddb72434fbb8d52c6d16c1db431b53cbcbc20d2d93e21551eb9af821a72c054053636d6606b7c93a56faeb0d7501167af978d251958cfd6
|
||||
SHA512 (guestfs-tools-1.50.1.tar.gz) = d4544dfbfbf4764f7d166fb6a97c2c3204e62aa96652020b63dd9a11233f314e811fad4a1a9dc053237b31140eaa6d30da8385c6bce4231ccc653f63afae4b89
|
||||
SHA512 (guestfs-tools-1.50.1.tar.gz.sig) = c4b987e039e69f5e0aa9322d70f47fc8cb6bf36ecfcd2a5936cc66bd1fef20e50a7354423ea832b51011b0443506080d783172351ee637cc7f247125d32e3989
|
||||
|
Loading…
Reference in New Issue
Block a user