parent
cd068b3c07
commit
1d3b152ac3
@ -1,2 +1,3 @@
|
||||
SOURCES/libguestfs-1.50.1.tar.gz
|
||||
SOURCES/libguestfs-common-1.50.1.tar.gz
|
||||
SOURCES/libguestfs.keyring
|
||||
|
@ -1,2 +1,3 @@
|
||||
b2ccc62a61d43917d982bb380709cd283fda465a SOURCES/libguestfs-1.50.1.tar.gz
|
||||
c2f649ede7121e974884afb1b2dfacb966f9e21e SOURCES/libguestfs-common-1.50.1.tar.gz
|
||||
1bbc40f501a7fef9eef2a39b701a71aee2fea7c4 SOURCES/libguestfs.keyring
|
||||
|
@ -0,0 +1,138 @@
|
||||
From 5c672d1541e7d769e73e6858944d33f66be12f30 Mon Sep 17 00:00:00 2001
|
||||
From: Laszlo Ersek <lersek@redhat.com>
|
||||
Date: Tue, 14 Mar 2023 14:15:05 +0100
|
||||
Subject: [PATCH] update common submodule
|
||||
|
||||
Andrey Drobyshev (2):
|
||||
inject_virtio_win: add Virtio_SCSI to block_type
|
||||
inject_virtio_win: write the proper block controller PCI ID to Win registry
|
||||
|
||||
Richard W.M. Jones (2):
|
||||
mlcustomize: Fix overlong comment
|
||||
mlcustomize: Add accessors for block driver priority list
|
||||
|
||||
Roman Kagan (1):
|
||||
inject_virtio_win: match only vendor/device/revision
|
||||
|
||||
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
|
||||
(cherry picked from commit 7414ac40c7df0a8938a05ba50907312b0093d107)
|
||||
---
|
||||
common | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
Submodule common 90e0077e..360e037d:
|
||||
diff --git a/common/mlcustomize/inject_virtio_win.ml b/common/mlcustomize/inject_virtio_win.ml
|
||||
index 5f4aab72..2a30b200 100644
|
||||
--- a/common/mlcustomize/inject_virtio_win.ml
|
||||
+++ b/common/mlcustomize/inject_virtio_win.ml
|
||||
@@ -49,9 +49,12 @@ type t = {
|
||||
of libosinfo. Although this behaviour is documented, IMHO it has
|
||||
always been a bad idea. We should change this in future to allow
|
||||
the user to select where they want to get drivers from. XXX *)
|
||||
+
|
||||
+ mutable block_driver_priority : string list
|
||||
+ (** List of block drivers *)
|
||||
}
|
||||
|
||||
-type block_type = Virtio_blk | IDE
|
||||
+type block_type = Virtio_blk | Virtio_SCSI | IDE
|
||||
and net_type = Virtio_net | E1000 | RTL8139
|
||||
and machine_type = I440FX | Q35 | Virt
|
||||
|
||||
@@ -107,13 +110,17 @@ and get_inspection g root =
|
||||
{ g; root;
|
||||
i_arch; i_major_version; i_minor_version; i_osinfo;
|
||||
i_product_variant; i_windows_current_control_set; i_windows_systemroot;
|
||||
- virtio_win = ""; was_set = false }
|
||||
+ virtio_win = ""; was_set = false;
|
||||
+ block_driver_priority = ["virtio_blk"; "vrtioblk"; "viostor"] }
|
||||
+
|
||||
+let get_block_driver_priority t = t.block_driver_priority
|
||||
+let set_block_driver_priority t v = t.block_driver_priority <- v
|
||||
|
||||
let scsi_class_guid = "{4D36E97B-E325-11CE-BFC1-08002BE10318}"
|
||||
-let viostor_legacy_pciid = "VEN_1AF4&DEV_1001&SUBSYS_00021AF4&REV_00"
|
||||
-let viostor_modern_pciid = "VEN_1AF4&DEV_1042&SUBSYS_11001AF4&REV_01"
|
||||
-let vioscsi_legacy_pciid = "VEN_1AF4&DEV_1004&SUBSYS_00081AF4&REV_00"
|
||||
-let vioscsi_modern_pciid = "VEN_1AF4&DEV_1048&SUBSYS_11001AF4&REV_01"
|
||||
+let viostor_legacy_pciid = "VEN_1AF4&DEV_1001&REV_00"
|
||||
+let viostor_modern_pciid = "VEN_1AF4&DEV_1042&REV_01"
|
||||
+let vioscsi_legacy_pciid = "VEN_1AF4&DEV_1004&REV_00"
|
||||
+let vioscsi_modern_pciid = "VEN_1AF4&DEV_1048&REV_01"
|
||||
|
||||
let rec inject_virtio_win_drivers ({ g } as t) reg =
|
||||
(* Copy the virtio drivers to the guest. *)
|
||||
@@ -176,14 +183,13 @@ let rec inject_virtio_win_drivers ({ g } as t) reg =
|
||||
else (
|
||||
(* Can we install the block driver? *)
|
||||
let block : block_type =
|
||||
- let filenames = ["virtio_blk"; "vrtioblk"; "viostor"] in
|
||||
let viostor_driver = try (
|
||||
Some (
|
||||
List.find (
|
||||
fun driver_file ->
|
||||
let source = driverdir // driver_file ^ ".sys" in
|
||||
g#exists source
|
||||
- ) filenames
|
||||
+ ) t.block_driver_priority
|
||||
)
|
||||
) with Not_found -> None in
|
||||
match viostor_driver with
|
||||
@@ -194,16 +200,22 @@ let rec inject_virtio_win_drivers ({ g } as t) reg =
|
||||
IDE
|
||||
|
||||
| Some driver_name ->
|
||||
- (* Block driver needs tweaks to allow booting; the rest is set up by PnP
|
||||
- * manager *)
|
||||
+ (* Block driver needs tweaks to allow booting;
|
||||
+ * the rest is set up by PnP manager.
|
||||
+ *)
|
||||
let source = driverdir // (driver_name ^ ".sys") in
|
||||
let target = sprintf "%s/system32/drivers/%s.sys"
|
||||
t.i_windows_systemroot driver_name in
|
||||
let target = g#case_sensitive_path target in
|
||||
+ let installed_block_type, legacy_pciid, modern_pciid =
|
||||
+ match driver_name with
|
||||
+ | "vioscsi" -> Virtio_SCSI, vioscsi_legacy_pciid, vioscsi_modern_pciid
|
||||
+ | _ -> Virtio_blk, viostor_legacy_pciid, viostor_modern_pciid
|
||||
+ in
|
||||
g#cp source target;
|
||||
- add_guestor_to_registry t reg driver_name viostor_legacy_pciid;
|
||||
- add_guestor_to_registry t reg driver_name viostor_modern_pciid;
|
||||
- Virtio_blk in
|
||||
+ add_guestor_to_registry t reg driver_name legacy_pciid;
|
||||
+ add_guestor_to_registry t reg driver_name modern_pciid;
|
||||
+ installed_block_type in
|
||||
|
||||
(* Can we install the virtio-net driver? *)
|
||||
let net : net_type =
|
||||
diff --git a/common/mlcustomize/inject_virtio_win.mli b/common/mlcustomize/inject_virtio_win.mli
|
||||
index 0ced02e8..d14f0497 100644
|
||||
--- a/common/mlcustomize/inject_virtio_win.mli
|
||||
+++ b/common/mlcustomize/inject_virtio_win.mli
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
type t (** Handle *)
|
||||
|
||||
-type block_type = Virtio_blk | IDE
|
||||
+type block_type = Virtio_blk | Virtio_SCSI | IDE
|
||||
and net_type = Virtio_net | E1000 | RTL8139
|
||||
and machine_type = I440FX | Q35 | Virt
|
||||
|
||||
@@ -64,6 +64,16 @@ val from_environment : Guestfs.guestfs -> string -> string -> t
|
||||
|
||||
This should only be used by [virt-v2v] and is considered a legacy method. *)
|
||||
|
||||
+val get_block_driver_priority : t -> string list
|
||||
+val set_block_driver_priority : t -> string list -> unit
|
||||
+(** Get or set the current block driver priority list. This is
|
||||
+ a list of virtio-win block driver names (eg. ["viostor"]) that
|
||||
+ we search until we come to the first [name ^ ".sys"] that
|
||||
+ we find, and that is the block driver which gets installed.
|
||||
+
|
||||
+ This module contains a default priority list which should
|
||||
+ be suitable for most use cases. *)
|
||||
+
|
||||
val inject_virtio_win_drivers : t -> Registry.t -> virtio_win_installed
|
||||
(** [inject_virtio_win_drivers t reg]
|
||||
installs virtio drivers from the driver directory or driver
|
@ -0,0 +1,119 @@
|
||||
From 54a9e48e5e1088a1b781c30b49bce695007e12fc Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Mon, 22 May 2023 16:40:21 +0100
|
||||
Subject: [PATCH] Replace Pervasives.* with Stdlib.*
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Since OCaml 4.07 (released 2018-07-10) the always-loaded standard
|
||||
library module has been called Stdlib. The old Pervasives module was
|
||||
finally removed in OCaml 5.
|
||||
|
||||
$ perl -pi.bak -e 's/Pervasives\./Stdlib./g' -- `git ls-files`
|
||||
|
||||
OCaml >= 4.07 is now required.
|
||||
|
||||
Also update the common submodule with:
|
||||
|
||||
commit d61cd820b49e403848d15c5deaccbf8dd7045370
|
||||
Author: Jürgen Hötzel
|
||||
Date: Sat May 20 18:16:40 2023 +0200
|
||||
|
||||
Add support for OCaml 5.0
|
||||
|
||||
(cherry picked from commit 3cb094083e61203a8751bcf31dcb56a47dec6840)
|
||||
---
|
||||
common | 2 +-
|
||||
daemon/chroot.ml | 2 +-
|
||||
docs/guestfs-building.pod | 2 +-
|
||||
generator/pr.ml | 4 ++--
|
||||
m4/guestfs-ocaml.m4 | 6 +++---
|
||||
5 files changed, 8 insertions(+), 8 deletions(-)
|
||||
|
||||
Submodule common b636c3f2..d61cd820:
|
||||
diff --git a/common/mlstdutils/std_utils.ml b/common/mlstdutils/std_utils.ml
|
||||
index 0d2fa22f..86b21a7c 100644
|
||||
--- a/common/mlstdutils/std_utils.ml
|
||||
+++ b/common/mlstdutils/std_utils.ml
|
||||
@@ -341,12 +341,12 @@ module List = struct
|
||||
| x::xs, y::ys, z::zs -> (x, y, z) :: combine3 xs ys zs
|
||||
| _ -> invalid_arg "combine3"
|
||||
|
||||
- let rec assoc_lbl ?(cmp = Pervasives.compare) ~default x = function
|
||||
+ let rec assoc_lbl ?(cmp = Stdlib.compare) ~default x = function
|
||||
| [] -> default
|
||||
| (y, y') :: _ when cmp x y = 0 -> y'
|
||||
| _ :: ys -> assoc_lbl ~cmp ~default x ys
|
||||
|
||||
- let uniq ?(cmp = Pervasives.compare) xs =
|
||||
+ let uniq ?(cmp = Stdlib.compare) xs =
|
||||
let rec loop acc = function
|
||||
| [] -> acc
|
||||
| [x] -> x :: acc
|
||||
diff --git a/daemon/chroot.ml b/daemon/chroot.ml
|
||||
index 62f387ee..087b5031 100644
|
||||
--- a/daemon/chroot.ml
|
||||
+++ b/daemon/chroot.ml
|
||||
@@ -51,7 +51,7 @@ let f t func arg =
|
||||
try
|
||||
let chan = out_channel_of_descr wfd in
|
||||
output_value chan ret;
|
||||
- Pervasives.flush chan;
|
||||
+ Stdlib.flush chan;
|
||||
Exit._exit 0
|
||||
with
|
||||
exn ->
|
||||
diff --git a/docs/guestfs-building.pod b/docs/guestfs-building.pod
|
||||
index b9bc885a..33703a96 100644
|
||||
--- a/docs/guestfs-building.pod
|
||||
+++ b/docs/guestfs-building.pod
|
||||
@@ -119,7 +119,7 @@ virt tools which are still written in Perl.
|
||||
|
||||
I<Required>. Part of Perl core.
|
||||
|
||||
-=item OCaml E<ge> 4.04
|
||||
+=item OCaml E<ge> 4.07
|
||||
|
||||
=item OCaml findlib
|
||||
|
||||
diff --git a/generator/pr.ml b/generator/pr.ml
|
||||
index d7e6eba3..ed6e9372 100644
|
||||
--- a/generator/pr.ml
|
||||
+++ b/generator/pr.ml
|
||||
@@ -25,7 +25,7 @@ open Std_utils
|
||||
open Utils
|
||||
|
||||
(* Output channel, 'pr' prints to this. *)
|
||||
-let chan = ref Pervasives.stdout
|
||||
+let chan = ref Stdlib.stdout
|
||||
|
||||
(* Number of lines generated. *)
|
||||
let lines = ref 0
|
||||
@@ -53,7 +53,7 @@ let output_to ?(perm = 0o444) filename k =
|
||||
chan := open_out filename_new;
|
||||
k ();
|
||||
close_out !chan;
|
||||
- chan := Pervasives.stdout;
|
||||
+ chan := Stdlib.stdout;
|
||||
|
||||
(* Is the new file different from the current file? *)
|
||||
if Sys.file_exists filename && files_equal filename filename_new then
|
||||
diff --git a/m4/guestfs-ocaml.m4 b/m4/guestfs-ocaml.m4
|
||||
index 51072c1a..e850fb8c 100644
|
||||
--- a/m4/guestfs-ocaml.m4
|
||||
+++ b/m4/guestfs-ocaml.m4
|
||||
@@ -38,10 +38,10 @@ AC_ARG_ENABLE([ocaml],
|
||||
[],
|
||||
[enable_ocaml=yes])
|
||||
|
||||
-dnl OCaml >= 4.04 is required.
|
||||
-ocaml_ver_str=4.04
|
||||
+dnl OCaml >= 4.07 is required.
|
||||
+ocaml_ver_str=4.07
|
||||
ocaml_min_major=4
|
||||
-ocaml_min_minor=4
|
||||
+ocaml_min_minor=7
|
||||
AC_MSG_CHECKING([if OCaml version >= $ocaml_ver_str])
|
||||
ocaml_major="`echo $OCAMLVERSION | $AWK -F. '{print $1}'`"
|
||||
ocaml_minor="`echo $OCAMLVERSION | $AWK -F. '{print $2}' | sed 's/^0//'`"
|
@ -0,0 +1,38 @@
|
||||
From feb17e93b4e58131cf6875c4ae638a791a875a22 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?J=C3=BCrgen=20H=C3=B6tzel?= <juergen@archlinux.org>
|
||||
Date: Sat, 27 May 2023 15:32:36 +0200
|
||||
Subject: [PATCH] ocaml/implicit_close test: collect all currently unreachable
|
||||
blocks
|
||||
|
||||
Fixes failing implice_close test on OCaml 5.
|
||||
|
||||
RWMJ:
|
||||
|
||||
I adjusted this patch so that we continue to call Gc.compact on
|
||||
exiting the test, to move all of the heap (hopefully revealing flaws
|
||||
in the bindings). This only works on OCaml <= 4, but Gc.compact may
|
||||
be fixed/reimplemented later in the 5.x series.
|
||||
|
||||
Please see also the lengthy discussion of this patch upstream:
|
||||
https://listman.redhat.com/archives/libguestfs/2023-May/thread.html#31639
|
||||
https://listman.redhat.com/archives/libguestfs/2023-June/thread.html#31709
|
||||
https://discuss.ocaml.org/t/ocaml-heap-fsck-and-forcing-collection-of-unreachable-objects/12281/1
|
||||
|
||||
(cherry picked from commit 1274452d225da71f115e0cb8ad435e02670dc4fb)
|
||||
---
|
||||
ocaml/t/guestfs_065_implicit_close.ml | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/ocaml/t/guestfs_065_implicit_close.ml b/ocaml/t/guestfs_065_implicit_close.ml
|
||||
index 567e550b..f2dfecbd 100644
|
||||
--- a/ocaml/t/guestfs_065_implicit_close.ml
|
||||
+++ b/ocaml/t/guestfs_065_implicit_close.ml
|
||||
@@ -30,7 +30,7 @@ let () =
|
||||
*)
|
||||
|
||||
(* This should cause the GC to close the handle. *)
|
||||
-let () = Gc.compact ()
|
||||
+let () = Gc.full_major ()
|
||||
|
||||
let () = assert (!close_invoked = 1)
|
||||
|
@ -0,0 +1,70 @@
|
||||
From dd58abc40175f735f6fe2669c34c67e6190e557d Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Tue, 27 Jun 2023 10:17:58 +0100
|
||||
Subject: [PATCH] ocaml: Replace old enter/leave_blocking_section calls
|
||||
|
||||
Since OCaml 4 the old and confusing caml_enter_blocking_section and
|
||||
caml_leave_blocking_section calls have been replaced with
|
||||
caml_release_runtime_system and caml_acquire_runtime_system (in that
|
||||
order). Use the new names.
|
||||
|
||||
(cherry picked from commit 7e1d7c1330185a1f3da2ce2100f59637518c3302)
|
||||
---
|
||||
generator/OCaml.ml | 5 +++--
|
||||
ocaml/guestfs-c.c | 5 +++--
|
||||
2 files changed, 6 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/generator/OCaml.ml b/generator/OCaml.ml
|
||||
index 02d9ee2e..07ccd269 100644
|
||||
--- a/generator/OCaml.ml
|
||||
+++ b/generator/OCaml.ml
|
||||
@@ -429,6 +429,7 @@ and generate_ocaml_c () =
|
||||
#include <caml/memory.h>
|
||||
#include <caml/mlvalues.h>
|
||||
#include <caml/signals.h>
|
||||
+#include <caml/threads.h>
|
||||
|
||||
#include <guestfs.h>
|
||||
#include \"guestfs-utils.h\"
|
||||
@@ -689,12 +690,12 @@ copy_table (char * const * argv)
|
||||
pr "\n";
|
||||
|
||||
if blocking then
|
||||
- pr " caml_enter_blocking_section ();\n";
|
||||
+ pr " caml_release_runtime_system ();\n";
|
||||
pr " r = %s " c_function;
|
||||
generate_c_call_args ~handle:"g" style;
|
||||
pr ";\n";
|
||||
if blocking then
|
||||
- pr " caml_leave_blocking_section ();\n";
|
||||
+ pr " caml_acquire_runtime_system ();\n";
|
||||
|
||||
(* Free strings if we copied them above. *)
|
||||
List.iter (
|
||||
diff --git a/ocaml/guestfs-c.c b/ocaml/guestfs-c.c
|
||||
index 3888c945..8c8aa460 100644
|
||||
--- a/ocaml/guestfs-c.c
|
||||
+++ b/ocaml/guestfs-c.c
|
||||
@@ -34,6 +34,7 @@
|
||||
#include <caml/mlvalues.h>
|
||||
#include <caml/printexc.h>
|
||||
#include <caml/signals.h>
|
||||
+#include <caml/threads.h>
|
||||
#include <caml/unixsupport.h>
|
||||
|
||||
#include "guestfs-c.h"
|
||||
@@ -395,12 +396,12 @@ event_callback_wrapper (guestfs_h *g,
|
||||
/* Ensure we are holding the GC lock before any GC operations are
|
||||
* possible. (RHBZ#725824)
|
||||
*/
|
||||
- caml_leave_blocking_section ();
|
||||
+ caml_acquire_runtime_system ();
|
||||
|
||||
event_callback_wrapper_locked (g, data, event, event_handle, flags,
|
||||
buf, buf_len, array, array_len);
|
||||
|
||||
- caml_enter_blocking_section ();
|
||||
+ caml_release_runtime_system ();
|
||||
}
|
||||
|
||||
value
|
@ -0,0 +1,28 @@
|
||||
From e2110f72069f184c87df348247e8f3106c81d44a Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Tue, 27 Jun 2023 11:36:55 +0100
|
||||
Subject: [PATCH] ocaml: Release runtime lock around guestfs_close
|
||||
|
||||
When finalizing the handle we call guestfs_close. This function could
|
||||
be long-running (eg. it may have to shut down the qemu subprocess), so
|
||||
release the runtime lock.
|
||||
|
||||
(cherry picked from commit 4a79c023e57e07844c2ac3259aaf9b885e402fdf)
|
||||
---
|
||||
ocaml/guestfs-c.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/ocaml/guestfs-c.c b/ocaml/guestfs-c.c
|
||||
index 8c8aa460..a1865a72 100644
|
||||
--- a/ocaml/guestfs-c.c
|
||||
+++ b/ocaml/guestfs-c.c
|
||||
@@ -77,7 +77,9 @@ guestfs_finalize (value gv)
|
||||
* above, which is why we don't want to delete them before
|
||||
* closing the handle.
|
||||
*/
|
||||
+ caml_release_runtime_system ();
|
||||
guestfs_close (g);
|
||||
+ caml_acquire_runtime_system ();
|
||||
|
||||
/* Now unregister the global roots. */
|
||||
if (roots && len > 0) {
|
@ -0,0 +1,73 @@
|
||||
From e42cd859265c34d2013a45b742d4c36bb7617445 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Tue, 27 Jun 2023 12:09:12 +0100
|
||||
Subject: [PATCH] ocaml: Conditionally acquire the lock in callbacks
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
This fix was originally suggested by Jürgen Hötzel (link below) which
|
||||
I have lightly modified so it works with OCaml <= 4 too.
|
||||
|
||||
Link: https://listman.redhat.com/archives/libguestfs/2023-May/031640.html
|
||||
Link: https://discuss.ocaml.org/t/test-caml-state-and-conditionally-caml-acquire-runtime-system-good-or-bad/12489
|
||||
(cherry picked from commit 16464878cf980ffab1c1aeada2e438b0281ad1bc)
|
||||
---
|
||||
ocaml/guestfs-c.c | 25 +++++++++++++++++++++++--
|
||||
1 file changed, 23 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/ocaml/guestfs-c.c b/ocaml/guestfs-c.c
|
||||
index a1865a72..67dc3547 100644
|
||||
--- a/ocaml/guestfs-c.c
|
||||
+++ b/ocaml/guestfs-c.c
|
||||
@@ -19,6 +19,7 @@
|
||||
#include <config.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
+#include <stdbool.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
|
||||
@@ -36,6 +37,7 @@
|
||||
#include <caml/signals.h>
|
||||
#include <caml/threads.h>
|
||||
#include <caml/unixsupport.h>
|
||||
+#include <caml/version.h>
|
||||
|
||||
#include "guestfs-c.h"
|
||||
|
||||
@@ -397,13 +399,32 @@ event_callback_wrapper (guestfs_h *g,
|
||||
{
|
||||
/* Ensure we are holding the GC lock before any GC operations are
|
||||
* possible. (RHBZ#725824)
|
||||
+ *
|
||||
+ * There are many paths where we already hold the OCaml lock before
|
||||
+ * this function, for example "non-blocking" calls, and the
|
||||
+ * libguestfs global atexit path (which calls guestfs_close). To
|
||||
+ * avoid double acquisition we need to check if we already hold the
|
||||
+ * lock. OCaml 5 is strict about this. In earlier OCaml versions
|
||||
+ * there is no way to check, but they did not implement the lock as
|
||||
+ * a mutex and so it didn't cause problems.
|
||||
+ *
|
||||
+ * See also:
|
||||
+ * https://discuss.ocaml.org/t/test-caml-state-and-conditionally-caml-acquire-runtime-system-good-or-bad/12489
|
||||
*/
|
||||
- caml_acquire_runtime_system ();
|
||||
+#if OCAML_VERSION_MAJOR >= 5
|
||||
+ bool acquired = caml_state != NULL;
|
||||
+#else
|
||||
+ const bool acquired = false;
|
||||
+#endif
|
||||
+
|
||||
+ if (!acquired)
|
||||
+ caml_acquire_runtime_system ();
|
||||
|
||||
event_callback_wrapper_locked (g, data, event, event_handle, flags,
|
||||
buf, buf_len, array, array_len);
|
||||
|
||||
- caml_release_runtime_system ();
|
||||
+ if (!acquired)
|
||||
+ caml_release_runtime_system ();
|
||||
}
|
||||
|
||||
value
|
@ -0,0 +1,59 @@
|
||||
From 7ceafac98d3eb28d25195622cb6dc1158e9c1c2f Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Tue, 27 Jun 2023 16:20:49 +0100
|
||||
Subject: [PATCH] ocaml: Fix guestfs_065_implicit_close.ml for OCaml 5
|
||||
|
||||
Link: https://discuss.ocaml.org/t/ocaml-5-forcing-objects-to-be-collected-and-finalized/12492/3
|
||||
Thanks: Josh Berdine
|
||||
Thanks: Vincent Laviron
|
||||
(cherry picked from commit 7d4e9c927e8478662ece204b98ee3b5b147ab4b9)
|
||||
---
|
||||
ocaml/t/guestfs_065_implicit_close.ml | 33 +++++++++++++++------------
|
||||
1 file changed, 19 insertions(+), 14 deletions(-)
|
||||
|
||||
diff --git a/ocaml/t/guestfs_065_implicit_close.ml b/ocaml/t/guestfs_065_implicit_close.ml
|
||||
index f2dfecbd..9e68bc4c 100644
|
||||
--- a/ocaml/t/guestfs_065_implicit_close.ml
|
||||
+++ b/ocaml/t/guestfs_065_implicit_close.ml
|
||||
@@ -16,22 +16,27 @@
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*)
|
||||
|
||||
-let close_invoked = ref 0
|
||||
+let [@inline never][@local never] run () =
|
||||
+ let close_invoked = ref 0 in
|
||||
|
||||
-let close _ _ _ _ =
|
||||
- incr close_invoked
|
||||
+ let close _ _ _ _ =
|
||||
+ incr close_invoked
|
||||
+ in
|
||||
|
||||
-let () =
|
||||
- let g = new Guestfs.guestfs () in
|
||||
- ignore (g#set_event_callback close [Guestfs.EVENT_CLOSE]);
|
||||
- assert (!close_invoked = 0)
|
||||
-(* Allow the 'g' handle to go out of scope here, to ensure there is no
|
||||
- * reference held on the stack.
|
||||
- *)
|
||||
+ let () =
|
||||
+ let g = new Guestfs.guestfs () in
|
||||
+ ignore (g#set_event_callback close [Guestfs.EVENT_CLOSE]);
|
||||
+ assert (!close_invoked = 0)
|
||||
+ (* Allow the 'g' handle to go out of scope here, to ensure there is no
|
||||
+ * reference held on the stack.
|
||||
+ *)
|
||||
+ in
|
||||
|
||||
-(* This should cause the GC to close the handle. *)
|
||||
-let () = Gc.full_major ()
|
||||
+ (* This should cause the GC to close the handle. *)
|
||||
+ Gc.full_major ();
|
||||
|
||||
-let () = assert (!close_invoked = 1)
|
||||
+ assert (!close_invoked = 1);
|
||||
|
||||
-let () = Gc.compact ()
|
||||
+ Gc.compact ()
|
||||
+
|
||||
+let () = run ()
|
@ -0,0 +1,25 @@
|
||||
From d4fabae17001702894526084bf0ab516de3599d5 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Tue, 27 Jun 2023 16:31:55 +0100
|
||||
Subject: [PATCH] ocaml: Use Caml_state_opt in preference to caml_state
|
||||
|
||||
Link: https://discuss.ocaml.org/t/test-caml-state-and-conditionally-caml-acquire-runtime-system-good-or-bad/12489/7
|
||||
Thanks: Guillaume Munch-Maccagnoni
|
||||
(cherry picked from commit cade0b1aeb828d294a7c4e323f8131322d30fb73)
|
||||
---
|
||||
ocaml/guestfs-c.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/ocaml/guestfs-c.c b/ocaml/guestfs-c.c
|
||||
index 67dc3547..8a8761e8 100644
|
||||
--- a/ocaml/guestfs-c.c
|
||||
+++ b/ocaml/guestfs-c.c
|
||||
@@ -412,7 +412,7 @@ event_callback_wrapper (guestfs_h *g,
|
||||
* https://discuss.ocaml.org/t/test-caml-state-and-conditionally-caml-acquire-runtime-system-good-or-bad/12489
|
||||
*/
|
||||
#if OCAML_VERSION_MAJOR >= 5
|
||||
- bool acquired = caml_state != NULL;
|
||||
+ bool acquired = Caml_state_opt != NULL;
|
||||
#else
|
||||
const bool acquired = false;
|
||||
#endif
|
@ -0,0 +1,101 @@
|
||||
From 6c63f5cd8b43448f4847d550ad313d950d6b8520 Mon Sep 17 00:00:00 2001
|
||||
From: Laszlo Ersek <lersek@redhat.com>
|
||||
Date: Tue, 11 Jul 2023 13:39:06 +0200
|
||||
Subject: [PATCH] lib: remove guestfs_int_cmd_clear_close_files()
|
||||
|
||||
The last (only?) caller of guestfs_int_cmd_clear_close_files() disappeared
|
||||
in commit e4c396888056 ("lib/info: Remove /dev/fd hacking and pass a true
|
||||
filename to qemu-img info.", 2018-01-23), part of v1.37.36.
|
||||
|
||||
Simplify the code by removing guestfs_int_cmd_clear_close_files().
|
||||
|
||||
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
|
||||
Message-Id: <20230711113906.107340-1-lersek@redhat.com>
|
||||
Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
|
||||
(cherry picked from commit 13c7052ff96d5ee99ec1b1252f1a3b4d7aed44d2)
|
||||
---
|
||||
lib/command.c | 37 ++++++++++---------------------------
|
||||
lib/guestfs-internal.h | 1 -
|
||||
2 files changed, 10 insertions(+), 28 deletions(-)
|
||||
|
||||
diff --git a/lib/command.c b/lib/command.c
|
||||
index 515ef624..82a47baf 100644
|
||||
--- a/lib/command.c
|
||||
+++ b/lib/command.c
|
||||
@@ -152,9 +152,6 @@ struct command
|
||||
/* When using the pipe_* APIs, stderr is pointed to a temporary file. */
|
||||
char *error_file;
|
||||
|
||||
- /* Close file descriptors (defaults to true). */
|
||||
- bool close_files;
|
||||
-
|
||||
/* Supply a callback to receive stdout. */
|
||||
cmd_stdout_callback stdout_callback;
|
||||
void *stdout_data;
|
||||
@@ -186,7 +183,6 @@ guestfs_int_new_command (guestfs_h *g)
|
||||
cmd = safe_calloc (g, 1, sizeof *cmd);
|
||||
cmd->g = g;
|
||||
cmd->capture_errors = true;
|
||||
- cmd->close_files = true;
|
||||
cmd->errorfd = -1;
|
||||
cmd->outfd = -1;
|
||||
return cmd;
|
||||
@@ -358,17 +354,6 @@ guestfs_int_cmd_clear_capture_errors (struct command *cmd)
|
||||
cmd->capture_errors = false;
|
||||
}
|
||||
|
||||
-/**
|
||||
- * Don't close file descriptors after the fork.
|
||||
- *
|
||||
- * XXX Should allow single fds to be sent to child process.
|
||||
- */
|
||||
-void
|
||||
-guestfs_int_cmd_clear_close_files (struct command *cmd)
|
||||
-{
|
||||
- cmd->close_files = false;
|
||||
-}
|
||||
-
|
||||
/**
|
||||
* Set a function to be executed in the child, right before the
|
||||
* execution. Can be used to setup the child, for example changing
|
||||
@@ -564,18 +549,16 @@ run_child (struct command *cmd, char **env)
|
||||
for (i = 1; i < NSIG; ++i)
|
||||
sigaction (i, &sa, NULL);
|
||||
|
||||
- if (cmd->close_files) {
|
||||
- /* Close all other file descriptors. This ensures that we don't
|
||||
- * hold open (eg) pipes from the parent process.
|
||||
- */
|
||||
- max_fd = sysconf (_SC_OPEN_MAX);
|
||||
- if (max_fd == -1)
|
||||
- max_fd = 1024;
|
||||
- if (max_fd > 65536)
|
||||
- max_fd = 65536; /* bound the amount of work we do here */
|
||||
- for (fd = 3; fd < max_fd; ++fd)
|
||||
- close (fd);
|
||||
- }
|
||||
+ /* Close all other file descriptors. This ensures that we don't
|
||||
+ * hold open (eg) pipes from the parent process.
|
||||
+ */
|
||||
+ max_fd = sysconf (_SC_OPEN_MAX);
|
||||
+ if (max_fd == -1)
|
||||
+ max_fd = 1024;
|
||||
+ if (max_fd > 65536)
|
||||
+ max_fd = 65536; /* bound the amount of work we do here */
|
||||
+ for (fd = 3; fd < max_fd; ++fd)
|
||||
+ close (fd);
|
||||
|
||||
/* Set the umask for all subcommands to something sensible (RHBZ#610880). */
|
||||
umask (022);
|
||||
diff --git a/lib/guestfs-internal.h b/lib/guestfs-internal.h
|
||||
index fb55e026..c7ef3227 100644
|
||||
--- a/lib/guestfs-internal.h
|
||||
+++ b/lib/guestfs-internal.h
|
||||
@@ -751,7 +751,6 @@ extern void guestfs_int_cmd_set_stdout_callback (struct command *, cmd_stdout_ca
|
||||
extern void guestfs_int_cmd_set_stderr_to_stdout (struct command *);
|
||||
extern void guestfs_int_cmd_set_child_rlimit (struct command *, int resource, long limit);
|
||||
extern void guestfs_int_cmd_clear_capture_errors (struct command *);
|
||||
-extern void guestfs_int_cmd_clear_close_files (struct command *);
|
||||
extern void guestfs_int_cmd_set_child_callback (struct command *, cmd_child_callback child_callback, void *data);
|
||||
extern int guestfs_int_cmd_run (struct command *);
|
||||
extern void guestfs_int_cmd_close (struct command *);
|
@ -0,0 +1,34 @@
|
||||
From f8e8aef7e9e8334db19529aa46bd28a209436b50 Mon Sep 17 00:00:00 2001
|
||||
From: Laszlo Ersek <lersek@redhat.com>
|
||||
Date: Fri, 14 Jul 2023 15:22:09 +0200
|
||||
Subject: [PATCH] docs: fix broken link in the guestfs manual
|
||||
|
||||
Commit 55202a4d49a1 ("New API: get-sockdir", 2016-02-03) added identical
|
||||
language to "fish/guestfish.pod" and "src/guestfs.pod", including an
|
||||
internal link L</get-sockdir>. That's appropriate for
|
||||
"fish/guestfish.pod", but the same API description is generated with a
|
||||
different anchor for "src/guestfs.pod". Adapt the reference.
|
||||
|
||||
Fixes: 55202a4d49a101392148d79cb2e1591428db2681
|
||||
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2184967
|
||||
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
|
||||
Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
|
||||
Message-Id: <20230714132213.96616-4-lersek@redhat.com>
|
||||
(cherry picked from commit b4a4b754c6161b95ddee05e398e0200e6b73b840)
|
||||
---
|
||||
lib/guestfs.pod | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/lib/guestfs.pod b/lib/guestfs.pod
|
||||
index 866a4638..5db6dd91 100644
|
||||
--- a/lib/guestfs.pod
|
||||
+++ b/lib/guestfs.pod
|
||||
@@ -3123,7 +3123,7 @@ non-essential runtime files.
|
||||
If it is set, then is used to store temporary sockets. Otherwise,
|
||||
F</tmp> is used.
|
||||
|
||||
-See also L</get-sockdir>,
|
||||
+See also L</guestfs_get_sockdir>,
|
||||
L<http://www.freedesktop.org/wiki/Specifications/basedir-spec/>.
|
||||
|
||||
=back
|
@ -0,0 +1,75 @@
|
||||
From cde50cb9d71ffa418f45868aa0d4b874847b989a Mon Sep 17 00:00:00 2001
|
||||
From: Laszlo Ersek <lersek@redhat.com>
|
||||
Date: Fri, 14 Jul 2023 15:22:10 +0200
|
||||
Subject: [PATCH] docs: clarify sockdir's separation
|
||||
|
||||
There's another reason for separating sockdir from tmpdir, beyond "shorter
|
||||
pathnames needed": permissions. For example, passt drops privileges such
|
||||
that it cannot access "/tmp", and that restricts both the unix domain
|
||||
socket and the PID file of passt.
|
||||
|
||||
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2184967
|
||||
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
|
||||
Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
|
||||
Message-Id: <20230714132213.96616-5-lersek@redhat.com>
|
||||
(cherry picked from commit 21ccddecf7dd51b24bb2b71dbc8beb1a8dd01923)
|
||||
---
|
||||
fish/guestfish.pod | 4 ++--
|
||||
generator/actions_properties.ml | 8 ++++++--
|
||||
lib/guestfs.pod | 4 ++--
|
||||
3 files changed, 10 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/fish/guestfish.pod b/fish/guestfish.pod
|
||||
index d36cac9d..33fc8b2c 100644
|
||||
--- a/fish/guestfish.pod
|
||||
+++ b/fish/guestfish.pod
|
||||
@@ -1492,8 +1492,8 @@ See L</LIBGUESTFS_CACHEDIR>, L</LIBGUESTFS_TMPDIR>.
|
||||
This directory represents a user-specific directory for storing
|
||||
non-essential runtime files.
|
||||
|
||||
-If it is set, then is used to store temporary sockets. Otherwise,
|
||||
-F</tmp> is used.
|
||||
+If it is set, then is used to store temporary sockets and PID files.
|
||||
+Otherwise, F</tmp> is used.
|
||||
|
||||
See also L</get-sockdir>,
|
||||
L<http://www.freedesktop.org/wiki/Specifications/basedir-spec/>.
|
||||
diff --git a/generator/actions_properties.ml b/generator/actions_properties.ml
|
||||
index f84afb10..42eaaa4d 100644
|
||||
--- a/generator/actions_properties.ml
|
||||
+++ b/generator/actions_properties.ml
|
||||
@@ -595,13 +595,17 @@ Get the handle identifier. See C<guestfs_set_identifier>." };
|
||||
name = "get_sockdir"; added = (1, 33, 8);
|
||||
style = RString (RPlainString, "sockdir"), [], [];
|
||||
blocking = false;
|
||||
- shortdesc = "get the temporary directory for sockets";
|
||||
+ shortdesc = "get the temporary directory for sockets and PID files";
|
||||
longdesc = "\
|
||||
-Get the directory used by the handle to store temporary socket files.
|
||||
+Get the directory used by the handle to store temporary socket and PID
|
||||
+files.
|
||||
|
||||
This is different from C<guestfs_get_tmpdir>, as we need shorter
|
||||
paths for sockets (due to the limited buffers of filenames for UNIX
|
||||
sockets), and C<guestfs_get_tmpdir> may be too long for them.
|
||||
+Furthermore, sockets and PID files must be accessible to such background
|
||||
+services started by libguestfs that may not have permission to access
|
||||
+the temporary directory returned by C<guestfs_get_tmpdir>.
|
||||
|
||||
The environment variable C<XDG_RUNTIME_DIR> controls the default
|
||||
value: If C<XDG_RUNTIME_DIR> is set, then that is the default.
|
||||
diff --git a/lib/guestfs.pod b/lib/guestfs.pod
|
||||
index 5db6dd91..dff32cc9 100644
|
||||
--- a/lib/guestfs.pod
|
||||
+++ b/lib/guestfs.pod
|
||||
@@ -3120,8 +3120,8 @@ See L</LIBGUESTFS_CACHEDIR>, L</LIBGUESTFS_TMPDIR>.
|
||||
This directory represents a user-specific directory for storing
|
||||
non-essential runtime files.
|
||||
|
||||
-If it is set, then is used to store temporary sockets. Otherwise,
|
||||
-F</tmp> is used.
|
||||
+If it is set, then is used to store temporary sockets and PID files.
|
||||
+Otherwise, F</tmp> is used.
|
||||
|
||||
See also L</guestfs_get_sockdir>,
|
||||
L<http://www.freedesktop.org/wiki/Specifications/basedir-spec/>.
|
@ -0,0 +1,144 @@
|
||||
From 986f5d8b1110b461d37d044c7a8052ed7ba27f87 Mon Sep 17 00:00:00 2001
|
||||
From: Laszlo Ersek <lersek@redhat.com>
|
||||
Date: Fri, 14 Jul 2023 15:22:11 +0200
|
||||
Subject: [PATCH] lib: move guestfs_int_create_socketname() from "launch.c" to
|
||||
"tmpdirs.c"
|
||||
|
||||
Consider the following inverted call tree (effectively a dependency tree
|
||||
-- callees are at the top and near the left margin):
|
||||
|
||||
lazy_make_tmpdir() [lib/tmpdirs.c]
|
||||
guestfs_int_lazy_make_tmpdir() [lib/tmpdirs.c]
|
||||
guestfs_int_make_temp_path() [lib/tmpdirs.c]
|
||||
guestfs_int_lazy_make_sockdir() [lib/tmpdirs.c]
|
||||
guestfs_int_create_socketname() [lib/launch.c]
|
||||
|
||||
lazy_make_tmpdir() is our common workhorse / helper function that
|
||||
centralizes the mkdtemp() function call.
|
||||
|
||||
guestfs_int_lazy_make_tmpdir() and guestfs_int_lazy_make_sockdir() are the
|
||||
next level functions, both calling lazy_make_tmpdir(), just feeding it
|
||||
different dirname generator functions, and different "is_runtime_dir"
|
||||
qualifications. These functions create temp dirs for various, more
|
||||
specific, purposes (see the manual and "lib/guestfs-internal.h" for more
|
||||
details).
|
||||
|
||||
On a yet higher level are guestfs_int_make_temp_path() and
|
||||
guestfs_int_create_socketname() -- they serve for creating *entries* in
|
||||
those specific temp directories.
|
||||
|
||||
The discrepancy here is that, although all the other functions live in
|
||||
"lib/tmpdirs.c", guestfs_int_create_socketname() is defined in
|
||||
"lib/launch.c". That makes for a confusing code reading; move the function
|
||||
to "lib/tmpdirs.c", just below its sibling function
|
||||
guestfs_int_make_temp_path().
|
||||
|
||||
While at it, correct the leading comment on
|
||||
guestfs_int_create_socketname() -- the socket pathname is created in the
|
||||
socket directory, not in the temporary directory.
|
||||
|
||||
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2184967
|
||||
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
|
||||
Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
|
||||
Message-Id: <20230714132213.96616-6-lersek@redhat.com>
|
||||
(cherry picked from commit 0b2ad40a098cbaf91d0d0a2df6e31bf8e3e08ace)
|
||||
---
|
||||
lib/guestfs-internal.h | 2 +-
|
||||
lib/launch.c | 26 --------------------------
|
||||
lib/tmpdirs.c | 26 ++++++++++++++++++++++++++
|
||||
3 files changed, 27 insertions(+), 27 deletions(-)
|
||||
|
||||
diff --git a/lib/guestfs-internal.h b/lib/guestfs-internal.h
|
||||
index c7ef3227..ebd68380 100644
|
||||
--- a/lib/guestfs-internal.h
|
||||
+++ b/lib/guestfs-internal.h
|
||||
@@ -668,6 +668,7 @@ extern int guestfs_int_set_env_runtimedir (guestfs_h *g, const char *envname, co
|
||||
extern int guestfs_int_lazy_make_tmpdir (guestfs_h *g);
|
||||
extern int guestfs_int_lazy_make_sockdir (guestfs_h *g);
|
||||
extern char *guestfs_int_make_temp_path (guestfs_h *g, const char *name, const char *extension);
|
||||
+extern int guestfs_int_create_socketname (guestfs_h *g, const char *filename, char (*sockname)[UNIX_PATH_MAX]);
|
||||
extern char *guestfs_int_lazy_make_supermin_appliance_dir (guestfs_h *g);
|
||||
extern void guestfs_int_remove_tmpdir (guestfs_h *g);
|
||||
extern void guestfs_int_remove_sockdir (guestfs_h *g);
|
||||
@@ -700,7 +701,6 @@ extern int guestfs_int_get_uefi (guestfs_h *g, char *const *firmwares, const cha
|
||||
extern int64_t guestfs_int_timeval_diff (const struct timeval *x, const struct timeval *y);
|
||||
extern void guestfs_int_launch_send_progress (guestfs_h *g, int perdozen);
|
||||
extern void guestfs_int_unblock_sigterm (void);
|
||||
-extern int guestfs_int_create_socketname (guestfs_h *g, const char *filename, char (*sockname)[UNIX_PATH_MAX]);
|
||||
extern void guestfs_int_register_backend (const char *name, const struct backend_ops *);
|
||||
extern int guestfs_int_set_backend (guestfs_h *g, const char *method);
|
||||
|
||||
diff --git a/lib/launch.c b/lib/launch.c
|
||||
index 6e08b120..bd0526c9 100644
|
||||
--- a/lib/launch.c
|
||||
+++ b/lib/launch.c
|
||||
@@ -309,32 +309,6 @@ guestfs_impl_config (guestfs_h *g,
|
||||
return 0;
|
||||
}
|
||||
|
||||
-/**
|
||||
- * Create the path for a socket with the selected filename in the
|
||||
- * tmpdir.
|
||||
- */
|
||||
-int
|
||||
-guestfs_int_create_socketname (guestfs_h *g, const char *filename,
|
||||
- char (*sockpath)[UNIX_PATH_MAX])
|
||||
-{
|
||||
- int r;
|
||||
-
|
||||
- if (guestfs_int_lazy_make_sockdir (g) == -1)
|
||||
- return -1;
|
||||
-
|
||||
- r = snprintf (*sockpath, UNIX_PATH_MAX, "%s/%s", g->sockdir, filename);
|
||||
- if (r >= UNIX_PATH_MAX) {
|
||||
- error (g, _("socket path too long: %s/%s"), g->sockdir, filename);
|
||||
- return -1;
|
||||
- }
|
||||
- if (r < 0) {
|
||||
- perrorf (g, _("%s"), g->sockdir);
|
||||
- return -1;
|
||||
- }
|
||||
-
|
||||
- return 0;
|
||||
-}
|
||||
-
|
||||
/**
|
||||
* When the library is loaded, each backend calls this function to
|
||||
* register itself in a global list.
|
||||
diff --git a/lib/tmpdirs.c b/lib/tmpdirs.c
|
||||
index b8e19de2..24adf98d 100644
|
||||
--- a/lib/tmpdirs.c
|
||||
+++ b/lib/tmpdirs.c
|
||||
@@ -253,6 +253,32 @@ guestfs_int_make_temp_path (guestfs_h *g,
|
||||
extension ? extension : "");
|
||||
}
|
||||
|
||||
+/**
|
||||
+ * Create the path for a socket with the selected filename in the
|
||||
+ * sockdir.
|
||||
+ */
|
||||
+int
|
||||
+guestfs_int_create_socketname (guestfs_h *g, const char *filename,
|
||||
+ char (*sockpath)[UNIX_PATH_MAX])
|
||||
+{
|
||||
+ int r;
|
||||
+
|
||||
+ if (guestfs_int_lazy_make_sockdir (g) == -1)
|
||||
+ return -1;
|
||||
+
|
||||
+ r = snprintf (*sockpath, UNIX_PATH_MAX, "%s/%s", g->sockdir, filename);
|
||||
+ if (r >= UNIX_PATH_MAX) {
|
||||
+ error (g, _("socket path too long: %s/%s"), g->sockdir, filename);
|
||||
+ return -1;
|
||||
+ }
|
||||
+ if (r < 0) {
|
||||
+ perrorf (g, _("%s"), g->sockdir);
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
/**
|
||||
* Create the supermin appliance directory under cachedir, if it does
|
||||
* not exist.
|
@ -0,0 +1,57 @@
|
||||
From ec56c62c90d2230e8edcfaaad4517be63f5e2183 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Thu, 20 Jul 2023 11:15:26 +0100
|
||||
Subject: [PATCH] daemon: lvm: Do reverse device name translation on pvs_full
|
||||
device fields
|
||||
|
||||
Intermittent test failures in virt-filesystems showed that when using
|
||||
the pvs_full API, the pv_name field in the returned list of structures
|
||||
was not being reverse translated. As a result internal partition
|
||||
names could appear in the output of virt-filesystems.
|
||||
|
||||
See: https://listman.redhat.com/archives/libguestfs/2023-July/032058.html
|
||||
(cherry picked from commit 32cb5b45cfbe5edbc7643fc533da70db2d3c6cda)
|
||||
---
|
||||
daemon/lvm.c | 29 ++++++++++++++++++++++++++++-
|
||||
1 file changed, 28 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/daemon/lvm.c b/daemon/lvm.c
|
||||
index 7e76e17c..b8c01f71 100644
|
||||
--- a/daemon/lvm.c
|
||||
+++ b/daemon/lvm.c
|
||||
@@ -146,7 +146,34 @@ do_vgs (void)
|
||||
guestfs_int_lvm_pv_list *
|
||||
do_pvs_full (void)
|
||||
{
|
||||
- return parse_command_line_pvs ();
|
||||
+ guestfs_int_lvm_pv_list *r;
|
||||
+ size_t i;
|
||||
+ char *din, *dout;
|
||||
+
|
||||
+ r = parse_command_line_pvs ();
|
||||
+ if (r == NULL)
|
||||
+ /* parse_command_line_pvs has already called reply_with_error */
|
||||
+ return NULL;
|
||||
+
|
||||
+ /* The pv_name fields contain device names which must be reverse
|
||||
+ * translated. The problem here is that the generator does not have
|
||||
+ * a "FMountable" field type in types.mli.
|
||||
+ */
|
||||
+ for (i = 0; i < r->guestfs_int_lvm_pv_list_len; ++i) {
|
||||
+ din = r->guestfs_int_lvm_pv_list_val[i].pv_name;
|
||||
+ if (din) {
|
||||
+ dout = reverse_device_name_translation (din);
|
||||
+ if (!dout) {
|
||||
+ /* reverse_device_name_translation has already called reply_with_error*/
|
||||
+ /* XXX memory leak here */
|
||||
+ return NULL;
|
||||
+ }
|
||||
+ r->guestfs_int_lvm_pv_list_val[i].pv_name = dout;
|
||||
+ free (din);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return r;
|
||||
}
|
||||
|
||||
guestfs_int_lvm_vg_list *
|
@ -0,0 +1,208 @@
|
||||
From a55474caa5029c8356957afe36908ee45484ffde Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Thu, 21 Sep 2023 15:16:51 +0100
|
||||
Subject: [PATCH] ruby: Replace MiniTest with Minitest
|
||||
|
||||
See this commit in hivex:
|
||||
https://github.com/libguestfs/hivex/commit/fbcff7fbd8f96214c7f13f36bd7669a9142824ab
|
||||
|
||||
(cherry picked from commit d25a48e2dd2c2a2063b8d03a33b5e3cbe773c47d)
|
||||
---
|
||||
ruby/t/tc_010_load.rb | 2 +-
|
||||
ruby/t/tc_020_create.rb | 2 +-
|
||||
ruby/t/tc_030_create_flags.rb | 2 +-
|
||||
ruby/t/tc_040_create_multiple.rb | 2 +-
|
||||
ruby/t/tc_050_handle_properties.rb | 2 +-
|
||||
ruby/t/tc_060_explicit_close.rb | 2 +-
|
||||
ruby/t/tc_070_optargs.rb | 2 +-
|
||||
ruby/t/tc_090_retvalues.rb | 2 +-
|
||||
ruby/t/tc_100_launch.rb | 2 +-
|
||||
ruby/t/tc_410_close_event.rb | 2 +-
|
||||
ruby/t/tc_420_log_messages.rb | 2 +-
|
||||
ruby/t/tc_800_rhbz507346.rb | 2 +-
|
||||
ruby/t/tc_810_rhbz664558c6.rb | 2 +-
|
||||
ruby/t/tc_820_rhbz1046509.rb | 2 +-
|
||||
14 files changed, 14 insertions(+), 14 deletions(-)
|
||||
|
||||
diff --git a/ruby/t/tc_010_load.rb b/ruby/t/tc_010_load.rb
|
||||
index 9dc2db67..40ddccd8 100644
|
||||
--- a/ruby/t/tc_010_load.rb
|
||||
+++ b/ruby/t/tc_010_load.rb
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
require File::join(File::dirname(__FILE__), 'test_helper')
|
||||
|
||||
-class Test010Load < MiniTest::Unit::TestCase
|
||||
+class Test010Load < Minitest::Test
|
||||
def test_010_load
|
||||
end
|
||||
end
|
||||
diff --git a/ruby/t/tc_020_create.rb b/ruby/t/tc_020_create.rb
|
||||
index 840dd858..c3f5307e 100644
|
||||
--- a/ruby/t/tc_020_create.rb
|
||||
+++ b/ruby/t/tc_020_create.rb
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
require File::join(File::dirname(__FILE__), 'test_helper')
|
||||
|
||||
-class Test020Create < MiniTest::Unit::TestCase
|
||||
+class Test020Create < Minitest::Test
|
||||
def test_020_create
|
||||
g = Guestfs::Guestfs.new()
|
||||
refute_nil (g)
|
||||
diff --git a/ruby/t/tc_030_create_flags.rb b/ruby/t/tc_030_create_flags.rb
|
||||
index ac6d1f46..4949d2a8 100644
|
||||
--- a/ruby/t/tc_030_create_flags.rb
|
||||
+++ b/ruby/t/tc_030_create_flags.rb
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
require File::join(File::dirname(__FILE__), 'test_helper')
|
||||
|
||||
-class Test030CreateFlags < MiniTest::Unit::TestCase
|
||||
+class Test030CreateFlags < Minitest::Test
|
||||
def test_030_create_flags
|
||||
g = Guestfs::Guestfs.new(:environment => false, :close_on_exit => true)
|
||||
refute_nil (g)
|
||||
diff --git a/ruby/t/tc_040_create_multiple.rb b/ruby/t/tc_040_create_multiple.rb
|
||||
index 36e8edc7..623ccc6e 100644
|
||||
--- a/ruby/t/tc_040_create_multiple.rb
|
||||
+++ b/ruby/t/tc_040_create_multiple.rb
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
require File::join(File::dirname(__FILE__), 'test_helper')
|
||||
|
||||
-class Test040CreateMultiple < MiniTest::Unit::TestCase
|
||||
+class Test040CreateMultiple < Minitest::Test
|
||||
def test_040_create_multiple
|
||||
g1 = Guestfs::Guestfs.new()
|
||||
g2 = Guestfs::Guestfs.new()
|
||||
diff --git a/ruby/t/tc_050_handle_properties.rb b/ruby/t/tc_050_handle_properties.rb
|
||||
index 5928532e..b22c51fd 100644
|
||||
--- a/ruby/t/tc_050_handle_properties.rb
|
||||
+++ b/ruby/t/tc_050_handle_properties.rb
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
require File::join(File::dirname(__FILE__), 'test_helper')
|
||||
|
||||
-class Test050HandleProperties < MiniTest::Unit::TestCase
|
||||
+class Test050HandleProperties < Minitest::Test
|
||||
def test_050_handle_properties
|
||||
g = Guestfs::Guestfs.new()
|
||||
refute_nil (g)
|
||||
diff --git a/ruby/t/tc_060_explicit_close.rb b/ruby/t/tc_060_explicit_close.rb
|
||||
index 0c9118aa..20afd0de 100644
|
||||
--- a/ruby/t/tc_060_explicit_close.rb
|
||||
+++ b/ruby/t/tc_060_explicit_close.rb
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
require File::join(File::dirname(__FILE__), 'test_helper')
|
||||
|
||||
-class Test060ExplicitClose < MiniTest::Unit::TestCase
|
||||
+class Test060ExplicitClose < Minitest::Test
|
||||
def test_060_explicit_close
|
||||
g = Guestfs::Guestfs.new()
|
||||
refute_nil (g)
|
||||
diff --git a/ruby/t/tc_070_optargs.rb b/ruby/t/tc_070_optargs.rb
|
||||
index fff5fbf7..a2360b2f 100644
|
||||
--- a/ruby/t/tc_070_optargs.rb
|
||||
+++ b/ruby/t/tc_070_optargs.rb
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
require File::join(File::dirname(__FILE__), 'test_helper')
|
||||
|
||||
-class Test070Optargs < MiniTest::Unit::TestCase
|
||||
+class Test070Optargs < Minitest::Test
|
||||
def test_070_optargs
|
||||
g = Guestfs::Guestfs.new()
|
||||
|
||||
diff --git a/ruby/t/tc_090_retvalues.rb b/ruby/t/tc_090_retvalues.rb
|
||||
index 4bcc8b54..c9a84276 100644
|
||||
--- a/ruby/t/tc_090_retvalues.rb
|
||||
+++ b/ruby/t/tc_090_retvalues.rb
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
require File::join(File::dirname(__FILE__), 'test_helper')
|
||||
|
||||
-class Test090RetValues < MiniTest::Unit::TestCase
|
||||
+class Test090RetValues < Minitest::Test
|
||||
def test_090_retvalues
|
||||
g = Guestfs::Guestfs.new()
|
||||
|
||||
diff --git a/ruby/t/tc_100_launch.rb b/ruby/t/tc_100_launch.rb
|
||||
index 43db4b67..096cbd62 100644
|
||||
--- a/ruby/t/tc_100_launch.rb
|
||||
+++ b/ruby/t/tc_100_launch.rb
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
require File::join(File::dirname(__FILE__), 'test_helper')
|
||||
|
||||
-class Test100Launch < MiniTest::Unit::TestCase
|
||||
+class Test100Launch < Minitest::Test
|
||||
def test_100_launch
|
||||
g = Guestfs::Guestfs.new()
|
||||
|
||||
diff --git a/ruby/t/tc_410_close_event.rb b/ruby/t/tc_410_close_event.rb
|
||||
index 1b98957e..9a4e0558 100644
|
||||
--- a/ruby/t/tc_410_close_event.rb
|
||||
+++ b/ruby/t/tc_410_close_event.rb
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
require File::join(File::dirname(__FILE__), 'test_helper')
|
||||
|
||||
-class Test410CloseEvent < MiniTest::Unit::TestCase
|
||||
+class Test410CloseEvent < Minitest::Test
|
||||
def test_410_close_event
|
||||
g = Guestfs::Guestfs.new()
|
||||
|
||||
diff --git a/ruby/t/tc_420_log_messages.rb b/ruby/t/tc_420_log_messages.rb
|
||||
index 936e0fd4..a113c62e 100644
|
||||
--- a/ruby/t/tc_420_log_messages.rb
|
||||
+++ b/ruby/t/tc_420_log_messages.rb
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
require File::join(File::dirname(__FILE__), 'test_helper')
|
||||
|
||||
-class Test420LogMessages < MiniTest::Unit::TestCase
|
||||
+class Test420LogMessages < Minitest::Test
|
||||
def test_420_log_messages
|
||||
g = Guestfs::Guestfs.new()
|
||||
|
||||
diff --git a/ruby/t/tc_800_rhbz507346.rb b/ruby/t/tc_800_rhbz507346.rb
|
||||
index 4b7cc010..06767352 100644
|
||||
--- a/ruby/t/tc_800_rhbz507346.rb
|
||||
+++ b/ruby/t/tc_800_rhbz507346.rb
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
require File::join(File::dirname(__FILE__), 'test_helper')
|
||||
|
||||
-class Test800RHBZ507346 < MiniTest::Unit::TestCase
|
||||
+class Test800RHBZ507346 < Minitest::Test
|
||||
def test_800_rhbz507346
|
||||
g = Guestfs::Guestfs.new()
|
||||
exception = assert_raises TypeError do
|
||||
diff --git a/ruby/t/tc_810_rhbz664558c6.rb b/ruby/t/tc_810_rhbz664558c6.rb
|
||||
index f5e9adee..1504c070 100644
|
||||
--- a/ruby/t/tc_810_rhbz664558c6.rb
|
||||
+++ b/ruby/t/tc_810_rhbz664558c6.rb
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
require File::join(File::dirname(__FILE__), 'test_helper')
|
||||
|
||||
-class Test810RHBZ664558C6 < MiniTest::Unit::TestCase
|
||||
+class Test810RHBZ664558C6 < Minitest::Test
|
||||
def test_810_rhbz_664558c6
|
||||
g = Guestfs::Guestfs.new()
|
||||
|
||||
diff --git a/ruby/t/tc_820_rhbz1046509.rb b/ruby/t/tc_820_rhbz1046509.rb
|
||||
index 882ddb55..0595293d 100644
|
||||
--- a/ruby/t/tc_820_rhbz1046509.rb
|
||||
+++ b/ruby/t/tc_820_rhbz1046509.rb
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
require File::join(File::dirname(__FILE__), 'test_helper')
|
||||
|
||||
-class Test820RHBZ1046509 < MiniTest::Unit::TestCase
|
||||
+class Test820RHBZ1046509 < Minitest::Test
|
||||
def _handleok(g)
|
||||
g.add_drive("/dev/null")
|
||||
g.close()
|
@ -0,0 +1,278 @@
|
||||
From e22e17704988b606e24e76160495626552d0845f Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Thu, 21 Sep 2023 15:20:55 +0100
|
||||
Subject: [PATCH] ruby: Get rid of old Test::Unit compatibility
|
||||
|
||||
See this commit in hivex:
|
||||
https://github.com/libguestfs/hivex/commit/6dbbc474d3df5cdfd21ed5e692b3a58136fffc42
|
||||
|
||||
(cherry picked from commit ecf361d7237d38b2418ddecb1b70e3b722509c12)
|
||||
---
|
||||
ruby/Makefile.am | 3 +--
|
||||
ruby/t/tc_010_load.rb | 3 ++-
|
||||
ruby/t/tc_020_create.rb | 3 ++-
|
||||
ruby/t/tc_030_create_flags.rb | 3 ++-
|
||||
ruby/t/tc_040_create_multiple.rb | 3 ++-
|
||||
ruby/t/tc_050_handle_properties.rb | 3 ++-
|
||||
ruby/t/tc_060_explicit_close.rb | 3 ++-
|
||||
ruby/t/tc_070_optargs.rb | 3 ++-
|
||||
ruby/t/tc_090_retvalues.rb | 3 ++-
|
||||
ruby/t/tc_100_launch.rb | 3 ++-
|
||||
ruby/t/tc_410_close_event.rb | 3 ++-
|
||||
ruby/t/tc_420_log_messages.rb | 3 ++-
|
||||
ruby/t/tc_800_rhbz507346.rb | 3 ++-
|
||||
ruby/t/tc_810_rhbz664558c6.rb | 3 ++-
|
||||
ruby/t/tc_820_rhbz1046509.rb | 3 ++-
|
||||
ruby/t/test_helper.rb | 33 ------------------------------
|
||||
16 files changed, 29 insertions(+), 49 deletions(-)
|
||||
delete mode 100644 ruby/t/test_helper.rb
|
||||
|
||||
diff --git a/ruby/Makefile.am b/ruby/Makefile.am
|
||||
index c26513a7..867b05b1 100644
|
||||
--- a/ruby/Makefile.am
|
||||
+++ b/ruby/Makefile.am
|
||||
@@ -40,8 +40,7 @@ EXTRA_DIST = \
|
||||
lib/guestfs.rb \
|
||||
run-bindtests \
|
||||
run-ruby-tests \
|
||||
- t/tc_*.rb \
|
||||
- t/test_helper.rb
|
||||
+ t/tc_*.rb
|
||||
|
||||
CLEANFILES += \
|
||||
lib/*~ \
|
||||
diff --git a/ruby/t/tc_010_load.rb b/ruby/t/tc_010_load.rb
|
||||
index 40ddccd8..e7ec482e 100644
|
||||
--- a/ruby/t/tc_010_load.rb
|
||||
+++ b/ruby/t/tc_010_load.rb
|
||||
@@ -15,7 +15,8 @@
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
-require File::join(File::dirname(__FILE__), 'test_helper')
|
||||
+require 'minitest/autorun'
|
||||
+require 'guestfs'
|
||||
|
||||
class Test010Load < Minitest::Test
|
||||
def test_010_load
|
||||
diff --git a/ruby/t/tc_020_create.rb b/ruby/t/tc_020_create.rb
|
||||
index c3f5307e..26bb2ecf 100644
|
||||
--- a/ruby/t/tc_020_create.rb
|
||||
+++ b/ruby/t/tc_020_create.rb
|
||||
@@ -15,7 +15,8 @@
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
-require File::join(File::dirname(__FILE__), 'test_helper')
|
||||
+require 'minitest/autorun'
|
||||
+require 'guestfs'
|
||||
|
||||
class Test020Create < Minitest::Test
|
||||
def test_020_create
|
||||
diff --git a/ruby/t/tc_030_create_flags.rb b/ruby/t/tc_030_create_flags.rb
|
||||
index 4949d2a8..8006d962 100644
|
||||
--- a/ruby/t/tc_030_create_flags.rb
|
||||
+++ b/ruby/t/tc_030_create_flags.rb
|
||||
@@ -15,7 +15,8 @@
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
-require File::join(File::dirname(__FILE__), 'test_helper')
|
||||
+require 'minitest/autorun'
|
||||
+require 'guestfs'
|
||||
|
||||
class Test030CreateFlags < Minitest::Test
|
||||
def test_030_create_flags
|
||||
diff --git a/ruby/t/tc_040_create_multiple.rb b/ruby/t/tc_040_create_multiple.rb
|
||||
index 623ccc6e..32b2b094 100644
|
||||
--- a/ruby/t/tc_040_create_multiple.rb
|
||||
+++ b/ruby/t/tc_040_create_multiple.rb
|
||||
@@ -15,7 +15,8 @@
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
-require File::join(File::dirname(__FILE__), 'test_helper')
|
||||
+require 'minitest/autorun'
|
||||
+require 'guestfs'
|
||||
|
||||
class Test040CreateMultiple < Minitest::Test
|
||||
def test_040_create_multiple
|
||||
diff --git a/ruby/t/tc_050_handle_properties.rb b/ruby/t/tc_050_handle_properties.rb
|
||||
index b22c51fd..d37b1d03 100644
|
||||
--- a/ruby/t/tc_050_handle_properties.rb
|
||||
+++ b/ruby/t/tc_050_handle_properties.rb
|
||||
@@ -15,7 +15,8 @@
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
-require File::join(File::dirname(__FILE__), 'test_helper')
|
||||
+require 'minitest/autorun'
|
||||
+require 'guestfs'
|
||||
|
||||
class Test050HandleProperties < Minitest::Test
|
||||
def test_050_handle_properties
|
||||
diff --git a/ruby/t/tc_060_explicit_close.rb b/ruby/t/tc_060_explicit_close.rb
|
||||
index 20afd0de..8d103616 100644
|
||||
--- a/ruby/t/tc_060_explicit_close.rb
|
||||
+++ b/ruby/t/tc_060_explicit_close.rb
|
||||
@@ -15,7 +15,8 @@
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
-require File::join(File::dirname(__FILE__), 'test_helper')
|
||||
+require 'minitest/autorun'
|
||||
+require 'guestfs'
|
||||
|
||||
class Test060ExplicitClose < Minitest::Test
|
||||
def test_060_explicit_close
|
||||
diff --git a/ruby/t/tc_070_optargs.rb b/ruby/t/tc_070_optargs.rb
|
||||
index a2360b2f..c2298131 100644
|
||||
--- a/ruby/t/tc_070_optargs.rb
|
||||
+++ b/ruby/t/tc_070_optargs.rb
|
||||
@@ -15,7 +15,8 @@
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
-require File::join(File::dirname(__FILE__), 'test_helper')
|
||||
+require 'minitest/autorun'
|
||||
+require 'guestfs'
|
||||
|
||||
class Test070Optargs < Minitest::Test
|
||||
def test_070_optargs
|
||||
diff --git a/ruby/t/tc_090_retvalues.rb b/ruby/t/tc_090_retvalues.rb
|
||||
index c9a84276..d7927465 100644
|
||||
--- a/ruby/t/tc_090_retvalues.rb
|
||||
+++ b/ruby/t/tc_090_retvalues.rb
|
||||
@@ -15,7 +15,8 @@
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
-require File::join(File::dirname(__FILE__), 'test_helper')
|
||||
+require 'minitest/autorun'
|
||||
+require 'guestfs'
|
||||
|
||||
class Test090RetValues < Minitest::Test
|
||||
def test_090_retvalues
|
||||
diff --git a/ruby/t/tc_100_launch.rb b/ruby/t/tc_100_launch.rb
|
||||
index 096cbd62..c4da234e 100644
|
||||
--- a/ruby/t/tc_100_launch.rb
|
||||
+++ b/ruby/t/tc_100_launch.rb
|
||||
@@ -15,7 +15,8 @@
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
-require File::join(File::dirname(__FILE__), 'test_helper')
|
||||
+require 'minitest/autorun'
|
||||
+require 'guestfs'
|
||||
|
||||
class Test100Launch < Minitest::Test
|
||||
def test_100_launch
|
||||
diff --git a/ruby/t/tc_410_close_event.rb b/ruby/t/tc_410_close_event.rb
|
||||
index 9a4e0558..84cc11ab 100644
|
||||
--- a/ruby/t/tc_410_close_event.rb
|
||||
+++ b/ruby/t/tc_410_close_event.rb
|
||||
@@ -15,7 +15,8 @@
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
-require File::join(File::dirname(__FILE__), 'test_helper')
|
||||
+require 'minitest/autorun'
|
||||
+require 'guestfs'
|
||||
|
||||
class Test410CloseEvent < Minitest::Test
|
||||
def test_410_close_event
|
||||
diff --git a/ruby/t/tc_420_log_messages.rb b/ruby/t/tc_420_log_messages.rb
|
||||
index a113c62e..fd3049a0 100644
|
||||
--- a/ruby/t/tc_420_log_messages.rb
|
||||
+++ b/ruby/t/tc_420_log_messages.rb
|
||||
@@ -15,7 +15,8 @@
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
-require File::join(File::dirname(__FILE__), 'test_helper')
|
||||
+require 'minitest/autorun'
|
||||
+require 'guestfs'
|
||||
|
||||
class Test420LogMessages < Minitest::Test
|
||||
def test_420_log_messages
|
||||
diff --git a/ruby/t/tc_800_rhbz507346.rb b/ruby/t/tc_800_rhbz507346.rb
|
||||
index 06767352..54f7734f 100644
|
||||
--- a/ruby/t/tc_800_rhbz507346.rb
|
||||
+++ b/ruby/t/tc_800_rhbz507346.rb
|
||||
@@ -15,7 +15,8 @@
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
-require File::join(File::dirname(__FILE__), 'test_helper')
|
||||
+require 'minitest/autorun'
|
||||
+require 'guestfs'
|
||||
|
||||
class Test800RHBZ507346 < Minitest::Test
|
||||
def test_800_rhbz507346
|
||||
diff --git a/ruby/t/tc_810_rhbz664558c6.rb b/ruby/t/tc_810_rhbz664558c6.rb
|
||||
index 1504c070..5ffa2265 100644
|
||||
--- a/ruby/t/tc_810_rhbz664558c6.rb
|
||||
+++ b/ruby/t/tc_810_rhbz664558c6.rb
|
||||
@@ -19,7 +19,8 @@
|
||||
# the interpreter to segfault. See:
|
||||
# https://bugzilla.redhat.com/show_bug.cgi?id=664558#c6
|
||||
|
||||
-require File::join(File::dirname(__FILE__), 'test_helper')
|
||||
+require 'minitest/autorun'
|
||||
+require 'guestfs'
|
||||
|
||||
class Test810RHBZ664558C6 < Minitest::Test
|
||||
def test_810_rhbz_664558c6
|
||||
diff --git a/ruby/t/tc_820_rhbz1046509.rb b/ruby/t/tc_820_rhbz1046509.rb
|
||||
index 0595293d..b2a6d80b 100644
|
||||
--- a/ruby/t/tc_820_rhbz1046509.rb
|
||||
+++ b/ruby/t/tc_820_rhbz1046509.rb
|
||||
@@ -18,7 +18,8 @@
|
||||
# Test that we don't break the old ::create module function while
|
||||
# fixing https://bugzilla.redhat.com/show_bug.cgi?id=1046509
|
||||
|
||||
-require File::join(File::dirname(__FILE__), 'test_helper')
|
||||
+require 'minitest/autorun'
|
||||
+require 'guestfs'
|
||||
|
||||
class Test820RHBZ1046509 < Minitest::Test
|
||||
def _handleok(g)
|
||||
diff --git a/ruby/t/test_helper.rb b/ruby/t/test_helper.rb
|
||||
deleted file mode 100644
|
||||
index 54f857ce..00000000
|
||||
--- a/ruby/t/test_helper.rb
|
||||
+++ /dev/null
|
||||
@@ -1,33 +0,0 @@
|
||||
-# libguestfs Ruby bindings -*- ruby -*-
|
||||
-# Copyright (C) 2009-2023 Red Hat Inc.
|
||||
-#
|
||||
-# This program is free software; you can redistribute it and/or modify
|
||||
-# it under the terms of the GNU General Public License as published by
|
||||
-# the Free Software Foundation; either version 2 of the License, or
|
||||
-# (at your option) any later version.
|
||||
-#
|
||||
-# This program is distributed in the hope that it will be useful,
|
||||
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
-# GNU General Public License for more details.
|
||||
-#
|
||||
-# You should have received a copy of the GNU General Public License
|
||||
-# along with this program; if not, write to the Free Software
|
||||
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
-
|
||||
-begin
|
||||
- require 'minitest/autorun'
|
||||
-rescue LoadError
|
||||
- require 'test/unit'
|
||||
- MiniTest = Test
|
||||
- module Test
|
||||
- Assertions = Unit::Assertions
|
||||
- module Assertions
|
||||
- alias refute_nil assert_not_nil
|
||||
- end
|
||||
- end
|
||||
-end
|
||||
-
|
||||
-$:.unshift(File::join(File::dirname(__FILE__), "..", "lib"))
|
||||
-$:.unshift(File::join(File::dirname(__FILE__), "..", "ext", "guestfs"))
|
||||
-require 'guestfs'
|
@ -0,0 +1,63 @@
|
||||
From 205e2219b977e70c97ea4b55153d94dc3df91c28 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Thu, 26 Oct 2023 21:06:21 +0100
|
||||
Subject: [PATCH] generator: Sort virt-customize options into alphabetical
|
||||
order
|
||||
|
||||
(cherry picked from commit 297db5cccc1eb6e838f35d38e60fac894b372676)
|
||||
---
|
||||
generator/customize.ml | 34 +++++++++++++++++-----------------
|
||||
1 file changed, 17 insertions(+), 17 deletions(-)
|
||||
|
||||
diff --git a/generator/customize.ml b/generator/customize.ml
|
||||
index fe87ef5e..c3dd259e 100644
|
||||
--- a/generator/customize.ml
|
||||
+++ b/generator/customize.ml
|
||||
@@ -510,23 +510,6 @@ You can have multiple I<--ssh-inject> options, for different users
|
||||
and also for more keys for each user."
|
||||
};
|
||||
|
||||
- { op_name = "truncate";
|
||||
- op_type = String "FILE";
|
||||
- op_discrim = "`Truncate";
|
||||
- op_shortdesc = "Truncate a file to zero size";
|
||||
- op_pod_longdesc = "\
|
||||
-This command truncates C<FILE> to a zero-length file. The file must exist
|
||||
-already.";
|
||||
- };
|
||||
-
|
||||
- { op_name = "truncate-recursive";
|
||||
- op_type = String "PATH";
|
||||
- op_discrim = "`TruncateRecursive";
|
||||
- op_shortdesc = "Recursively truncate all files in directory";
|
||||
- op_pod_longdesc = "\
|
||||
-This command recursively truncates all files under C<PATH> to zero-length.";
|
||||
- };
|
||||
-
|
||||
{ op_name = "timezone";
|
||||
op_type = String "TIMEZONE";
|
||||
op_discrim = "`Timezone";
|
||||
@@ -544,6 +527,23 @@ string like C<Europe/London>";
|
||||
This command performs a L<touch(1)>-like operation on C<FILE>.";
|
||||
};
|
||||
|
||||
+ { op_name = "truncate";
|
||||
+ op_type = String "FILE";
|
||||
+ op_discrim = "`Truncate";
|
||||
+ op_shortdesc = "Truncate a file to zero size";
|
||||
+ op_pod_longdesc = "\
|
||||
+This command truncates C<FILE> to a zero-length file. The file must exist
|
||||
+already.";
|
||||
+ };
|
||||
+
|
||||
+ { op_name = "truncate-recursive";
|
||||
+ op_type = String "PATH";
|
||||
+ op_discrim = "`TruncateRecursive";
|
||||
+ op_shortdesc = "Recursively truncate all files in directory";
|
||||
+ op_pod_longdesc = "\
|
||||
+This command recursively truncates all files under C<PATH> to zero-length.";
|
||||
+ };
|
||||
+
|
||||
{ op_name = "uninstall";
|
||||
op_type = StringList "PKG,PKG..";
|
||||
op_discrim = "`UninstallPackages";
|
@ -0,0 +1,173 @@
|
||||
From 055c43fa60c7cefbe3baf32b21cfe8ffae09bf0f Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Thu, 26 Oct 2023 19:44:03 +0100
|
||||
Subject: [PATCH] generator: Add new virt-customize --tar-in operation
|
||||
|
||||
Using 'virt-customize --tar-in some.tar:/dir -a disk.img' will unpack
|
||||
'some.tar' into '/dir' in the guest. Note that this will not work for
|
||||
compressed tar files as written since the underlying guestfs_tar_in
|
||||
function requires the compression type to be set explicitly and
|
||||
defaults to no compression (it does not auto-detect or default to
|
||||
compression).
|
||||
|
||||
(cherry picked from commit b5f7b0ec18e30d25342bc322e571edf17a72974f)
|
||||
---
|
||||
common | 2 +-
|
||||
generator/customize.ml | 12 ++++++++++++
|
||||
2 files changed, 13 insertions(+), 1 deletion(-)
|
||||
|
||||
Submodule common e70d89a5..9a8ba593:
|
||||
diff --git a/common/mlcustomize/customize-options.pod b/common/mlcustomize/customize-options.pod
|
||||
index e658a447..ff93630d 100644
|
||||
--- a/common/mlcustomize/customize-options.pod
|
||||
+++ b/common/mlcustomize/customize-options.pod
|
||||
@@ -427,6 +427,14 @@ the C<SELECTOR> field.
|
||||
You can have multiple I<--ssh-inject> options, for different users
|
||||
and also for more keys for each user.
|
||||
|
||||
+=item B<--tar-in> TARFILE:REMOTEDIR
|
||||
+
|
||||
+Copy local files or directories from a local tar file
|
||||
+called C<TARFILE> into the disk image, placing them in the
|
||||
+directory C<REMOTEDIR> (which must exist). Note that
|
||||
+the tar file must be uncompressed (F<.tar.gz> files will not work
|
||||
+here)
|
||||
+
|
||||
=item B<--timezone> TIMEZONE
|
||||
|
||||
Set the default timezone of the guest to C<TIMEZONE>. Use a location
|
||||
diff --git a/common/mlcustomize/customize-synopsis.pod b/common/mlcustomize/customize-synopsis.pod
|
||||
index 5031b015..bb0ce125 100644
|
||||
--- a/common/mlcustomize/customize-synopsis.pod
|
||||
+++ b/common/mlcustomize/customize-synopsis.pod
|
||||
@@ -9,8 +9,9 @@
|
||||
[--password USER:SELECTOR] [--root-password SELECTOR]
|
||||
[--run SCRIPT] [--run-command 'CMD+ARGS'] [--scrub FILE]
|
||||
[--sm-attach SELECTOR] [--sm-register] [--sm-remove]
|
||||
- [--sm-unregister] [--ssh-inject USER[:SELECTOR]] [--truncate FILE]
|
||||
- [--truncate-recursive PATH] [--timezone TIMEZONE] [--touch FILE]
|
||||
+ [--sm-unregister] [--ssh-inject USER[:SELECTOR]]
|
||||
+ [--tar-in TARFILE:REMOTEDIR] [--timezone TIMEZONE] [--touch FILE]
|
||||
+ [--truncate FILE] [--truncate-recursive PATH]
|
||||
[--uninstall PKG,PKG..] [--update] [--upload FILE:DEST]
|
||||
[--write FILE:CONTENT] [--no-logfile]
|
||||
[--password-crypto md5|sha256|sha512] [--no-selinux-relabel]
|
||||
diff --git a/common/mlcustomize/customize_cmdline.ml b/common/mlcustomize/customize_cmdline.ml
|
||||
index 3ce901db..245d9960 100644
|
||||
--- a/common/mlcustomize/customize_cmdline.ml
|
||||
+++ b/common/mlcustomize/customize_cmdline.ml
|
||||
@@ -93,14 +93,16 @@ and op = [
|
||||
(* --sm-unregister *)
|
||||
| `SSHInject of string * Ssh_key.ssh_key_selector
|
||||
(* --ssh-inject USER[:SELECTOR] *)
|
||||
- | `Truncate of string
|
||||
- (* --truncate FILE *)
|
||||
- | `TruncateRecursive of string
|
||||
- (* --truncate-recursive PATH *)
|
||||
+ | `TarIn of string * string
|
||||
+ (* --tar-in TARFILE:REMOTEDIR *)
|
||||
| `Timezone of string
|
||||
(* --timezone TIMEZONE *)
|
||||
| `Touch of string
|
||||
(* --touch FILE *)
|
||||
+ | `Truncate of string
|
||||
+ (* --truncate FILE *)
|
||||
+ | `TruncateRecursive of string
|
||||
+ (* --truncate-recursive PATH *)
|
||||
| `UninstallPackages of string list
|
||||
(* --uninstall PKG,PKG.. *)
|
||||
| `Update
|
||||
@@ -418,17 +420,16 @@ let rec argspec () =
|
||||
),
|
||||
Some "USER[:SELECTOR]", "Inject an ssh key so the given C<USER> will be able to log in over\nssh without supplying a password. The C<USER> must exist already\nin the guest.\n\nSee L<virt-builder(1)/SSH KEYS> for the format of\nthe C<SELECTOR> field.\n\nYou can have multiple I<--ssh-inject> options, for different users\nand also for more keys for each user.";
|
||||
(
|
||||
- [ L"truncate" ],
|
||||
- Getopt.String (s_"FILE", fun s -> List.push_front (`Truncate s) ops),
|
||||
- s_"Truncate a file to zero size"
|
||||
+ [ L"tar-in" ],
|
||||
+ Getopt.String (
|
||||
+ s_"TARFILE:REMOTEDIR",
|
||||
+ fun s ->
|
||||
+ let p = split_string_pair "tar-in" s in
|
||||
+ List.push_front (`TarIn p) ops
|
||||
+ ),
|
||||
+ s_"Copy local files or directories from a tarball into image"
|
||||
),
|
||||
- Some "FILE", "This command truncates C<FILE> to a zero-length file. The file must exist\nalready.";
|
||||
- (
|
||||
- [ L"truncate-recursive" ],
|
||||
- Getopt.String (s_"PATH", fun s -> List.push_front (`TruncateRecursive s) ops),
|
||||
- s_"Recursively truncate all files in directory"
|
||||
- ),
|
||||
- Some "PATH", "This command recursively truncates all files under C<PATH> to zero-length.";
|
||||
+ Some "TARFILE:REMOTEDIR", "Copy local files or directories from a local tar file\ncalled C<TARFILE> into the disk image, placing them in the\ndirectory C<REMOTEDIR> (which must exist). Note that\nthe tar file must be uncompressed (F<.tar.gz> files will not work\nhere)";
|
||||
(
|
||||
[ L"timezone" ],
|
||||
Getopt.String (s_"TIMEZONE", fun s -> List.push_front (`Timezone s) ops),
|
||||
@@ -441,6 +442,18 @@ let rec argspec () =
|
||||
s_"Run touch on a file"
|
||||
),
|
||||
Some "FILE", "This command performs a L<touch(1)>-like operation on C<FILE>.";
|
||||
+ (
|
||||
+ [ L"truncate" ],
|
||||
+ Getopt.String (s_"FILE", fun s -> List.push_front (`Truncate s) ops),
|
||||
+ s_"Truncate a file to zero size"
|
||||
+ ),
|
||||
+ Some "FILE", "This command truncates C<FILE> to a zero-length file. The file must exist\nalready.";
|
||||
+ (
|
||||
+ [ L"truncate-recursive" ],
|
||||
+ Getopt.String (s_"PATH", fun s -> List.push_front (`TruncateRecursive s) ops),
|
||||
+ s_"Recursively truncate all files in directory"
|
||||
+ ),
|
||||
+ Some "PATH", "This command recursively truncates all files under C<PATH> to zero-length.";
|
||||
(
|
||||
[ L"uninstall" ],
|
||||
Getopt.String (
|
||||
diff --git a/common/mlcustomize/customize_cmdline.mli b/common/mlcustomize/customize_cmdline.mli
|
||||
index 112b74dc..51a156ea 100644
|
||||
--- a/common/mlcustomize/customize_cmdline.mli
|
||||
+++ b/common/mlcustomize/customize_cmdline.mli
|
||||
@@ -85,14 +85,16 @@ and op = [
|
||||
(* --sm-unregister *)
|
||||
| `SSHInject of string * Ssh_key.ssh_key_selector
|
||||
(* --ssh-inject USER[:SELECTOR] *)
|
||||
- | `Truncate of string
|
||||
- (* --truncate FILE *)
|
||||
- | `TruncateRecursive of string
|
||||
- (* --truncate-recursive PATH *)
|
||||
+ | `TarIn of string * string
|
||||
+ (* --tar-in TARFILE:REMOTEDIR *)
|
||||
| `Timezone of string
|
||||
(* --timezone TIMEZONE *)
|
||||
| `Touch of string
|
||||
(* --touch FILE *)
|
||||
+ | `Truncate of string
|
||||
+ (* --truncate FILE *)
|
||||
+ | `TruncateRecursive of string
|
||||
+ (* --truncate-recursive PATH *)
|
||||
| `UninstallPackages of string list
|
||||
(* --uninstall PKG,PKG.. *)
|
||||
| `Update
|
||||
diff --git a/generator/customize.ml b/generator/customize.ml
|
||||
index c3dd259e..e64b45c0 100644
|
||||
--- a/generator/customize.ml
|
||||
+++ b/generator/customize.ml
|
||||
@@ -510,6 +510,18 @@ You can have multiple I<--ssh-inject> options, for different users
|
||||
and also for more keys for each user."
|
||||
};
|
||||
|
||||
+ { op_name = "tar-in";
|
||||
+ op_type = StringPair "TARFILE:REMOTEDIR";
|
||||
+ op_discrim = "`TarIn";
|
||||
+ op_shortdesc = "Copy local files or directories from a tarball into image";
|
||||
+ op_pod_longdesc = "\
|
||||
+Copy local files or directories from a local tar file
|
||||
+called C<TARFILE> into the disk image, placing them in the
|
||||
+directory C<REMOTEDIR> (which must exist). Note that
|
||||
+the tar file must be uncompressed (F<.tar.gz> files will not work
|
||||
+here)";
|
||||
+ };
|
||||
+
|
||||
{ op_name = "timezone";
|
||||
op_type = String "TIMEZONE";
|
||||
op_discrim = "`Timezone";
|
@ -0,0 +1,271 @@
|
||||
From 0c1d7af8fdbf272f33ccd572ed34923ab094d695 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Thu, 16 Nov 2023 10:38:59 +0000
|
||||
Subject: [PATCH] New mailing list email address
|
||||
|
||||
(cherry picked from commit 0b8b1e4b2d70cf4ed59775c3c2d1aa42d3c29ca2)
|
||||
---
|
||||
.gitpublish | 2 +-
|
||||
appliance/Makefile.am | 2 +-
|
||||
po-docs/Makefile.am | 2 +-
|
||||
po-docs/cs.po | 2 +-
|
||||
po-docs/de.po | 2 +-
|
||||
po-docs/en_GB.po | 2 +-
|
||||
po-docs/es.po | 2 +-
|
||||
po-docs/eu.po | 2 +-
|
||||
po-docs/fi.po | 2 +-
|
||||
po-docs/fr.po | 2 +-
|
||||
po-docs/ja.po | 2 +-
|
||||
po-docs/libguestfs-docs.pot | 2 +-
|
||||
po-docs/nl.po | 2 +-
|
||||
po-docs/pt_BR.po | 2 +-
|
||||
po-docs/si.po | 2 +-
|
||||
po-docs/tg.po | 2 +-
|
||||
po-docs/uk.po | 2 +-
|
||||
po-docs/zh_CN.po | 2 +-
|
||||
python/setup.py.in | 2 +-
|
||||
19 files changed, 19 insertions(+), 19 deletions(-)
|
||||
|
||||
diff --git a/.gitpublish b/.gitpublish
|
||||
index 9775dd23..2aae0c09 100644
|
||||
--- a/.gitpublish
|
||||
+++ b/.gitpublish
|
||||
@@ -1,3 +1,3 @@
|
||||
[gitpublishprofile "default"]
|
||||
base = master
|
||||
-to = libguestfs@redhat.com
|
||||
+to = guestfs@lists.libguestfs.org
|
||||
diff --git a/appliance/Makefile.am b/appliance/Makefile.am
|
||||
index 063c19f6..8cb9bd1f 100644
|
||||
--- a/appliance/Makefile.am
|
||||
+++ b/appliance/Makefile.am
|
||||
@@ -88,7 +88,7 @@ else
|
||||
if HAVE_PACMAN
|
||||
QUERY_FILES_CMD := xargs pacman -Qo | sed -r 's/.* is owned by ([^ ]+) .*/\1/'
|
||||
else
|
||||
-$(error Error: Unknown Linux distribution "$(DISTRO)". Please add support to m4/guestfs-appliance.m4 and appliance/Makefile.am and send a patch upstream to libguestfs@redhat.com)
|
||||
+$(error Error: Unknown Linux distribution "$(DISTRO)". Please add support to m4/guestfs-appliance.m4 and appliance/Makefile.am and send a patch upstream to guestfs@lists.libguestfs.org)
|
||||
endif !HAVE_PACMAN
|
||||
endif !HAVE_DPKG
|
||||
endif !HAVE_RPM
|
||||
diff --git a/po-docs/Makefile.am b/po-docs/Makefile.am
|
||||
index 61c1b1c9..330b673f 100644
|
||||
--- a/po-docs/Makefile.am
|
||||
+++ b/po-docs/Makefile.am
|
||||
@@ -46,7 +46,7 @@ libguestfs-docs.pot:
|
||||
-M utf-8 -L utf-8 \
|
||||
--package-name $(PACKAGE_NAME) \
|
||||
--package-version $(PACKAGE_VERSION) \
|
||||
- --msgid-bugs-address libguestfs@redhat.com \
|
||||
+ --msgid-bugs-address guestfs@lists.libguestfs.org \
|
||||
--copyright-holder "Red Hat Inc." \
|
||||
-p $(abs_srcdir)/$@ \
|
||||
$(patsubst %,-m %,$(shell cat $(srcdir)/podfiles))
|
||||
diff --git a/po-docs/cs.po b/po-docs/cs.po
|
||||
index 5618cb0f..d50e53bf 100644
|
||||
--- a/po-docs/cs.po
|
||||
+++ b/po-docs/cs.po
|
||||
@@ -3,7 +3,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: libguestfs 1.39.12\n"
|
||||
-"Report-Msgid-Bugs-To: libguestfs@redhat.com\n"
|
||||
+"Report-Msgid-Bugs-To: guestfs@lists.libguestfs.org\n"
|
||||
"POT-Creation-Date: 2020-07-06 15:46+0100\n"
|
||||
"PO-Revision-Date: 2017-09-11 04:54+0000\n"
|
||||
"Last-Translator: Zdenek <chmelarz@gmail.com>\n"
|
||||
diff --git a/po-docs/de.po b/po-docs/de.po
|
||||
index da449e9f..76abc8d3 100644
|
||||
--- a/po-docs/de.po
|
||||
+++ b/po-docs/de.po
|
||||
@@ -7,7 +7,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: libguestfs 1.39.12\n"
|
||||
-"Report-Msgid-Bugs-To: libguestfs@redhat.com\n"
|
||||
+"Report-Msgid-Bugs-To: guestfs@lists.libguestfs.org\n"
|
||||
"POT-Creation-Date: 2020-07-06 15:46+0100\n"
|
||||
"PO-Revision-Date: 2021-11-18 23:16+0000\n"
|
||||
"Last-Translator: Ettore Atalan <atalanttore@googlemail.com>\n"
|
||||
diff --git a/po-docs/en_GB.po b/po-docs/en_GB.po
|
||||
index 283402a6..75610b9e 100644
|
||||
--- a/po-docs/en_GB.po
|
||||
+++ b/po-docs/en_GB.po
|
||||
@@ -6,7 +6,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: libguestfs 1.39.12\n"
|
||||
-"Report-Msgid-Bugs-To: libguestfs@redhat.com\n"
|
||||
+"Report-Msgid-Bugs-To: guestfs@lists.libguestfs.org\n"
|
||||
"POT-Creation-Date: 2020-07-06 15:46+0100\n"
|
||||
"PO-Revision-Date: 2015-02-21 10:15+0000\n"
|
||||
"Last-Translator: Copied by Zanata <copied-by-zanata@zanata.org>\n"
|
||||
diff --git a/po-docs/es.po b/po-docs/es.po
|
||||
index a163e26d..defbd61d 100644
|
||||
--- a/po-docs/es.po
|
||||
+++ b/po-docs/es.po
|
||||
@@ -9,7 +9,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: libguestfs 1.39.12\n"
|
||||
-"Report-Msgid-Bugs-To: libguestfs@redhat.com\n"
|
||||
+"Report-Msgid-Bugs-To: guestfs@lists.libguestfs.org\n"
|
||||
"POT-Creation-Date: 2020-07-06 15:46+0100\n"
|
||||
"PO-Revision-Date: 2023-02-05 15:20+0000\n"
|
||||
"Last-Translator: Emilio Herrera <ehespinosa57@gmail.com>\n"
|
||||
diff --git a/po-docs/eu.po b/po-docs/eu.po
|
||||
index 7f1f634b..63653271 100644
|
||||
--- a/po-docs/eu.po
|
||||
+++ b/po-docs/eu.po
|
||||
@@ -7,7 +7,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: libguestfs 1.39.12\n"
|
||||
-"Report-Msgid-Bugs-To: libguestfs@redhat.com\n"
|
||||
+"Report-Msgid-Bugs-To: guestfs@lists.libguestfs.org\n"
|
||||
"POT-Creation-Date: 2020-07-06 15:46+0100\n"
|
||||
"PO-Revision-Date: 2015-02-21 10:17+0000\n"
|
||||
"Last-Translator: Copied by Zanata <copied-by-zanata@zanata.org>\n"
|
||||
diff --git a/po-docs/fi.po b/po-docs/fi.po
|
||||
index d96bfd38..361de115 100644
|
||||
--- a/po-docs/fi.po
|
||||
+++ b/po-docs/fi.po
|
||||
@@ -6,7 +6,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: libguestfs 1.43.1\n"
|
||||
-"Report-Msgid-Bugs-To: libguestfs@redhat.com\n"
|
||||
+"Report-Msgid-Bugs-To: guestfs@lists.libguestfs.org\n"
|
||||
"POT-Creation-Date: 2020-08-12 15:34+0200\n"
|
||||
"PO-Revision-Date: 2022-12-23 18:20+0000\n"
|
||||
"Last-Translator: Jan Kuparinen <copper_fin@hotmail.com>\n"
|
||||
diff --git a/po-docs/fr.po b/po-docs/fr.po
|
||||
index f411d189..cd903c0e 100644
|
||||
--- a/po-docs/fr.po
|
||||
+++ b/po-docs/fr.po
|
||||
@@ -8,7 +8,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: libguestfs 1.39.12\n"
|
||||
-"Report-Msgid-Bugs-To: libguestfs@redhat.com\n"
|
||||
+"Report-Msgid-Bugs-To: guestfs@lists.libguestfs.org\n"
|
||||
"POT-Creation-Date: 2020-07-06 15:46+0100\n"
|
||||
"PO-Revision-Date: 2015-02-21 10:19+0000\n"
|
||||
"Last-Translator: Copied by Zanata <copied-by-zanata@zanata.org>\n"
|
||||
diff --git a/po-docs/ja.po b/po-docs/ja.po
|
||||
index 4120b2de..d90437dc 100644
|
||||
--- a/po-docs/ja.po
|
||||
+++ b/po-docs/ja.po
|
||||
@@ -12,7 +12,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: libguestfs 1.39.12\n"
|
||||
-"Report-Msgid-Bugs-To: libguestfs@redhat.com\n"
|
||||
+"Report-Msgid-Bugs-To: guestfs@lists.libguestfs.org\n"
|
||||
"POT-Creation-Date: 2020-07-06 15:46+0100\n"
|
||||
"PO-Revision-Date: 2017-02-24 07:33+0000\n"
|
||||
"Last-Translator: Copied by Zanata <copied-by-zanata@zanata.org>\n"
|
||||
diff --git a/po-docs/libguestfs-docs.pot b/po-docs/libguestfs-docs.pot
|
||||
index 8e33712f..3954a51e 100644
|
||||
--- a/po-docs/libguestfs-docs.pot
|
||||
+++ b/po-docs/libguestfs-docs.pot
|
||||
@@ -7,7 +7,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: libguestfs 1.43.1\n"
|
||||
-"Report-Msgid-Bugs-To: libguestfs@redhat.com\n"
|
||||
+"Report-Msgid-Bugs-To: guestfs@lists.libguestfs.org\n"
|
||||
"POT-Creation-Date: 2020-08-12 15:34+0200\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
diff --git a/po-docs/nl.po b/po-docs/nl.po
|
||||
index 571f3523..0cf147ee 100644
|
||||
--- a/po-docs/nl.po
|
||||
+++ b/po-docs/nl.po
|
||||
@@ -7,7 +7,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: libguestfs 1.39.12\n"
|
||||
-"Report-Msgid-Bugs-To: libguestfs@redhat.com\n"
|
||||
+"Report-Msgid-Bugs-To: guestfs@lists.libguestfs.org\n"
|
||||
"POT-Creation-Date: 2020-07-06 15:46+0100\n"
|
||||
"PO-Revision-Date: 2015-02-21 10:33+0000\n"
|
||||
"Last-Translator: Copied by Zanata <copied-by-zanata@zanata.org>\n"
|
||||
diff --git a/po-docs/pt_BR.po b/po-docs/pt_BR.po
|
||||
index 87c0059f..229f49c3 100644
|
||||
--- a/po-docs/pt_BR.po
|
||||
+++ b/po-docs/pt_BR.po
|
||||
@@ -3,7 +3,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: libguestfs 1.39.12\n"
|
||||
-"Report-Msgid-Bugs-To: libguestfs@redhat.com\n"
|
||||
+"Report-Msgid-Bugs-To: guestfs@lists.libguestfs.org\n"
|
||||
"POT-Creation-Date: 2020-07-06 15:46+0100\n"
|
||||
"PO-Revision-Date: 2017-01-29 09:50+0000\n"
|
||||
"Last-Translator: Rodrigo de Araujo Sousa Fonseca "
|
||||
diff --git a/po-docs/si.po b/po-docs/si.po
|
||||
index e7327945..aa7f5f97 100644
|
||||
--- a/po-docs/si.po
|
||||
+++ b/po-docs/si.po
|
||||
@@ -6,7 +6,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: libguestfs 1.43.1\n"
|
||||
-"Report-Msgid-Bugs-To: libguestfs@redhat.com\n"
|
||||
+"Report-Msgid-Bugs-To: guestfs@lists.libguestfs.org\n"
|
||||
"POT-Creation-Date: 2020-08-12 15:34+0200\n"
|
||||
"PO-Revision-Date: 2021-08-19 07:04+0000\n"
|
||||
"Last-Translator: Hela Basa <r45xveza@pm.me>\n"
|
||||
diff --git a/po-docs/tg.po b/po-docs/tg.po
|
||||
index 446653ab..9e6fa072 100644
|
||||
--- a/po-docs/tg.po
|
||||
+++ b/po-docs/tg.po
|
||||
@@ -6,7 +6,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: libguestfs 1.39.12\n"
|
||||
-"Report-Msgid-Bugs-To: libguestfs@redhat.com\n"
|
||||
+"Report-Msgid-Bugs-To: guestfs@lists.libguestfs.org\n"
|
||||
"POT-Creation-Date: 2020-07-06 15:46+0100\n"
|
||||
"PO-Revision-Date: 2015-02-21 10:34+0000\n"
|
||||
"Last-Translator: Copied by Zanata <copied-by-zanata@zanata.org>\n"
|
||||
diff --git a/po-docs/uk.po b/po-docs/uk.po
|
||||
index 52b5ce56..960ea8f8 100644
|
||||
--- a/po-docs/uk.po
|
||||
+++ b/po-docs/uk.po
|
||||
@@ -15,7 +15,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: libguestfs 1.39.12\n"
|
||||
-"Report-Msgid-Bugs-To: libguestfs@redhat.com\n"
|
||||
+"Report-Msgid-Bugs-To: guestfs@lists.libguestfs.org\n"
|
||||
"POT-Creation-Date: 2020-07-06 15:46+0100\n"
|
||||
"PO-Revision-Date: 2020-08-16 15:29+0000\n"
|
||||
"Last-Translator: Yuri Chornoivan <yurchor@ukr.net>\n"
|
||||
diff --git a/po-docs/zh_CN.po b/po-docs/zh_CN.po
|
||||
index 7c546775..0c15c1c1 100644
|
||||
--- a/po-docs/zh_CN.po
|
||||
+++ b/po-docs/zh_CN.po
|
||||
@@ -8,7 +8,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: libguestfs 1.39.12\n"
|
||||
-"Report-Msgid-Bugs-To: libguestfs@redhat.com\n"
|
||||
+"Report-Msgid-Bugs-To: guestfs@lists.libguestfs.org\n"
|
||||
"POT-Creation-Date: 2020-07-06 15:46+0100\n"
|
||||
"PO-Revision-Date: 2017-07-24 08:04+0000\n"
|
||||
"Last-Translator: cheng ye <18969068329@163.com>\n"
|
||||
diff --git a/python/setup.py.in b/python/setup.py.in
|
||||
index aa9fb7ad..17571944 100644
|
||||
--- a/python/setup.py.in
|
||||
+++ b/python/setup.py.in
|
||||
@@ -30,7 +30,7 @@ This package contains the Python bindings for libguestfs.
|
||||
""",
|
||||
|
||||
author='The @PACKAGE_NAME@ team',
|
||||
- author_email='libguestfs@redhat.com',
|
||||
+ author_email='guestfs@lists.libguestfs.org',
|
||||
url='http://libguestfs.org',
|
||||
|
||||
license='LGPLv2+',
|
@ -0,0 +1,25 @@
|
||||
From 64a928f631bc79d885d9822a3022c382cbd5fd55 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Mon, 27 Nov 2023 14:04:33 +0000
|
||||
Subject: [PATCH] lib: Include <libxml/parser.h> for xmlReadMemory
|
||||
|
||||
Since libxml2 2.12.1 including this header is required to have this
|
||||
function declared.
|
||||
|
||||
(cherry picked from commit 02c39dc5e8109ddb911d90759883a504008ba509)
|
||||
---
|
||||
lib/launch-libvirt.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/lib/launch-libvirt.c b/lib/launch-libvirt.c
|
||||
index d4bf1a8f..79465dd4 100644
|
||||
--- a/lib/launch-libvirt.c
|
||||
+++ b/lib/launch-libvirt.c
|
||||
@@ -38,6 +38,7 @@
|
||||
#include <libvirt/virterror.h>
|
||||
#endif
|
||||
|
||||
+#include <libxml/parser.h>
|
||||
#include <libxml/xmlwriter.h>
|
||||
#include <libxml/xpath.h>
|
||||
|
@ -0,0 +1,132 @@
|
||||
From 27aca404cfbfdf9b3d155fa0794f86936525f40c Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Wed, 13 Dec 2023 22:50:56 +0000
|
||||
Subject: [PATCH] ocaml: Use Gc.finalise instead of a C finalizer
|
||||
|
||||
Since OCaml 5.1.1, changes to custom blocks caused C finalizers that
|
||||
call caml_enter_blocking_section to stop working (if they ever did
|
||||
before). They are relatively inflexible compared to registering an
|
||||
OCaml finalizer (Gc.finalise) to call Guestfs.close, so use that
|
||||
instead.
|
||||
|
||||
Suggested-by: Guillaume Munch-Maccagnoni
|
||||
See: https://github.com/ocaml/ocaml/issues/12820
|
||||
See: https://gitlab.com/nbdkit/libnbd/-/commit/db48794fa89547a4799b832331e82b4b8b98f03d
|
||||
(cherry picked from commit 61418535ad63b5a2a91f1caf4703d7134834e4dd)
|
||||
---
|
||||
generator/OCaml.ml | 7 ++++-
|
||||
ocaml/guestfs-c.c | 69 +++++++++++++++++++++-------------------------
|
||||
2 files changed, 37 insertions(+), 39 deletions(-)
|
||||
|
||||
diff --git a/generator/OCaml.ml b/generator/OCaml.ml
|
||||
index 07ccd269..1e6f603a 100644
|
||||
--- a/generator/OCaml.ml
|
||||
+++ b/generator/OCaml.ml
|
||||
@@ -312,10 +312,15 @@ type t
|
||||
exception Error of string
|
||||
exception Handle_closed of string
|
||||
|
||||
-external create : ?environment:bool -> ?close_on_exit:bool -> unit -> t =
|
||||
+external _create : ?environment:bool -> ?close_on_exit:bool -> unit -> t =
|
||||
\"guestfs_int_ocaml_create\"
|
||||
external close : t -> unit = \"guestfs_int_ocaml_close\"
|
||||
|
||||
+let create ?environment ?close_on_exit () =
|
||||
+ let g = _create ?environment ?close_on_exit () in
|
||||
+ Gc.finalise close g;
|
||||
+ g
|
||||
+
|
||||
type event =
|
||||
";
|
||||
List.iter (
|
||||
diff --git a/ocaml/guestfs-c.c b/ocaml/guestfs-c.c
|
||||
index 8a8761e8..700c33ab 100644
|
||||
--- a/ocaml/guestfs-c.c
|
||||
+++ b/ocaml/guestfs-c.c
|
||||
@@ -61,43 +61,10 @@ value guestfs_int_ocaml_delete_event_callback (value gv, value eh);
|
||||
value guestfs_int_ocaml_event_to_string (value events);
|
||||
value guestfs_int_ocaml_last_errno (value gv);
|
||||
|
||||
-/* Allocate handles and deal with finalization. */
|
||||
-static void
|
||||
-guestfs_finalize (value gv)
|
||||
-{
|
||||
- guestfs_h *g = Guestfs_val (gv);
|
||||
-
|
||||
- if (g) {
|
||||
- /* There is a nasty, difficult to solve case here where the
|
||||
- * user deletes events in one of the callbacks that we are
|
||||
- * about to invoke, resulting in a double-free. XXX
|
||||
- */
|
||||
- size_t len;
|
||||
- value **roots = get_all_event_callbacks (g, &len);
|
||||
-
|
||||
- /* Close the handle: this could invoke callbacks from the list
|
||||
- * above, which is why we don't want to delete them before
|
||||
- * closing the handle.
|
||||
- */
|
||||
- caml_release_runtime_system ();
|
||||
- guestfs_close (g);
|
||||
- caml_acquire_runtime_system ();
|
||||
-
|
||||
- /* Now unregister the global roots. */
|
||||
- if (roots && len > 0) {
|
||||
- size_t i;
|
||||
- for (i = 0; i < len; ++i) {
|
||||
- caml_remove_generational_global_root (roots[i]);
|
||||
- free (roots[i]);
|
||||
- }
|
||||
- free (roots);
|
||||
- }
|
||||
- }
|
||||
-}
|
||||
-
|
||||
+/* Allocate handles. */
|
||||
static struct custom_operations guestfs_custom_operations = {
|
||||
(char *) "guestfs_custom_operations",
|
||||
- guestfs_finalize,
|
||||
+ custom_finalize_default,
|
||||
custom_compare_default,
|
||||
custom_hash_default,
|
||||
custom_serialize_default,
|
||||
@@ -179,11 +146,37 @@ value
|
||||
guestfs_int_ocaml_close (value gv)
|
||||
{
|
||||
CAMLparam1 (gv);
|
||||
+ guestfs_h *g = Guestfs_val (gv);
|
||||
|
||||
- guestfs_finalize (gv);
|
||||
+ if (g) {
|
||||
+ /* There is a nasty, difficult to solve case here where the
|
||||
+ * user deletes events in one of the callbacks that we are
|
||||
+ * about to invoke, resulting in a double-free. XXX
|
||||
+ */
|
||||
+ size_t len;
|
||||
+ value **roots = get_all_event_callbacks (g, &len);
|
||||
|
||||
- /* So we don't double-free in the finalizer. */
|
||||
- Guestfs_val (gv) = NULL;
|
||||
+ /* Close the handle: this could invoke callbacks from the list
|
||||
+ * above, which is why we don't want to delete them before
|
||||
+ * closing the handle.
|
||||
+ */
|
||||
+ caml_release_runtime_system ();
|
||||
+ guestfs_close (g);
|
||||
+ caml_acquire_runtime_system ();
|
||||
+
|
||||
+ /* Now unregister the global roots. */
|
||||
+ if (roots && len > 0) {
|
||||
+ size_t i;
|
||||
+ for (i = 0; i < len; ++i) {
|
||||
+ caml_remove_generational_global_root (roots[i]);
|
||||
+ free (roots[i]);
|
||||
+ }
|
||||
+ free (roots);
|
||||
+ }
|
||||
+
|
||||
+ /* So we don't double-free. */
|
||||
+ Guestfs_val (gv) = NULL;
|
||||
+ }
|
||||
|
||||
CAMLreturn (Val_unit);
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
From 9f52ab7794bf54169139995c5296aa5f39e47706 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Thu, 14 Dec 2023 08:33:10 +0000
|
||||
Subject: [PATCH] ocaml: Nullify custom block before releasing runtime lock
|
||||
|
||||
Avoids a potential, though if possible then very rare, double free
|
||||
path.
|
||||
|
||||
Suggested-by: Guillaume Munch-Maccagnoni
|
||||
See: https://github.com/ocaml/ocaml/issues/12820
|
||||
(cherry picked from commit e93fd7e8acf34192c0d1b70611e3474dde346941)
|
||||
---
|
||||
ocaml/guestfs-c.c | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/ocaml/guestfs-c.c b/ocaml/guestfs-c.c
|
||||
index 700c33ab..ea9a0598 100644
|
||||
--- a/ocaml/guestfs-c.c
|
||||
+++ b/ocaml/guestfs-c.c
|
||||
@@ -156,6 +156,9 @@ guestfs_int_ocaml_close (value gv)
|
||||
size_t len;
|
||||
value **roots = get_all_event_callbacks (g, &len);
|
||||
|
||||
+ /* So we don't double-free. */
|
||||
+ Guestfs_val (gv) = NULL;
|
||||
+
|
||||
/* Close the handle: this could invoke callbacks from the list
|
||||
* above, which is why we don't want to delete them before
|
||||
* closing the handle.
|
||||
@@ -173,9 +176,6 @@ guestfs_int_ocaml_close (value gv)
|
||||
}
|
||||
free (roots);
|
||||
}
|
||||
-
|
||||
- /* So we don't double-free. */
|
||||
- Guestfs_val (gv) = NULL;
|
||||
}
|
||||
|
||||
CAMLreturn (Val_unit);
|
@ -0,0 +1,162 @@
|
||||
From d015c300eb0d6ac1d366cf02b15b7aade7e3063a Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Thu, 14 Dec 2023 09:03:49 +0000
|
||||
Subject: [PATCH] Update common submodule
|
||||
|
||||
The list of patches is below. The one which matters for guestfish is
|
||||
addition of --key all:... selector.
|
||||
|
||||
Andrey Drobyshev (1):
|
||||
mldrivers: look for bootloader config in /boot/grub/grub.cfg in case of UEFI
|
||||
|
||||
Richard W.M. Jones (5):
|
||||
mlxml: Include <libxml/parser.h> for xmlReadMemory
|
||||
options/keys.c: Rewrite confusing match statement
|
||||
options: Rewrite --key documentation fragment
|
||||
options: Allow --key all:SELECTOR to be used to match any device
|
||||
mltools/libosinfo-c.c: Fix off-by-one error
|
||||
|
||||
Fixes: https://issues.redhat.com/browse/RHEL-19367
|
||||
(cherry picked from commit 7fd41b5a02b7a9d217150fa49940115a98aae329)
|
||||
---
|
||||
common | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
Submodule common 9a8ba593..0dba002c:
|
||||
diff --git a/common/mldrivers/linux_bootloaders.ml b/common/mldrivers/linux_bootloaders.ml
|
||||
index 6f8857ef..91c5ab9e 100644
|
||||
--- a/common/mldrivers/linux_bootloaders.ml
|
||||
+++ b/common/mldrivers/linux_bootloaders.ml
|
||||
@@ -375,6 +375,18 @@ let detect_bootloader (g : G.guestfs) root i_firmware =
|
||||
with G.Error msg ->
|
||||
error (f_"could not find bootloader mount point (%s): %s") mp msg in
|
||||
|
||||
+ (*
|
||||
+ * Workaround for older UEFI-based Debian which may not have
|
||||
+ * /boot/efi/EFI/debian/grub.cfg.
|
||||
+ *)
|
||||
+ let paths =
|
||||
+ if g#exists "/boot/grub/grub.cfg" then
|
||||
+ match i_firmware with
|
||||
+ | Firmware.I_BIOS -> paths
|
||||
+ | I_UEFI _ -> paths @ ["/boot/grub/grub.cfg"]
|
||||
+ else paths
|
||||
+ in
|
||||
+
|
||||
(* We can determine if the bootloader config file is grub 1 or
|
||||
* grub 2 just by looking at the filename.
|
||||
*)
|
||||
diff --git a/common/mltools/libosinfo-c.c b/common/mltools/libosinfo-c.c
|
||||
index 93357fd9..a48c8989 100644
|
||||
--- a/common/mltools/libosinfo-c.c
|
||||
+++ b/common/mltools/libosinfo-c.c
|
||||
@@ -296,7 +296,7 @@ v2v_osinfo_os_get_device_drivers (value osv)
|
||||
|
||||
driver = OSINFO_DEVICE_DRIVER(osinfo_list_get_nth (OSINFO_LIST(list), i));
|
||||
|
||||
- vi = caml_alloc (6, 0);
|
||||
+ vi = caml_alloc (7, 0);
|
||||
str = osinfo_device_driver_get_architecture (driver);
|
||||
copyv = caml_copy_string (str);
|
||||
Store_field (vi, 0, copyv);
|
||||
diff --git a/common/mlxml/xml-c.c b/common/mlxml/xml-c.c
|
||||
index 715c3bb2..e024bd8a 100644
|
||||
--- a/common/mlxml/xml-c.c
|
||||
+++ b/common/mlxml/xml-c.c
|
||||
@@ -34,6 +34,7 @@
|
||||
#include <caml/memory.h>
|
||||
#include <caml/mlvalues.h>
|
||||
|
||||
+#include <libxml/parser.h>
|
||||
#include <libxml/xpath.h>
|
||||
#include <libxml/xpathInternals.h>
|
||||
#include <libxml/uri.h>
|
||||
diff --git a/common/options/key-option.pod b/common/options/key-option.pod
|
||||
index 6bc04df1..1470d863 100644
|
||||
--- a/common/options/key-option.pod
|
||||
+++ b/common/options/key-option.pod
|
||||
@@ -1,22 +1,37 @@
|
||||
=item B<--key> SELECTOR
|
||||
|
||||
Specify a key for LUKS, to automatically open a LUKS device when using
|
||||
-the inspection. C<ID> can be either the libguestfs device name, or
|
||||
-the UUID of the LUKS device.
|
||||
+the inspection.
|
||||
|
||||
=over 4
|
||||
|
||||
-=item B<--key> C<ID>:key:KEY_STRING
|
||||
+=item B<--key> NAMEB<:key:>KEY_STRING
|
||||
+
|
||||
+=item B<--key> UUIDB<:key:>KEY_STRING
|
||||
+
|
||||
+=item B<--key> B<all:key:>KEY_STRING
|
||||
+
|
||||
+C<NAME> is the libguestfs device name (eg. C</dev/sda1>). C<UUID> is
|
||||
+the device UUID. C<all> means try the key against any encrypted
|
||||
+device.
|
||||
|
||||
Use the specified C<KEY_STRING> as passphrase.
|
||||
|
||||
-=item B<--key> C<ID>:file:FILENAME
|
||||
+=item B<--key> NAMEB<:file:>FILENAME
|
||||
+
|
||||
+=item B<--key> UUIDB<:file:>FILENAME
|
||||
+
|
||||
+=item B<--key> B<all:file:>FILENAME
|
||||
|
||||
Read the passphrase from F<FILENAME>.
|
||||
|
||||
-=item B<--key> C<ID>:clevis
|
||||
+=item B<--key> NAMEB<:clevis>
|
||||
|
||||
-Attempt passphrase-less unlocking for C<ID> with Clevis, over the
|
||||
+=item B<--key> UUIDB<:clevis>
|
||||
+
|
||||
+=item B<--key> B<all:clevis>
|
||||
+
|
||||
+Attempt passphrase-less unlocking for the device with Clevis, over the
|
||||
network. Please refer to L<guestfs(3)/ENCRYPTED DISKS> for more
|
||||
information on network-bound disk encryption (NBDE).
|
||||
|
||||
diff --git a/common/options/keys.c b/common/options/keys.c
|
||||
index 52b27369..87acba51 100644
|
||||
--- a/common/options/keys.c
|
||||
+++ b/common/options/keys.c
|
||||
@@ -20,6 +20,7 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
+#include <stdbool.h>
|
||||
#include <unistd.h>
|
||||
#include <termios.h>
|
||||
#include <string.h>
|
||||
@@ -152,9 +153,13 @@ get_keys (struct key_store *ks, const char *device, const char *uuid,
|
||||
if (ks) {
|
||||
for (i = 0; i < ks->nr_keys; ++i) {
|
||||
struct key_store_key *key = &ks->keys[i];
|
||||
+ bool key_id_matches_this_device;
|
||||
|
||||
- if (STRNEQ (key->id, device) && (!uuid || STRNEQ (key->id, uuid)))
|
||||
- continue;
|
||||
+ key_id_matches_this_device =
|
||||
+ STREQ (key->id, "all") || /* special string "all" matches any device */
|
||||
+ STREQ (key->id, device) ||
|
||||
+ (uuid && STREQ (key->id, uuid));
|
||||
+ if (!key_id_matches_this_device) continue;
|
||||
|
||||
switch (key->type) {
|
||||
case key_string:
|
||||
diff --git a/common/options/options.h b/common/options/options.h
|
||||
index 94e8b9ee..dcb15c28 100644
|
||||
--- a/common/options/options.h
|
||||
+++ b/common/options/options.h
|
||||
@@ -109,6 +109,8 @@ struct key_store_key {
|
||||
* device name, or the UUID.
|
||||
*
|
||||
* There may be multiple matching devices in the list.
|
||||
+ *
|
||||
+ * This may be the special string "all" which matches any device.
|
||||
*/
|
||||
char *id;
|
||||
|
@ -0,0 +1,35 @@
|
||||
From 335642539772cfee442989f56f1b5d7803e4111c Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Thu, 14 Dec 2023 09:15:08 +0000
|
||||
Subject: [PATCH] tests: Test guestfish --key all:... selector
|
||||
|
||||
(cherry picked from commit 40f43cc8ea6bd556749ee7ba280971aa8b043d27)
|
||||
---
|
||||
.../luks/test-key-option-inspect-luks-on-lvm.sh | 17 +++++++++++++++++
|
||||
1 file changed, 17 insertions(+)
|
||||
|
||||
diff --git a/tests/luks/test-key-option-inspect-luks-on-lvm.sh b/tests/luks/test-key-option-inspect-luks-on-lvm.sh
|
||||
index 932862b1..2b60c797 100755
|
||||
--- a/tests/luks/test-key-option-inspect-luks-on-lvm.sh
|
||||
+++ b/tests/luks/test-key-option-inspect-luks-on-lvm.sh
|
||||
@@ -119,3 +119,20 @@ eval "$fish_ref"
|
||||
|
||||
# Repeat the test.
|
||||
check_filesystems
|
||||
+
|
||||
+# Exit the current guestfish background process.
|
||||
+guestfish --remote -- exit
|
||||
+GUESTFISH_PID=
|
||||
+
|
||||
+# Test the --key all:... selector.
|
||||
+keys_by_mapper_lvname=(
|
||||
+ --key all:key:FEDORA-Root
|
||||
+ --key all:key:FEDORA-LV1
|
||||
+ --key all:key:FEDORA-LV2
|
||||
+ --key all:key:FEDORA-LV3
|
||||
+)
|
||||
+fish_ref=$("${guestfish[@]}" "${keys_by_mapper_lvname[@]}")
|
||||
+eval "$fish_ref"
|
||||
+
|
||||
+# Repeat the test.
|
||||
+check_filesystems
|
Loading…
Reference in new issue