Import CS
This commit is contained in:
		
							parent
							
								
									48070c5d69
								
							
						
					
					
						commit
						c435588f61
					
				
							
								
								
									
										2
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							| @ -1,3 +1,3 @@ | |||||||
| SOURCES/libguestfs-1.50.2.tar.gz | SOURCES/libguestfs-1.54.0.tar.gz | ||||||
| SOURCES/libguestfs.keyring | SOURCES/libguestfs.keyring | ||||||
| SOURCES/libguestfs-common-1.50.2.tar.gz | SOURCES/libguestfs-common-1.50.2.tar.gz | ||||||
|  | |||||||
| @ -1,3 +1,3 @@ | |||||||
| 9a4fcb78ca452e1cf04f0b541d938ab1b07019a6 SOURCES/libguestfs-1.50.2.tar.gz | 219ca9ffccfb7c6377f50343aeef1b955bbf1961 SOURCES/libguestfs-1.54.0.tar.gz | ||||||
| 1bbc40f501a7fef9eef2a39b701a71aee2fea7c4 SOURCES/libguestfs.keyring | 1bbc40f501a7fef9eef2a39b701a71aee2fea7c4 SOURCES/libguestfs.keyring | ||||||
| f801826d11e360a906bae5980495ac5425d709ae SOURCES/libguestfs-common-1.50.2.tar.gz | f801826d11e360a906bae5980495ac5425d709ae SOURCES/libguestfs-common-1.50.2.tar.gz | ||||||
|  | |||||||
| @ -1,63 +0,0 @@ | |||||||
| From d2e6dce96a9f197b688758f90481407e75ae11d2 Mon Sep 17 00:00:00 2001 |  | ||||||
| From: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com> |  | ||||||
| Date: Wed, 26 Apr 2023 15:59:44 +0300 |  | ||||||
| Subject: [PATCH] daemon/selinux-relabel: don't exclude "/selinux" if it's |  | ||||||
|  non-existent |  | ||||||
| 
 |  | ||||||
| Since RHBZ#726528, filesystem.rpm doesn't include /selinux.  setfiles |  | ||||||
| then gives us the warning: "Can't stat exclude path "/sysroot/selinux", |  | ||||||
| No such file or directory - ignoring." |  | ||||||
| 
 |  | ||||||
| Though the warning is harmless, let's get rid of it by checking the |  | ||||||
| existence of /selinux directory. |  | ||||||
| 
 |  | ||||||
| Signed-off-by: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com> |  | ||||||
| Reviewed-by: Laszlo Ersek <lersek@redhat.com> |  | ||||||
| Reviewed-by: Richard W.M. Jones <rjones@redhat.com> |  | ||||||
| (cherry picked from commit 9ced5fac8c1f0f8ff7ed2b5671c1c7f5f0bfa875) |  | ||||||
| ---
 |  | ||||||
|  daemon/selinux-relabel.c | 16 +++++++++++++++- |  | ||||||
|  1 file changed, 15 insertions(+), 1 deletion(-) |  | ||||||
| 
 |  | ||||||
| diff --git a/daemon/selinux-relabel.c b/daemon/selinux-relabel.c
 |  | ||||||
| index 976cffe3..454486c1 100644
 |  | ||||||
| --- a/daemon/selinux-relabel.c
 |  | ||||||
| +++ b/daemon/selinux-relabel.c
 |  | ||||||
| @@ -21,6 +21,7 @@
 |  | ||||||
|  #include <stdio.h> |  | ||||||
|  #include <stdlib.h> |  | ||||||
|  #include <string.h> |  | ||||||
| +#include <sys/stat.h>
 |  | ||||||
|   |  | ||||||
|  #include "guestfs_protocol.h" |  | ||||||
|  #include "daemon.h" |  | ||||||
| @@ -37,6 +38,17 @@ optgroup_selinuxrelabel_available (void)
 |  | ||||||
|    return prog_exists ("setfiles"); |  | ||||||
|  } |  | ||||||
|   |  | ||||||
| +static int
 |  | ||||||
| +dir_exists (const char *dir)
 |  | ||||||
| +{
 |  | ||||||
| +  struct stat statbuf;
 |  | ||||||
| +
 |  | ||||||
| +  if (stat (dir, &statbuf) == 0 && S_ISDIR (statbuf.st_mode))
 |  | ||||||
| +    return 1;
 |  | ||||||
| +  else
 |  | ||||||
| +    return 0;
 |  | ||||||
| +}
 |  | ||||||
| +
 |  | ||||||
|  static int |  | ||||||
|  setfiles_has_option (int *flag, char opt_char) |  | ||||||
|  { |  | ||||||
| @@ -99,8 +111,10 @@ do_selinux_relabel (const char *specfile, const char *path,
 |  | ||||||
|     */ |  | ||||||
|    ADD_ARG (argv, i, "-e"); ADD_ARG (argv, i, s_dev); |  | ||||||
|    ADD_ARG (argv, i, "-e"); ADD_ARG (argv, i, s_proc); |  | ||||||
| -  ADD_ARG (argv, i, "-e"); ADD_ARG (argv, i, s_selinux);
 |  | ||||||
|    ADD_ARG (argv, i, "-e"); ADD_ARG (argv, i, s_sys); |  | ||||||
| +  if (dir_exists (s_selinux)) {
 |  | ||||||
| +    ADD_ARG (argv, i, "-e"); ADD_ARG (argv, i, s_selinux);
 |  | ||||||
| +  }
 |  | ||||||
|   |  | ||||||
|    /* You have to use the -m option (where available) otherwise |  | ||||||
|     * setfiles puts all the mountpoints on the excludes list for no |  | ||||||
| @ -0,0 +1,25 @@ | |||||||
|  | From 0edaea8f91bf08025651eeff32f53b9335003842 Mon Sep 17 00:00:00 2001 | ||||||
|  | From: "Richard W.M. Jones" <rjones@redhat.com> | ||||||
|  | Date: Tue, 8 Oct 2024 14:53:38 +0100 | ||||||
|  | Subject: [PATCH] website: Add links for 1.54 and 1.55 download locations | ||||||
|  | 
 | ||||||
|  | ---
 | ||||||
|  |  website/index.html.in | 3 ++- | ||||||
|  |  1 file changed, 2 insertions(+), 1 deletion(-) | ||||||
|  | 
 | ||||||
|  | diff --git a/website/index.html.in b/website/index.html.in
 | ||||||
|  | index a61fca92..2a0d3221 100644
 | ||||||
|  | --- a/website/index.html.in
 | ||||||
|  | +++ b/website/index.html.in
 | ||||||
|  | @@ -186,9 +186,10 @@ git clone <a href="https://github.com/libguestfs/libguestfs">https://github.com/
 | ||||||
|  |  LATEST-URL: http://libguestfs.org/download/1.53-development/libguestfs-@PACKAGE_VERSION@.tar.gz | ||||||
|  |  LATEST-VERSION: @PACKAGE_VERSION@ | ||||||
|  |    --> | ||||||
|  | -  <a href="download/1.53-development/">Latest development version: <strong>@PACKAGE_VERSION@</strong></a> (released <strong>@RELEASE_DATE@</strong>).<br/>
 | ||||||
|  | +  <a href="download/1.55-development/">Latest development version: <strong>@PACKAGE_VERSION@</strong></a> (released <strong>@RELEASE_DATE@</strong>).<br/>
 | ||||||
|  |    Stable branch: | ||||||
|  |    <strong> | ||||||
|  | +  <a href="download/1.54-stable/">1.54.x</a>,
 | ||||||
|  |    <a href="download/1.52-stable/">1.52.x</a>, | ||||||
|  |    <a href="download/1.50-stable/">1.50.x</a>, | ||||||
|  |    <a href="download/1.48-stable/">1.48.x</a> | ||||||
| @ -1,33 +0,0 @@ | |||||||
| From 917455b15894c6c82bd657e918ceb09cd825c9c4 Mon Sep 17 00:00:00 2001 |  | ||||||
| From: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com> |  | ||||||
| Date: Wed, 26 Apr 2023 15:59:45 +0300 |  | ||||||
| Subject: [PATCH] daemon/selinux-relabel: search for "invalid option" in |  | ||||||
|  setfiles output |  | ||||||
| 
 |  | ||||||
| 'X' in the setiles' stderr doesn't necessarily mean that option 'X' |  | ||||||
| doesn't exist.  For instance, when passing '-T' we get: "setfiles: |  | ||||||
| option requires an argument -- 'T'". |  | ||||||
| 
 |  | ||||||
| Signed-off-by: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com> |  | ||||||
| Reviewed-by: Laszlo Ersek <lersek@redhat.com> |  | ||||||
| Reviewed-by: Richard W.M. Jones <rjones@redhat.com> |  | ||||||
| (cherry picked from commit 152d6e4bdf2dac88856a4ff83cf73451f897d4d4) |  | ||||||
| ---
 |  | ||||||
|  daemon/selinux-relabel.c | 3 ++- |  | ||||||
|  1 file changed, 2 insertions(+), 1 deletion(-) |  | ||||||
| 
 |  | ||||||
| diff --git a/daemon/selinux-relabel.c b/daemon/selinux-relabel.c
 |  | ||||||
| index 454486c1..60a6f48a 100644
 |  | ||||||
| --- a/daemon/selinux-relabel.c
 |  | ||||||
| +++ b/daemon/selinux-relabel.c
 |  | ||||||
| @@ -56,8 +56,9 @@ setfiles_has_option (int *flag, char opt_char)
 |  | ||||||
|   |  | ||||||
|    if (*flag == -1) { |  | ||||||
|      char option[] = { '-', opt_char, '\0' };       /* "-X" */ |  | ||||||
| -    char err_opt[] = { '\'', opt_char, '\'', '\0'}; /* "'X'" */
 |  | ||||||
| +    char err_opt[32];     /* "invalid option -- 'X'" */
 |  | ||||||
|   |  | ||||||
| +    snprintf(err_opt, sizeof(err_opt), "invalid option -- '%c'", opt_char);
 |  | ||||||
|      ignore_value (command (NULL, &err, "setfiles", option, NULL)); |  | ||||||
|      *flag = err && strstr (err, /* "invalid option -- " */ err_opt) == NULL; |  | ||||||
|    } |  | ||||||
| @ -0,0 +1,28 @@ | |||||||
|  | From c25ff1a8022cf345d3ce29682207ed3732a4244a Mon Sep 17 00:00:00 2001 | ||||||
|  | From: "Richard W.M. Jones" <rjones@redhat.com> | ||||||
|  | Date: Mon, 14 Oct 2024 10:43:08 +0100 | ||||||
|  | Subject: [PATCH] tests/gdisk/test-expand-gpt.pl: Implement SKIP rule for this | ||||||
|  |  test | ||||||
|  | 
 | ||||||
|  | Reported-by: David Runge | ||||||
|  | Related: https://github.com/libguestfs/libguestfs/issues/155 | ||||||
|  | ---
 | ||||||
|  |  tests/gdisk/test-expand-gpt.pl | 5 +++++ | ||||||
|  |  1 file changed, 5 insertions(+) | ||||||
|  | 
 | ||||||
|  | diff --git a/tests/gdisk/test-expand-gpt.pl b/tests/gdisk/test-expand-gpt.pl
 | ||||||
|  | index 23a52b23..5c77247c 100755
 | ||||||
|  | --- a/tests/gdisk/test-expand-gpt.pl
 | ||||||
|  | +++ b/tests/gdisk/test-expand-gpt.pl
 | ||||||
|  | @@ -20,6 +20,11 @@ use warnings;
 | ||||||
|  |   | ||||||
|  |  use Sys::Guestfs; | ||||||
|  |   | ||||||
|  | +if ($ENV{SKIP_TEST_EXPAND_GPT_PL}) {
 | ||||||
|  | +    print "$0: test skipped because SKIP_TEST_EXPAND_GPT_PL is set\n";
 | ||||||
|  | +    exit 77;
 | ||||||
|  | +}
 | ||||||
|  | +
 | ||||||
|  |  sub tests { | ||||||
|  |  	my $g = Sys::Guestfs->new (); | ||||||
|  |   | ||||||
| @ -1,78 +0,0 @@ | |||||||
| From d2f8308813da27f422607e5aa21fc95d113a17f0 Mon Sep 17 00:00:00 2001 |  | ||||||
| From: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com> |  | ||||||
| Date: Wed, 26 Apr 2023 15:59:46 +0300 |  | ||||||
| Subject: [PATCH] daemon/selinux-relabel: run setfiles with "-T 0", if |  | ||||||
|  supported |  | ||||||
| 
 |  | ||||||
| Since SELinux userspace v3.4 [1], setfiles command supports "-T nthreads" |  | ||||||
| option, which allows parallel execution.  "-T 0" allows using as many |  | ||||||
| threads as there're available CPU cores.  This might speed up the process |  | ||||||
| of filesystem relabeling in case the appliance is being run with multiple |  | ||||||
| vCPUs.  The latter is true for at least v2v starting from d2b64ecc67 |  | ||||||
| ("v2v: Set the number of vCPUs to same as host number of pCPUs."). |  | ||||||
| 
 |  | ||||||
| For instance, when running virt-v2v-in-place on my 12-core Xeon host |  | ||||||
| with SSD, with appliance being run with 8 vCPUs (the upper limit specified |  | ||||||
| in d2b64ecc67), and on the ~150GiB disk VM (physical size on the host), |  | ||||||
| I get the following results: |  | ||||||
| 
 |  | ||||||
| ./in-place/virt-v2v-in-place -i libvirt fedora37-vm -v -x |  | ||||||
| 
 |  | ||||||
| Without this patch: |  | ||||||
| ... |  | ||||||
| commandrvf: setfiles -F -e /sysroot/dev -e /sysroot/proc -e /sysroot/sys -m -C -r /sysroot -v /sysroot/etc/selinux/targeted/contexts/files/file_contexts /sysroot/^M |  | ||||||
| libguestfs: trace: v2v: selinux_relabel = 0 |  | ||||||
| libguestfs: trace: v2v: rm_f "/.autorelabel" |  | ||||||
| guestfsd: => selinux_relabel (0x1d3) took 17.94 secs |  | ||||||
| ... |  | ||||||
| 
 |  | ||||||
| With this patch: |  | ||||||
| ... |  | ||||||
| commandrvf: setfiles -F -e /sysroot/dev -e /sysroot/proc -e /sysroot/sys -m -C -T 0 -r /sysroot -v /sysroot/etc/selinux/targeted/contexts/files/file_contexts /sysroot/^M |  | ||||||
| libguestfs: trace: v2v: selinux_relabel = 0 |  | ||||||
| libguestfs: trace: v2v: rm_f "/.autorelabel" |  | ||||||
| guestfsd: => selinux_relabel (0x1d3) took 5.88 secs |  | ||||||
| ... |  | ||||||
| 
 |  | ||||||
| So in my scenario it's getting 3 times faster. |  | ||||||
| 
 |  | ||||||
| [1] https://github.com/SELinuxProject/selinux/releases/tag/3.4 |  | ||||||
| 
 |  | ||||||
| Signed-off-by: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com> |  | ||||||
| Reviewed-by: Laszlo Ersek <lersek@redhat.com> |  | ||||||
| Reviewed-by: Richard W.M. Jones <rjones@redhat.com> |  | ||||||
| (cherry picked from commit d0d8e6738477148a7b752348f9364a3b8faed67f) |  | ||||||
| ---
 |  | ||||||
|  daemon/selinux-relabel.c | 12 ++++++++++++ |  | ||||||
|  1 file changed, 12 insertions(+) |  | ||||||
| 
 |  | ||||||
| diff --git a/daemon/selinux-relabel.c b/daemon/selinux-relabel.c
 |  | ||||||
| index 60a6f48a..cfc5a31d 100644
 |  | ||||||
| --- a/daemon/selinux-relabel.c
 |  | ||||||
| +++ b/daemon/selinux-relabel.c
 |  | ||||||
| @@ -73,6 +73,7 @@ do_selinux_relabel (const char *specfile, const char *path,
 |  | ||||||
|  { |  | ||||||
|    static int flag_m = -1; |  | ||||||
|    static int flag_C = -1; |  | ||||||
| +  static int flag_T = -1;
 |  | ||||||
|    const char *argv[MAX_ARGS]; |  | ||||||
|    CLEANUP_FREE char *s_dev = NULL, *s_proc = NULL, *s_selinux = NULL, |  | ||||||
|      *s_sys = NULL, *s_specfile = NULL, *s_path = NULL; |  | ||||||
| @@ -131,6 +132,17 @@ do_selinux_relabel (const char *specfile, const char *path,
 |  | ||||||
|    if (setfiles_has_option (&flag_C, 'C')) |  | ||||||
|      ADD_ARG (argv, i, "-C"); |  | ||||||
|   |  | ||||||
| +  /* If the appliance is being run with multiple vCPUs, running setfiles
 |  | ||||||
| +   * in multithreading mode might speeds up the process.  Option "-T" was
 |  | ||||||
| +   * introduced in SELinux userspace v3.4, and we need to check whether it's
 |  | ||||||
| +   * supported.  Passing "-T 0" creates as many threads as there're available
 |  | ||||||
| +   * vCPU cores.
 |  | ||||||
| +   * https://github.com/SELinuxProject/selinux/releases/tag/3.4
 |  | ||||||
| +   */
 |  | ||||||
| +  if (setfiles_has_option (&flag_T, 'T')) {
 |  | ||||||
| +    ADD_ARG (argv, i, "-T"); ADD_ARG (argv, i, "0");
 |  | ||||||
| +  }
 |  | ||||||
| +
 |  | ||||||
|    /* Relabelling in a chroot. */ |  | ||||||
|    if (STRNEQ (sysroot, "/")) { |  | ||||||
|      ADD_ARG (argv, i, "-r"); |  | ||||||
| @ -0,0 +1,41 @@ | |||||||
|  | From 0f489f8eec0c02e9ed1d606a2032edccf81ef025 Mon Sep 17 00:00:00 2001 | ||||||
|  | From: "Richard W.M. Jones" <rjones@redhat.com> | ||||||
|  | Date: Thu, 17 Oct 2024 08:59:49 +0100 | ||||||
|  | Subject: [PATCH] lib/inspect-osinfo.c: Add Windows Server 2025 osinfo | ||||||
|  | 
 | ||||||
|  | The guest was found to have these inspection fields: | ||||||
|  | 
 | ||||||
|  |     type: windows | ||||||
|  |     distro: windows | ||||||
|  |     product_name: Windows Server 2025 Standard | ||||||
|  |     product_variant: Server | ||||||
|  |     version: 10.0 | ||||||
|  |     arch: x86_64 | ||||||
|  |     hostname: WIN-84V4KKQ30SM | ||||||
|  |     build ID: 26080 | ||||||
|  |     windows_systemroot: /Windows | ||||||
|  |     windows_software_hive: /Windows/System32/config/SOFTWARE | ||||||
|  |     windows_system_hive: /Windows/System32/config/SYSTEM | ||||||
|  |     windows_current_control_set: ControlSet001 | ||||||
|  | 
 | ||||||
|  | Reported-by: Ming Xie | ||||||
|  | Fixes: https://issues.redhat.com/browse/RHEL-62935 | ||||||
|  | ---
 | ||||||
|  |  lib/inspect-osinfo.c | 4 +++- | ||||||
|  |  1 file changed, 3 insertions(+), 1 deletion(-) | ||||||
|  | 
 | ||||||
|  | diff --git a/lib/inspect-osinfo.c b/lib/inspect-osinfo.c
 | ||||||
|  | index c77344f6..f792d771 100644
 | ||||||
|  | --- a/lib/inspect-osinfo.c
 | ||||||
|  | +++ b/lib/inspect-osinfo.c
 | ||||||
|  | @@ -142,7 +142,9 @@ guestfs_impl_inspect_get_osinfo (guestfs_h *g, const char *root)
 | ||||||
|  |        switch (minor) { | ||||||
|  |        case 0: | ||||||
|  |          if (strstr (product_variant, "Server")) { | ||||||
|  | -          if (strstr (product_name, "2022"))
 | ||||||
|  | +          if (strstr (product_name, "2025"))
 | ||||||
|  | +            return safe_strdup (g, "win2k25");
 | ||||||
|  | +          else if (strstr (product_name, "2022"))
 | ||||||
|  |              return safe_strdup (g, "win2k22"); | ||||||
|  |            else if (strstr (product_name, "2019")) | ||||||
|  |              return safe_strdup (g, "win2k19"); | ||||||
| @ -0,0 +1,409 @@ | |||||||
|  | From e37768d8892d6f467c7834f8b142b89f8f0af7dc Mon Sep 17 00:00:00 2001 | ||||||
|  | From: "Richard W.M. Jones" <rjones@redhat.com> | ||||||
|  | Date: Fri, 18 Oct 2024 21:52:21 +0100 | ||||||
|  | Subject: [PATCH] build: Assume __attribute__((cleanup)) always works | ||||||
|  | 
 | ||||||
|  | All recent compilers support this (except MS compilers which we don't | ||||||
|  | care about).  Assume it is supported.  We test it in ./configure and | ||||||
|  | hard fail if it doesn't work. | ||||||
|  | 
 | ||||||
|  | We still define HAVE_ATTRIBUTE_CLEANUP but you can now assume it is | ||||||
|  | always defined and don't have to check it. | ||||||
|  | ---
 | ||||||
|  |  common                 |  2 +- | ||||||
|  |  daemon/daemon.h        |  9 --------- | ||||||
|  |  daemon/sh.c            |  5 ----- | ||||||
|  |  daemon/yara.c          |  8 -------- | ||||||
|  |  generator/c.ml         | 10 ---------- | ||||||
|  |  generator/daemon.ml    | 15 --------------- | ||||||
|  |  lib/guestfs-internal.h |  8 -------- | ||||||
|  |  lib/info.c             |  5 ----- | ||||||
|  |  lib/launch-libvirt.c   |  5 ----- | ||||||
|  |  lib/qemu.c             |  5 ----- | ||||||
|  |  m4/guestfs-c.m4        |  7 ++----- | ||||||
|  |  11 files changed, 3 insertions(+), 76 deletions(-) | ||||||
|  | 
 | ||||||
|  | Submodule common b6e703dc..01c53226: | ||||||
|  | diff --git a/common/structs/structs-cleanups.h b/common/structs/structs-cleanups.h
 | ||||||
|  | index b43dbd75..c6e7fd1e 100644
 | ||||||
|  | --- a/common/structs/structs-cleanups.h
 | ||||||
|  | +++ b/common/structs/structs-cleanups.h
 | ||||||
|  | @@ -28,7 +28,6 @@
 | ||||||
|  |  #ifndef GUESTFS_STRUCTS_CLEANUPS_H_ | ||||||
|  |  #define GUESTFS_STRUCTS_CLEANUPS_H_ | ||||||
|  |   | ||||||
|  | -#ifdef HAVE_ATTRIBUTE_CLEANUP
 | ||||||
|  |  #define CLEANUP_FREE_INT_BOOL \ | ||||||
|  |    __attribute__((cleanup(guestfs_int_cleanup_free_int_bool))) | ||||||
|  |  #define CLEANUP_FREE_INT_BOOL_LIST \ | ||||||
|  | @@ -137,62 +136,6 @@
 | ||||||
|  |    __attribute__((cleanup(guestfs_int_cleanup_free_yara_detection))) | ||||||
|  |  #define CLEANUP_FREE_YARA_DETECTION_LIST \ | ||||||
|  |    __attribute__((cleanup(guestfs_int_cleanup_free_yara_detection_list))) | ||||||
|  | -#else /* !HAVE_ATTRIBUTE_CLEANUP */
 | ||||||
|  | -#define CLEANUP_FREE_INT_BOOL
 | ||||||
|  | -#define CLEANUP_FREE_INT_BOOL_LIST
 | ||||||
|  | -#define CLEANUP_FREE_LVM_PV
 | ||||||
|  | -#define CLEANUP_FREE_LVM_PV_LIST
 | ||||||
|  | -#define CLEANUP_FREE_LVM_VG
 | ||||||
|  | -#define CLEANUP_FREE_LVM_VG_LIST
 | ||||||
|  | -#define CLEANUP_FREE_LVM_LV
 | ||||||
|  | -#define CLEANUP_FREE_LVM_LV_LIST
 | ||||||
|  | -#define CLEANUP_FREE_STAT
 | ||||||
|  | -#define CLEANUP_FREE_STAT_LIST
 | ||||||
|  | -#define CLEANUP_FREE_STATNS
 | ||||||
|  | -#define CLEANUP_FREE_STATNS_LIST
 | ||||||
|  | -#define CLEANUP_FREE_STATVFS
 | ||||||
|  | -#define CLEANUP_FREE_STATVFS_LIST
 | ||||||
|  | -#define CLEANUP_FREE_DIRENT
 | ||||||
|  | -#define CLEANUP_FREE_DIRENT_LIST
 | ||||||
|  | -#define CLEANUP_FREE_VERSION
 | ||||||
|  | -#define CLEANUP_FREE_VERSION_LIST
 | ||||||
|  | -#define CLEANUP_FREE_XATTR
 | ||||||
|  | -#define CLEANUP_FREE_XATTR_LIST
 | ||||||
|  | -#define CLEANUP_FREE_INOTIFY_EVENT
 | ||||||
|  | -#define CLEANUP_FREE_INOTIFY_EVENT_LIST
 | ||||||
|  | -#define CLEANUP_FREE_PARTITION
 | ||||||
|  | -#define CLEANUP_FREE_PARTITION_LIST
 | ||||||
|  | -#define CLEANUP_FREE_APPLICATION
 | ||||||
|  | -#define CLEANUP_FREE_APPLICATION_LIST
 | ||||||
|  | -#define CLEANUP_FREE_APPLICATION2
 | ||||||
|  | -#define CLEANUP_FREE_APPLICATION2_LIST
 | ||||||
|  | -#define CLEANUP_FREE_ISOINFO
 | ||||||
|  | -#define CLEANUP_FREE_ISOINFO_LIST
 | ||||||
|  | -#define CLEANUP_FREE_MDSTAT
 | ||||||
|  | -#define CLEANUP_FREE_MDSTAT_LIST
 | ||||||
|  | -#define CLEANUP_FREE_BTRFSSUBVOLUME
 | ||||||
|  | -#define CLEANUP_FREE_BTRFSSUBVOLUME_LIST
 | ||||||
|  | -#define CLEANUP_FREE_BTRFSQGROUP
 | ||||||
|  | -#define CLEANUP_FREE_BTRFSQGROUP_LIST
 | ||||||
|  | -#define CLEANUP_FREE_BTRFSBALANCE
 | ||||||
|  | -#define CLEANUP_FREE_BTRFSBALANCE_LIST
 | ||||||
|  | -#define CLEANUP_FREE_BTRFSSCRUB
 | ||||||
|  | -#define CLEANUP_FREE_BTRFSSCRUB_LIST
 | ||||||
|  | -#define CLEANUP_FREE_XFSINFO
 | ||||||
|  | -#define CLEANUP_FREE_XFSINFO_LIST
 | ||||||
|  | -#define CLEANUP_FREE_UTSNAME
 | ||||||
|  | -#define CLEANUP_FREE_UTSNAME_LIST
 | ||||||
|  | -#define CLEANUP_FREE_HIVEX_NODE
 | ||||||
|  | -#define CLEANUP_FREE_HIVEX_NODE_LIST
 | ||||||
|  | -#define CLEANUP_FREE_HIVEX_VALUE
 | ||||||
|  | -#define CLEANUP_FREE_HIVEX_VALUE_LIST
 | ||||||
|  | -#define CLEANUP_FREE_INTERNAL_MOUNTABLE
 | ||||||
|  | -#define CLEANUP_FREE_INTERNAL_MOUNTABLE_LIST
 | ||||||
|  | -#define CLEANUP_FREE_TSK_DIRENT
 | ||||||
|  | -#define CLEANUP_FREE_TSK_DIRENT_LIST
 | ||||||
|  | -#define CLEANUP_FREE_YARA_DETECTION
 | ||||||
|  | -#define CLEANUP_FREE_YARA_DETECTION_LIST
 | ||||||
|  | -#endif /* !HAVE_ATTRIBUTE_CLEANUP */
 | ||||||
|  |   | ||||||
|  |  /* These functions are used internally by the CLEANUP_* macros. | ||||||
|  |   * Don't call them directly. | ||||||
|  | diff --git a/common/utils/cleanups.h b/common/utils/cleanups.h
 | ||||||
|  | index 932114f6..be52d072 100644
 | ||||||
|  | --- a/common/utils/cleanups.h
 | ||||||
|  | +++ b/common/utils/cleanups.h
 | ||||||
|  | @@ -19,7 +19,6 @@
 | ||||||
|  |  #ifndef GUESTFS_CLEANUPS_H_ | ||||||
|  |  #define GUESTFS_CLEANUPS_H_ | ||||||
|  |   | ||||||
|  | -#ifdef HAVE_ATTRIBUTE_CLEANUP
 | ||||||
|  |  #define CLEANUP_FREE                                    \ | ||||||
|  |    __attribute__((cleanup(guestfs_int_cleanup_free))) | ||||||
|  |  #define CLEANUP_HASH_FREE                                       \ | ||||||
|  | @@ -50,23 +49,6 @@
 | ||||||
|  |    __attribute__((cleanup(guestfs_int_cleanup_xmlXPathFreeObject))) | ||||||
|  |  #define CLEANUP_PCRE2_MATCH_DATA_FREE                                   \ | ||||||
|  |    __attribute__((cleanup(guestfs_int_cleanup_pcre2_match_data_free))) | ||||||
|  | -#else
 | ||||||
|  | -#define CLEANUP_FREE
 | ||||||
|  | -#define CLEANUP_HASH_FREE
 | ||||||
|  | -#define CLEANUP_UNLINK_FREE
 | ||||||
|  | -#define CLEANUP_CLOSE
 | ||||||
|  | -#define CLEANUP_FCLOSE
 | ||||||
|  | -#define CLEANUP_PCLOSE
 | ||||||
|  | -#define CLEANUP_FREE_STRING_LIST
 | ||||||
|  | -#define CLEANUP_XMLFREE
 | ||||||
|  | -#define CLEANUP_XMLBUFFERFREE
 | ||||||
|  | -#define CLEANUP_XMLFREEDOC
 | ||||||
|  | -#define CLEANUP_XMLFREEURI
 | ||||||
|  | -#define CLEANUP_XMLFREETEXTWRITER
 | ||||||
|  | -#define CLEANUP_XMLXPATHFREECONTEXT
 | ||||||
|  | -#define CLEANUP_XMLXPATHFREEOBJECT
 | ||||||
|  | -#define CLEANUP_PCRE2_MATCH_DATA_FREE
 | ||||||
|  | -#endif
 | ||||||
|  |   | ||||||
|  |  /* These functions are used internally by the CLEANUP_* macros. | ||||||
|  |   * Don't call them directly. | ||||||
|  | diff --git a/daemon/daemon.h b/daemon/daemon.h
 | ||||||
|  | index e050588c..5fc53245 100644
 | ||||||
|  | --- a/daemon/daemon.h
 | ||||||
|  | +++ b/daemon/daemon.h
 | ||||||
|  | @@ -93,11 +93,7 @@ extern char *read_whole_file (const char *filename, size_t *size_r);
 | ||||||
|  |  extern char *mountable_to_string (const mountable_t *mountable); | ||||||
|  |  extern void cleanup_free_mountable (mountable_t *mountable); | ||||||
|  |   | ||||||
|  | -#ifdef HAVE_ATTRIBUTE_CLEANUP
 | ||||||
|  |  #define CLEANUP_FREE_MOUNTABLE __attribute__((cleanup(cleanup_free_mountable))) | ||||||
|  | -#else
 | ||||||
|  | -#define CLEANUP_FREE_MOUNTABLE
 | ||||||
|  | -#endif
 | ||||||
|  |   | ||||||
|  |  /* cleanups.c */ | ||||||
|  |  /* These functions are used internally by the CLEANUP_* macros. | ||||||
|  | @@ -106,13 +102,8 @@ extern void cleanup_free_mountable (mountable_t *mountable);
 | ||||||
|  |  extern void cleanup_aug_close (void *ptr); | ||||||
|  |  extern void cleanup_free_stringsbuf (void *ptr); | ||||||
|  |   | ||||||
|  | -#ifdef HAVE_ATTRIBUTE_CLEANUP
 | ||||||
|  |  #define CLEANUP_AUG_CLOSE __attribute__((cleanup(cleanup_aug_close))) | ||||||
|  |  #define CLEANUP_FREE_STRINGSBUF __attribute__((cleanup(cleanup_free_stringsbuf))) | ||||||
|  | -#else
 | ||||||
|  | -#define CLEANUP_AUG_CLOSE
 | ||||||
|  | -#define CLEANUP_FREE_STRINGSBUF
 | ||||||
|  | -#endif
 | ||||||
|  |   | ||||||
|  |  /* mount.c */ | ||||||
|  |  extern int is_root_mounted (void); | ||||||
|  | diff --git a/daemon/sh.c b/daemon/sh.c
 | ||||||
|  | index 92ce08be..21d4deea 100644
 | ||||||
|  | --- a/daemon/sh.c
 | ||||||
|  | +++ b/daemon/sh.c
 | ||||||
|  | @@ -32,13 +32,8 @@
 | ||||||
|  |   | ||||||
|  |  #include "ignore-value.h" | ||||||
|  |   | ||||||
|  | -#ifdef HAVE_ATTRIBUTE_CLEANUP
 | ||||||
|  |  #define CLEANUP_BIND_STATE __attribute__((cleanup(free_bind_state))) | ||||||
|  |  #define CLEANUP_RESOLVER_STATE __attribute__((cleanup(free_resolver_state))) | ||||||
|  | -#else
 | ||||||
|  | -#define CLEANUP_BIND_STATE
 | ||||||
|  | -#define CLEANUP_RESOLVER_STATE
 | ||||||
|  | -#endif
 | ||||||
|  |   | ||||||
|  |  struct bind_state { | ||||||
|  |    bool mounted; | ||||||
|  | diff --git a/daemon/yara.c b/daemon/yara.c
 | ||||||
|  | index 21137b73..9350dd27 100644
 | ||||||
|  | --- a/daemon/yara.c
 | ||||||
|  | +++ b/daemon/yara.c
 | ||||||
|  | @@ -39,12 +39,8 @@
 | ||||||
|  |   | ||||||
|  |  #include <yara.h> | ||||||
|  |   | ||||||
|  | -#ifdef HAVE_ATTRIBUTE_CLEANUP
 | ||||||
|  |  #define CLEANUP_DESTROY_YARA_COMPILER                           \ | ||||||
|  |    __attribute__((cleanup(cleanup_destroy_yara_compiler))) | ||||||
|  | -#else
 | ||||||
|  | -#define CLEANUP_DESTROY_YARA_COMPILER
 | ||||||
|  | -#endif
 | ||||||
|  |   | ||||||
|  |  struct write_callback_data { | ||||||
|  |    int fd; | ||||||
|  | @@ -208,10 +204,6 @@ compile_rules_file (const char *rules_path)
 | ||||||
|  |    } | ||||||
|  |   | ||||||
|  |   err: | ||||||
|  | -#ifndef HAVE_ATTRIBUTE_CLEANUP
 | ||||||
|  | -  yr_compiler_destroy (compiler);
 | ||||||
|  | -#endif
 | ||||||
|  | -
 | ||||||
|  |    return ret; | ||||||
|  |  } | ||||||
|  |   | ||||||
|  | diff --git a/generator/c.ml b/generator/c.ml
 | ||||||
|  | index 447059b8..838e7f42 100644
 | ||||||
|  | --- a/generator/c.ml
 | ||||||
|  | +++ b/generator/c.ml
 | ||||||
|  | @@ -817,7 +817,6 @@ and generate_client_structs_cleanups_h () =
 | ||||||
|  |  #ifndef GUESTFS_STRUCTS_CLEANUPS_H_ | ||||||
|  |  #define GUESTFS_STRUCTS_CLEANUPS_H_ | ||||||
|  |   | ||||||
|  | -#ifdef HAVE_ATTRIBUTE_CLEANUP
 | ||||||
|  |  "; | ||||||
|  |   | ||||||
|  |    List.iter ( | ||||||
|  | @@ -828,16 +827,7 @@ and generate_client_structs_cleanups_h () =
 | ||||||
|  |        pr "  __attribute__((cleanup(guestfs_int_cleanup_free_%s_list)))\n" name | ||||||
|  |    ) structs; | ||||||
|  |   | ||||||
|  | -  pr "#else /* !HAVE_ATTRIBUTE_CLEANUP */\n";
 | ||||||
|  | -
 | ||||||
|  | -  List.iter (
 | ||||||
|  | -    fun { s_name = name } ->
 | ||||||
|  | -      pr "#define CLEANUP_FREE_%s\n" (String.uppercase_ascii name);
 | ||||||
|  | -      pr "#define CLEANUP_FREE_%s_LIST\n" (String.uppercase_ascii name)
 | ||||||
|  | -  ) structs;
 | ||||||
|  | -
 | ||||||
|  |    pr "\ | ||||||
|  | -#endif /* !HAVE_ATTRIBUTE_CLEANUP */
 | ||||||
|  |   | ||||||
|  |  /* These functions are used internally by the CLEANUP_* macros. | ||||||
|  |   * Don't call them directly. | ||||||
|  | diff --git a/generator/daemon.ml b/generator/daemon.ml
 | ||||||
|  | index 78a2412d..9ab9e12d 100644
 | ||||||
|  | --- a/generator/daemon.ml
 | ||||||
|  | +++ b/generator/daemon.ml
 | ||||||
|  | @@ -127,8 +127,6 @@ let generate_daemon_stubs actions () =
 | ||||||
|  |                      args_passed_to_daemon in | ||||||
|  |   | ||||||
|  |        if args_passed_to_daemon <> [] then ( | ||||||
|  | -        pr "#ifdef HAVE_ATTRIBUTE_CLEANUP\n";
 | ||||||
|  | -        pr "\n";
 | ||||||
|  |          pr "#define CLEANUP_XDR_FREE_%s_ARGS \\\n" uc_name; | ||||||
|  |          pr "    __attribute__((cleanup(cleanup_xdr_free_%s_args)))\n" name; | ||||||
|  |          pr "\n"; | ||||||
|  | @@ -140,9 +138,6 @@ let generate_daemon_stubs actions () =
 | ||||||
|  |             name; | ||||||
|  |          pr "}\n"; | ||||||
|  |          pr "\n"; | ||||||
|  | -        pr "#else /* !HAVE_ATTRIBUTE_CLEANUP */\n";
 | ||||||
|  | -        pr "#define CLEANUP_XDR_FREE_%s_ARGS\n" uc_name;
 | ||||||
|  | -        pr "#endif /* !HAVE_ATTRIBUTE_CLEANUP */\n";
 | ||||||
|  |          pr "\n" | ||||||
|  |        ); | ||||||
|  |   | ||||||
|  | @@ -1315,7 +1310,6 @@ let generate_daemon_structs_cleanups_h () =
 | ||||||
|  |  #ifndef GUESTFS_DAEMON_STRUCTS_CLEANUPS_H_ | ||||||
|  |  #define GUESTFS_DAEMON_STRUCTS_CLEANUPS_H_ | ||||||
|  |   | ||||||
|  | -#ifdef HAVE_ATTRIBUTE_CLEANUP
 | ||||||
|  |  "; | ||||||
|  |   | ||||||
|  |    List.iter ( | ||||||
|  | @@ -1326,16 +1320,7 @@ let generate_daemon_structs_cleanups_h () =
 | ||||||
|  |        pr "  __attribute__((cleanup(cleanup_free_int_%s_list)))\n" name | ||||||
|  |    ) structs; | ||||||
|  |   | ||||||
|  | -  pr "#else /* !HAVE_ATTRIBUTE_CLEANUP */\n";
 | ||||||
|  | -
 | ||||||
|  | -  List.iter (
 | ||||||
|  | -    fun { s_name = name } ->
 | ||||||
|  | -      pr "#define CLEANUP_FREE_%s\n" (String.uppercase_ascii name);
 | ||||||
|  | -      pr "#define CLEANUP_FREE_%s_LIST\n" (String.uppercase_ascii name)
 | ||||||
|  | -  ) structs;
 | ||||||
|  | -
 | ||||||
|  |    pr "\ | ||||||
|  | -#endif /* !HAVE_ATTRIBUTE_CLEANUP */
 | ||||||
|  |   | ||||||
|  |  /* These functions are used internally by the CLEANUP_* macros. | ||||||
|  |   * Don't call them directly. | ||||||
|  | diff --git a/lib/guestfs-internal.h b/lib/guestfs-internal.h
 | ||||||
|  | index 174ca135..f9f4628a 100644
 | ||||||
|  | --- a/lib/guestfs-internal.h
 | ||||||
|  | +++ b/lib/guestfs-internal.h
 | ||||||
|  | @@ -661,11 +661,7 @@ extern void guestfs_int_end_stringsbuf (guestfs_h *g, struct stringsbuf *sb);
 | ||||||
|  |   | ||||||
|  |  extern void guestfs_int_free_stringsbuf (struct stringsbuf *sb); | ||||||
|  |   | ||||||
|  | -#ifdef HAVE_ATTRIBUTE_CLEANUP
 | ||||||
|  |  #define CLEANUP_FREE_STRINGSBUF __attribute__((cleanup(guestfs_int_cleanup_free_stringsbuf))) | ||||||
|  | -#else
 | ||||||
|  | -#define CLEANUP_FREE_STRINGSBUF
 | ||||||
|  | -#endif
 | ||||||
|  |  extern void guestfs_int_cleanup_free_stringsbuf (struct stringsbuf *sb); | ||||||
|  |   | ||||||
|  |  /* proto.c */ | ||||||
|  | @@ -785,11 +781,7 @@ extern int guestfs_int_cmd_pipe_run (struct command *cmd, const char *mode);
 | ||||||
|  |  extern int guestfs_int_cmd_pipe_wait (struct command *cmd); | ||||||
|  |  extern char *guestfs_int_cmd_get_pipe_errors (struct command *cmd); | ||||||
|  |   | ||||||
|  | -#ifdef HAVE_ATTRIBUTE_CLEANUP
 | ||||||
|  |  #define CLEANUP_CMD_CLOSE __attribute__((cleanup(guestfs_int_cleanup_cmd_close))) | ||||||
|  | -#else
 | ||||||
|  | -#define CLEANUP_CMD_CLOSE
 | ||||||
|  | -#endif
 | ||||||
|  |  extern void guestfs_int_cleanup_cmd_close (struct command **); | ||||||
|  |   | ||||||
|  |  /* launch-*.c constructors */ | ||||||
|  | diff --git a/lib/info.c b/lib/info.c
 | ||||||
|  | index 4dee7a26..b60fc8b3 100644
 | ||||||
|  | --- a/lib/info.c
 | ||||||
|  | +++ b/lib/info.c
 | ||||||
|  | @@ -43,7 +43,6 @@
 | ||||||
|  |  #include "guestfs-internal.h" | ||||||
|  |  #include "guestfs-internal-actions.h" | ||||||
|  |   | ||||||
|  | -#ifdef HAVE_ATTRIBUTE_CLEANUP
 | ||||||
|  |  #define CLEANUP_JSON_T_DECREF __attribute__((cleanup(cleanup_json_t_decref))) | ||||||
|  |   | ||||||
|  |  static void | ||||||
|  | @@ -52,10 +51,6 @@ cleanup_json_t_decref (void *ptr)
 | ||||||
|  |    json_decref (* (json_t **) ptr); | ||||||
|  |  } | ||||||
|  |   | ||||||
|  | -#else
 | ||||||
|  | -#define CLEANUP_JSON_T_DECREF
 | ||||||
|  | -#endif
 | ||||||
|  | -
 | ||||||
|  |  static json_t *get_json_output (guestfs_h *g, const char *filename); | ||||||
|  |  static int qemu_img_supports_U_option (guestfs_h *g); | ||||||
|  |  static void set_child_rlimits (struct command *); | ||||||
|  | diff --git a/lib/launch-libvirt.c b/lib/launch-libvirt.c
 | ||||||
|  | index fed6dcc8..d01f6578 100644
 | ||||||
|  | --- a/lib/launch-libvirt.c
 | ||||||
|  | +++ b/lib/launch-libvirt.c
 | ||||||
|  | @@ -97,7 +97,6 @@ xmlBufferDetach (xmlBufferPtr buf)
 | ||||||
|  |  } | ||||||
|  |  #endif | ||||||
|  |   | ||||||
|  | -#ifdef HAVE_ATTRIBUTE_CLEANUP
 | ||||||
|  |  #define CLEANUP_VIRSECRETFREE __attribute__((cleanup(cleanup_virSecretFree))) | ||||||
|  |   | ||||||
|  |  static void | ||||||
|  | @@ -108,10 +107,6 @@ cleanup_virSecretFree (void *ptr)
 | ||||||
|  |      virSecretFree (secret_obj); | ||||||
|  |  } | ||||||
|  |   | ||||||
|  | -#else /* !HAVE_ATTRIBUTE_CLEANUP */
 | ||||||
|  | -#define CLEANUP_VIRSECRETFREE
 | ||||||
|  | -#endif
 | ||||||
|  | -
 | ||||||
|  |  /* List used to store a mapping of secret to libvirt secret UUID. */ | ||||||
|  |  struct secret { | ||||||
|  |    char *secret; | ||||||
|  | diff --git a/lib/qemu.c b/lib/qemu.c
 | ||||||
|  | index 027790e4..886c92e5 100644
 | ||||||
|  | --- a/lib/qemu.c
 | ||||||
|  | +++ b/lib/qemu.c
 | ||||||
|  | @@ -46,7 +46,6 @@
 | ||||||
|  |  #include "guestfs-internal.h" | ||||||
|  |  #include "guestfs_protocol.h" | ||||||
|  |   | ||||||
|  | -#ifdef HAVE_ATTRIBUTE_CLEANUP
 | ||||||
|  |  #define CLEANUP_JSON_T_DECREF __attribute__((cleanup(cleanup_json_t_decref))) | ||||||
|  |   | ||||||
|  |  static void | ||||||
|  | @@ -55,10 +54,6 @@ cleanup_json_t_decref (void *ptr)
 | ||||||
|  |    json_decref (* (json_t **) ptr); | ||||||
|  |  } | ||||||
|  |   | ||||||
|  | -#else
 | ||||||
|  | -#define CLEANUP_JSON_T_DECREF
 | ||||||
|  | -#endif
 | ||||||
|  | -
 | ||||||
|  |  struct qemu_data { | ||||||
|  |    int generation;               /* MEMO_GENERATION read from qemu.stat */ | ||||||
|  |    uint64_t prev_size;           /* Size of qemu binary when cached. */ | ||||||
|  | diff --git a/m4/guestfs-c.m4 b/m4/guestfs-c.m4
 | ||||||
|  | index 44c64b6d..49109cc8 100644
 | ||||||
|  | --- a/m4/guestfs-c.m4
 | ||||||
|  | +++ b/m4/guestfs-c.m4
 | ||||||
|  | @@ -109,15 +109,12 @@ main (int argc, char *argv[])
 | ||||||
|  |      AC_MSG_RESULT([yes]) | ||||||
|  |      AC_DEFINE([HAVE_ATTRIBUTE_CLEANUP],[1],[Define to 1 if '__attribute__((cleanup(...)))' works with this compiler.]) | ||||||
|  |      ],[ | ||||||
|  | -    AC_MSG_WARN(
 | ||||||
|  | +    AC_MSG_ERROR(
 | ||||||
|  |  ['__attribute__((cleanup(...)))' does not work. | ||||||
|  |   | ||||||
|  |  You may not be using a sufficiently recent version of GCC or CLANG, or | ||||||
|  |  you may be using a C compiler which does not support this attribute, | ||||||
|  | -or the configure test may be wrong.
 | ||||||
|  | -
 | ||||||
|  | -The code will still compile, but is likely to leak memory and other
 | ||||||
|  | -resources when it runs.])])
 | ||||||
|  | +or the configure test may be wrong.])])
 | ||||||
|  |  dnl restore CFLAGS | ||||||
|  |  CFLAGS="${acx_nbdkit_save_CFLAGS}" | ||||||
|  |   | ||||||
| @ -0,0 +1,53 @@ | |||||||
|  | From 53632b4b8245a6dd67c95015d52d1f4c562b14ed Mon Sep 17 00:00:00 2001 | ||||||
|  | From: "Richard W.M. Jones" <rjones@redhat.com> | ||||||
|  | Date: Mon, 21 Oct 2024 11:50:05 +0100 | ||||||
|  | Subject: [PATCH] appliance: Use stable owner, group and mtime in appliance | ||||||
|  |  tarballs | ||||||
|  | 
 | ||||||
|  | Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2320025 | ||||||
|  | Signed-off-by: Richard W.M. Jones <rjones@redhat.com> | ||||||
|  | ---
 | ||||||
|  |  appliance/Makefile.am | 11 ++++++++--- | ||||||
|  |  1 file changed, 8 insertions(+), 3 deletions(-) | ||||||
|  | 
 | ||||||
|  | diff --git a/appliance/Makefile.am b/appliance/Makefile.am
 | ||||||
|  | index 8cb9bd1f..7edc90e6 100644
 | ||||||
|  | --- a/appliance/Makefile.am
 | ||||||
|  | +++ b/appliance/Makefile.am
 | ||||||
|  | @@ -113,12 +113,17 @@ packagelist: packagelist.in Makefile guestfsd.deps
 | ||||||
|  |  	cmp -s $@ $@-t || mv $@-t $@ | ||||||
|  |  	rm -f $@-t | ||||||
|  |   | ||||||
|  | +# Use stable times and owner/group (RHBZ#2320025).
 | ||||||
|  | +TAR_COMMAND := tar -z \
 | ||||||
|  | +	--owner=0 --group=0 \
 | ||||||
|  | +	$${SOURCE_DATE_EPOCH:+--mtime=@"$$SOURCE_DATE_EPOCH"}
 | ||||||
|  | +
 | ||||||
|  |  supermin.d/daemon.tar.gz: ../daemon/guestfsd | ||||||
|  |  	rm -f $@ $@-t | ||||||
|  |  	rm -rf tmp-d | ||||||
|  |  	mkdir -p tmp-d$(DAEMON_SUPERMIN_DIR) tmp-d/etc | ||||||
|  |  	ln ../daemon/guestfsd tmp-d$(DAEMON_SUPERMIN_DIR)/guestfsd | ||||||
|  | -	( cd tmp-d && tar zcf - * ) > $@-t
 | ||||||
|  | +	( cd tmp-d && $(TAR_COMMAND) -cf - * ) > $@-t
 | ||||||
|  |  	rm -r tmp-d | ||||||
|  |  	mv $@-t $@ | ||||||
|  |   | ||||||
|  | @@ -139,7 +144,7 @@ supermin.d/hostfiles: hostfiles.in Makefile
 | ||||||
|  |   | ||||||
|  |  supermin.d/init.tar.gz: init | ||||||
|  |  	rm -f $@ $@-t | ||||||
|  | -	( cd $(srcdir) && tar zcf - init ) > $@-t
 | ||||||
|  | +	( cd $(srcdir) && $(TAR_COMMAND) -cf - init ) > $@-t
 | ||||||
|  |  	mv $@-t $@ | ||||||
|  |   | ||||||
|  |  # We should put this file in /lib/udev/rules.d, but put it in /etc so | ||||||
|  | @@ -149,7 +154,7 @@ supermin.d/udev-rules.tar.gz: 99-guestfs-serial.rules
 | ||||||
|  |  	rm -rf tmp-u | ||||||
|  |  	mkdir -p tmp-u/etc/udev/rules.d | ||||||
|  |  	for f in $^; do ln $$f tmp-u/etc/udev/rules.d/$$(basename $$f); done | ||||||
|  | -	( cd tmp-u && tar zcf - etc ) > $@-t
 | ||||||
|  | +	( cd tmp-u && $(TAR_COMMAND) -cf - etc ) > $@-t
 | ||||||
|  |  	rm -r tmp-u | ||||||
|  |  	mv $@-t $@ | ||||||
|  |   | ||||||
| @ -1,63 +0,0 @@ | |||||||
| From d4be44928a40e7ca1ef6255fb04d28f2fa7fc6b6 Mon Sep 17 00:00:00 2001 |  | ||||||
| From: "Richard W.M. Jones" <rjones@redhat.com> |  | ||||||
| Date: Tue, 7 Feb 2023 13:20:36 +0000 |  | ||||||
| Subject: [PATCH] Remove virt-dib |  | ||||||
| 
 |  | ||||||
| The tool only supports an older version of the diskimage-builder |  | ||||||
| metadata, and we do not have the time or inclination to update it to a |  | ||||||
| newer version. |  | ||||||
| 
 |  | ||||||
| Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1910039 |  | ||||||
| (cherry picked from commit 7503eeebede688409b2adf616d71a94e04b7f0d2) |  | ||||||
| ---
 |  | ||||||
|  appliance/packagelist.in | 30 ------------------------------ |  | ||||||
|  1 file changed, 30 deletions(-) |  | ||||||
| 
 |  | ||||||
| diff --git a/appliance/packagelist.in b/appliance/packagelist.in
 |  | ||||||
| index 585d52ad..20b08c47 100644
 |  | ||||||
| --- a/appliance/packagelist.in
 |  | ||||||
| +++ b/appliance/packagelist.in
 |  | ||||||
| @@ -110,7 +110,6 @@ ifelse(ARCHLINUX,1,
 |  | ||||||
|    dnl syslinux has mtools as optional dependency, but in reality it's |  | ||||||
|    dnl a hard one: |  | ||||||
|    mtools |  | ||||||
| -  multipath-tools  dnl for kpartx
 |  | ||||||
|    nilfs-utils |  | ||||||
|    ntfs-3g |  | ||||||
|    ntfs-3g-system-compression |  | ||||||
| @@ -266,35 +265,6 @@ util-linux-ng
 |  | ||||||
|  xfsprogs |  | ||||||
|  zerofree |  | ||||||
|   |  | ||||||
| -dnl tools needed by virt-dib
 |  | ||||||
| -ifelse(REDHAT,1,
 |  | ||||||
| -  qemu-img
 |  | ||||||
| -  which
 |  | ||||||
| -)
 |  | ||||||
| -ifelse(DEBIAN,1,
 |  | ||||||
| -  qemu-utils
 |  | ||||||
| -)
 |  | ||||||
| -ifelse(ARCHLINUX,1,
 |  | ||||||
| -  qemu
 |  | ||||||
| -  which
 |  | ||||||
| -)
 |  | ||||||
| -ifelse(SUSE,1,
 |  | ||||||
| -  qemu-tools
 |  | ||||||
| -  which
 |  | ||||||
| -)
 |  | ||||||
| -ifelse(FRUGALWARE,1,
 |  | ||||||
| -  qemu
 |  | ||||||
| -  which
 |  | ||||||
| -)
 |  | ||||||
| -ifelse(MAGEIA,1,
 |  | ||||||
| -  qemu-img
 |  | ||||||
| -  which
 |  | ||||||
| -)
 |  | ||||||
| -curl
 |  | ||||||
| -kpartx
 |  | ||||||
| -dnl (virt-dib) tools optionally used for elements
 |  | ||||||
| -debootstrap
 |  | ||||||
| -
 |  | ||||||
|  dnl exFAT is not usually available in free software repos |  | ||||||
|  exfat-fuse |  | ||||||
|  exfat-utils |  | ||||||
							
								
								
									
										55
									
								
								SOURCES/0006-appliance-Refactor-the-TAR_COMMAND-macro.patch
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										55
									
								
								SOURCES/0006-appliance-Refactor-the-TAR_COMMAND-macro.patch
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,55 @@ | |||||||
|  | From 798e3e59b2af5057521c170268c03ab88aaf1307 Mon Sep 17 00:00:00 2001 | ||||||
|  | From: "Richard W.M. Jones" <rjones@redhat.com> | ||||||
|  | Date: Tue, 22 Oct 2024 09:14:15 +0100 | ||||||
|  | Subject: [PATCH] appliance: Refactor the TAR_COMMAND macro | ||||||
|  | 
 | ||||||
|  | No change, just make it easier to understand. | ||||||
|  | 
 | ||||||
|  | Updates: commit 53632b4b8245a6dd67c95015d52d1f4c562b14ed | ||||||
|  | ---
 | ||||||
|  |  appliance/Makefile.am | 11 ++++++----- | ||||||
|  |  1 file changed, 6 insertions(+), 5 deletions(-) | ||||||
|  | 
 | ||||||
|  | diff --git a/appliance/Makefile.am b/appliance/Makefile.am
 | ||||||
|  | index 7edc90e6..ce994035 100644
 | ||||||
|  | --- a/appliance/Makefile.am
 | ||||||
|  | +++ b/appliance/Makefile.am
 | ||||||
|  | @@ -113,8 +113,9 @@ packagelist: packagelist.in Makefile guestfsd.deps
 | ||||||
|  |  	cmp -s $@ $@-t || mv $@-t $@ | ||||||
|  |  	rm -f $@-t | ||||||
|  |   | ||||||
|  | -# Use stable times and owner/group (RHBZ#2320025).
 | ||||||
|  | -TAR_COMMAND := tar -z \
 | ||||||
|  | +# Use stable owner/group and mtimes (RHBZ#2320025).
 | ||||||
|  | +TAR_OPTIONS := \
 | ||||||
|  | +	-z \
 | ||||||
|  |  	--owner=0 --group=0 \ | ||||||
|  |  	$${SOURCE_DATE_EPOCH:+--mtime=@"$$SOURCE_DATE_EPOCH"} | ||||||
|  |   | ||||||
|  | @@ -123,7 +124,7 @@ supermin.d/daemon.tar.gz: ../daemon/guestfsd
 | ||||||
|  |  	rm -rf tmp-d | ||||||
|  |  	mkdir -p tmp-d$(DAEMON_SUPERMIN_DIR) tmp-d/etc | ||||||
|  |  	ln ../daemon/guestfsd tmp-d$(DAEMON_SUPERMIN_DIR)/guestfsd | ||||||
|  | -	( cd tmp-d && $(TAR_COMMAND) -cf - * ) > $@-t
 | ||||||
|  | +	( cd tmp-d && tar $(TAR_OPTIONS) -cf - * ) > $@-t
 | ||||||
|  |  	rm -r tmp-d | ||||||
|  |  	mv $@-t $@ | ||||||
|  |   | ||||||
|  | @@ -144,7 +145,7 @@ supermin.d/hostfiles: hostfiles.in Makefile
 | ||||||
|  |   | ||||||
|  |  supermin.d/init.tar.gz: init | ||||||
|  |  	rm -f $@ $@-t | ||||||
|  | -	( cd $(srcdir) && $(TAR_COMMAND) -cf - init ) > $@-t
 | ||||||
|  | +	( cd $(srcdir) && tar $(TAR_OPTIONS) -cf - init ) > $@-t
 | ||||||
|  |  	mv $@-t $@ | ||||||
|  |   | ||||||
|  |  # We should put this file in /lib/udev/rules.d, but put it in /etc so | ||||||
|  | @@ -154,7 +155,7 @@ supermin.d/udev-rules.tar.gz: 99-guestfs-serial.rules
 | ||||||
|  |  	rm -rf tmp-u | ||||||
|  |  	mkdir -p tmp-u/etc/udev/rules.d | ||||||
|  |  	for f in $^; do ln $$f tmp-u/etc/udev/rules.d/$$(basename $$f); done | ||||||
|  | -	( cd tmp-u && $(TAR_COMMAND) -cf - etc ) > $@-t
 | ||||||
|  | +	( cd tmp-u && tar $(TAR_OPTIONS) -cf - etc ) > $@-t
 | ||||||
|  |  	rm -r tmp-u | ||||||
|  |  	mv $@-t $@ | ||||||
|  |   | ||||||
							
								
								
									
										45
									
								
								SOURCES/0007-build-Add-new-dependency-on-json-c.patch
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										45
									
								
								SOURCES/0007-build-Add-new-dependency-on-json-c.patch
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,45 @@ | |||||||
|  | From 53872a0a1a267040677572c30b68bd1e8b62ebe3 Mon Sep 17 00:00:00 2001 | ||||||
|  | From: "Richard W.M. Jones" <rjones@redhat.com> | ||||||
|  | Date: Tue, 22 Oct 2024 11:01:25 +0100 | ||||||
|  | Subject: [PATCH] build: Add new dependency on json-c | ||||||
|  | 
 | ||||||
|  | This will eventually replace Jansson for all JSON parsing.  However | ||||||
|  | this commit simply introduces the new dependency in the configure | ||||||
|  | script and documents it. | ||||||
|  | 
 | ||||||
|  | I chose json-c 0.14 as the baseline since that is the version in RHEL 9. | ||||||
|  | Probably earlier versions would work. | ||||||
|  | ---
 | ||||||
|  |  docs/guestfs-building.pod | 4 ++++ | ||||||
|  |  m4/guestfs-libraries.m4   | 3 +++ | ||||||
|  |  2 files changed, 7 insertions(+) | ||||||
|  | 
 | ||||||
|  | diff --git a/docs/guestfs-building.pod b/docs/guestfs-building.pod
 | ||||||
|  | index 2c084521..de175aaf 100644
 | ||||||
|  | --- a/docs/guestfs-building.pod
 | ||||||
|  | +++ b/docs/guestfs-building.pod
 | ||||||
|  | @@ -189,6 +189,10 @@ I<Required>.
 | ||||||
|  |   | ||||||
|  |  I<Required>. | ||||||
|  |   | ||||||
|  | +=item json-c E<ge> 0.14
 | ||||||
|  | +
 | ||||||
|  | +I<Required>.
 | ||||||
|  | +
 | ||||||
|  |  =item po4a | ||||||
|  |   | ||||||
|  |  I<Required> if compiling from git. | ||||||
|  | diff --git a/m4/guestfs-libraries.m4 b/m4/guestfs-libraries.m4
 | ||||||
|  | index 18c4cd30..ee406d27 100644
 | ||||||
|  | --- a/m4/guestfs-libraries.m4
 | ||||||
|  | +++ b/m4/guestfs-libraries.m4
 | ||||||
|  | @@ -304,6 +304,9 @@ LIBS="$old_LIBS"
 | ||||||
|  |  dnl Check for Jansson JSON library (required). | ||||||
|  |  PKG_CHECK_MODULES([JANSSON], [jansson >= 2.7]) | ||||||
|  |   | ||||||
|  | +dnl Check for JSON-C library (required).
 | ||||||
|  | +PKG_CHECK_MODULES([JSON_C], [json-c >= 0.14])
 | ||||||
|  | +
 | ||||||
|  |  dnl Check for C++ (optional, we just use this to test the header works). | ||||||
|  |  AC_PROG_CXX | ||||||
|  |   | ||||||
| @ -1,32 +0,0 @@ | |||||||
| From d9ba056079f797483ea99394b265c9bf39769687 Mon Sep 17 00:00:00 2001 |  | ||||||
| From: "Richard W.M. Jones" <rjones@redhat.com> |  | ||||||
| Date: Thu, 9 Feb 2023 13:38:50 +0000 |  | ||||||
| Subject: [PATCH] lib: Choose q35 machine type for x86-64 |  | ||||||
| 
 |  | ||||||
| This machine type is more modern than the older 'pc' type and as most |  | ||||||
| qemu development is now focused there we expect it will perform and |  | ||||||
| behave better.  In almost all respects this change should make no |  | ||||||
| difference.
 |  | ||||||
| 
 |  | ||||||
| Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2168578 |  | ||||||
| Acked-by: Laszlo Ersek <lersek@redhat.com> |  | ||||||
| See-also: https://listman.redhat.com/archives/libguestfs/2023-February/030645.html |  | ||||||
| (cherry picked from commit f0f8e6c5fe0c3f6d5d90534d263bded3a4dc7e8d) |  | ||||||
| ---
 |  | ||||||
|  lib/guestfs-internal.h | 3 +++ |  | ||||||
|  1 file changed, 3 insertions(+) |  | ||||||
| 
 |  | ||||||
| diff --git a/lib/guestfs-internal.h b/lib/guestfs-internal.h
 |  | ||||||
| index 306f2a2e..fb55e026 100644
 |  | ||||||
| --- a/lib/guestfs-internal.h
 |  | ||||||
| +++ b/lib/guestfs-internal.h
 |  | ||||||
| @@ -113,6 +113,9 @@ cleanup_mutex_unlock (pthread_mutex_t **ptr)
 |  | ||||||
|  #define MAX_WINDOWS_EXPLORER_SIZE (4 * 1000 * 1000) |  | ||||||
|   |  | ||||||
|  /* Machine types. */ |  | ||||||
| +#if defined(__x86_64__)
 |  | ||||||
| +#define MACHINE_TYPE "q35"
 |  | ||||||
| +#endif
 |  | ||||||
|  #ifdef __arm__ |  | ||||||
|  #define MACHINE_TYPE "virt" |  | ||||||
|  #endif |  | ||||||
| @ -1,97 +0,0 @@ | |||||||
| From 826cf6d68e4369de3d160e91b7dad6a894469797 Mon Sep 17 00:00:00 2001 |  | ||||||
| From: Laszlo Ersek <lersek@redhat.com> |  | ||||||
| Date: Fri, 19 May 2023 16:08:48 +0200 |  | ||||||
| Subject: [PATCH] LUKS-on-LVM inspection test: rename VGs and LVs |  | ||||||
| 
 |  | ||||||
| In preparation for a subsequent patch, rename "VG" to "Volume-Group", and |  | ||||||
| "LV<n>" to "Logical-Volume-<n>", in the LUKS-on-LVM inspection test. |  | ||||||
| 
 |  | ||||||
| Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2168506 |  | ||||||
| Signed-off-by: Laszlo Ersek <lersek@redhat.com> |  | ||||||
| Message-Id: <20230519140849.310774-3-lersek@redhat.com> |  | ||||||
| Reviewed-by: Richard W.M. Jones <rjones@redhat.com> |  | ||||||
| (cherry picked from commit 58e26402334a4696fa08730eecc9098fc270ed1c) |  | ||||||
| ---
 |  | ||||||
|  test-data/phony-guests/make-fedora-img.pl     | 30 +++++++++++-------- |  | ||||||
|  .../test-key-option-inspect-luks-on-lvm.sh    | 16 +++++----- |  | ||||||
|  2 files changed, 25 insertions(+), 21 deletions(-) |  | ||||||
| 
 |  | ||||||
| diff --git a/test-data/phony-guests/make-fedora-img.pl b/test-data/phony-guests/make-fedora-img.pl
 |  | ||||||
| index 4c8e1499..b7dc902e 100755
 |  | ||||||
| --- a/test-data/phony-guests/make-fedora-img.pl
 |  | ||||||
| +++ b/test-data/phony-guests/make-fedora-img.pl
 |  | ||||||
| @@ -224,23 +224,27 @@ EOF
 |  | ||||||
|   |  | ||||||
|      # Create the Volume Group on /dev/sda2. |  | ||||||
|      $g->pvcreate ('/dev/sda2'); |  | ||||||
| -    $g->vgcreate ('VG', ['/dev/sda2']);
 |  | ||||||
| -    $g->lvcreate ('Root', 'VG', 32);
 |  | ||||||
| -    $g->lvcreate ('LV1',  'VG', 32);
 |  | ||||||
| -    $g->lvcreate ('LV2',  'VG', 32);
 |  | ||||||
| -    $g->lvcreate ('LV3',  'VG', 64);
 |  | ||||||
| +    $g->vgcreate ('Volume-Group', ['/dev/sda2']);
 |  | ||||||
| +    $g->lvcreate ('Root',              'Volume-Group', 32);
 |  | ||||||
| +    $g->lvcreate ('Logical-Volume-1',  'Volume-Group', 32);
 |  | ||||||
| +    $g->lvcreate ('Logical-Volume-2',  'Volume-Group', 32);
 |  | ||||||
| +    $g->lvcreate ('Logical-Volume-3',  'Volume-Group', 64);
 |  | ||||||
|   |  | ||||||
|      # Format each Logical Group as a LUKS device, with a different password. |  | ||||||
| -    $g->luks_format ('/dev/VG/Root', 'FEDORA-Root', 0);
 |  | ||||||
| -    $g->luks_format ('/dev/VG/LV1',  'FEDORA-LV1',  0);
 |  | ||||||
| -    $g->luks_format ('/dev/VG/LV2',  'FEDORA-LV2',  0);
 |  | ||||||
| -    $g->luks_format ('/dev/VG/LV3',  'FEDORA-LV3',  0);
 |  | ||||||
| +    $g->luks_format ('/dev/Volume-Group/Root',              'FEDORA-Root', 0);
 |  | ||||||
| +    $g->luks_format ('/dev/Volume-Group/Logical-Volume-1',  'FEDORA-LV1',  0);
 |  | ||||||
| +    $g->luks_format ('/dev/Volume-Group/Logical-Volume-2',  'FEDORA-LV2',  0);
 |  | ||||||
| +    $g->luks_format ('/dev/Volume-Group/Logical-Volume-3',  'FEDORA-LV3',  0);
 |  | ||||||
|   |  | ||||||
|      # Open the LUKS devices. This creates nodes like /dev/mapper/*-luks. |  | ||||||
| -    $g->cryptsetup_open ('/dev/VG/Root', 'FEDORA-Root', 'Root-luks');
 |  | ||||||
| -    $g->cryptsetup_open ('/dev/VG/LV1',  'FEDORA-LV1',  'LV1-luks');
 |  | ||||||
| -    $g->cryptsetup_open ('/dev/VG/LV2',  'FEDORA-LV2',  'LV2-luks');
 |  | ||||||
| -    $g->cryptsetup_open ('/dev/VG/LV3',  'FEDORA-LV3',  'LV3-luks');
 |  | ||||||
| +    $g->cryptsetup_open ('/dev/Volume-Group/Root',
 |  | ||||||
| +                         'FEDORA-Root', 'Root-luks');
 |  | ||||||
| +    $g->cryptsetup_open ('/dev/Volume-Group/Logical-Volume-1',
 |  | ||||||
| +                         'FEDORA-LV1',  'LV1-luks');
 |  | ||||||
| +    $g->cryptsetup_open ('/dev/Volume-Group/Logical-Volume-2',
 |  | ||||||
| +                         'FEDORA-LV2',  'LV2-luks');
 |  | ||||||
| +    $g->cryptsetup_open ('/dev/Volume-Group/Logical-Volume-3',
 |  | ||||||
| +                         'FEDORA-LV3',  'LV3-luks');
 |  | ||||||
|   |  | ||||||
|      # Phony root filesystem. |  | ||||||
|      $g->mkfs ('ext2', '/dev/mapper/Root-luks', blocksize => 4096, label => 'ROOT'); |  | ||||||
| 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 52cd7e98..a8d72b9f 100755
 |  | ||||||
| --- a/tests/luks/test-key-option-inspect-luks-on-lvm.sh
 |  | ||||||
| +++ b/tests/luks/test-key-option-inspect-luks-on-lvm.sh
 |  | ||||||
| @@ -30,10 +30,10 @@ skip_unless_phony_guest fedora-luks-on-lvm.img
 |  | ||||||
|  # Volume names. |  | ||||||
|  guestfish=(guestfish --listen --ro --inspector |  | ||||||
|             --add ../test-data/phony-guests/fedora-luks-on-lvm.img) |  | ||||||
| -keys_by_lvname=(--key /dev/VG/Root:key:FEDORA-Root
 |  | ||||||
| -                --key /dev/VG/LV1:key:FEDORA-LV1
 |  | ||||||
| -                --key /dev/VG/LV2:key:FEDORA-LV2
 |  | ||||||
| -                --key /dev/VG/LV3:key:FEDORA-LV3)
 |  | ||||||
| +keys_by_lvname=(--key /dev/Volume-Group/Root:key:FEDORA-Root
 |  | ||||||
| +                --key /dev/Volume-Group/Logical-Volume-1:key:FEDORA-LV1
 |  | ||||||
| +                --key /dev/Volume-Group/Logical-Volume-2:key:FEDORA-LV2
 |  | ||||||
| +                --key /dev/Volume-Group/Logical-Volume-3:key:FEDORA-LV3)
 |  | ||||||
|   |  | ||||||
|  # The variable assignment below will fail, and abort the script, if guestfish |  | ||||||
|  # refuses to start up. |  | ||||||
| @@ -56,10 +56,10 @@ function cleanup_guestfish
 |  | ||||||
|  trap cleanup_guestfish EXIT |  | ||||||
|   |  | ||||||
|  # Get the UUIDs of the LUKS devices. |  | ||||||
| -uuid_root=$(guestfish --remote -- luks-uuid /dev/VG/Root)
 |  | ||||||
| -uuid_lv1=$( guestfish --remote -- luks-uuid /dev/VG/LV1)
 |  | ||||||
| -uuid_lv2=$( guestfish --remote -- luks-uuid /dev/VG/LV2)
 |  | ||||||
| -uuid_lv3=$( guestfish --remote -- luks-uuid /dev/VG/LV3)
 |  | ||||||
| +uuid_root=$(guestfish --remote -- luks-uuid /dev/Volume-Group/Root)
 |  | ||||||
| +uuid_lv1=$( guestfish --remote -- luks-uuid /dev/Volume-Group/Logical-Volume-1)
 |  | ||||||
| +uuid_lv2=$( guestfish --remote -- luks-uuid /dev/Volume-Group/Logical-Volume-2)
 |  | ||||||
| +uuid_lv3=$( guestfish --remote -- luks-uuid /dev/Volume-Group/Logical-Volume-3)
 |  | ||||||
|   |  | ||||||
|  # The actual test. |  | ||||||
|  function check_filesystems |  | ||||||
							
								
								
									
										231
									
								
								SOURCES/0008-daemon-ldm.c-Replace-jansson-with-json-c.patch
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										231
									
								
								SOURCES/0008-daemon-ldm.c-Replace-jansson-with-json-c.patch
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,231 @@ | |||||||
|  | From 5ea1e899e00f49ed27f25697e632d864760faf96 Mon Sep 17 00:00:00 2001 | ||||||
|  | From: "Richard W.M. Jones" <rjones@redhat.com> | ||||||
|  | Date: Fri, 18 Oct 2024 21:44:13 +0100 | ||||||
|  | Subject: [PATCH] daemon/ldm.c: Replace jansson with json-c | ||||||
|  | 
 | ||||||
|  | ---
 | ||||||
|  |  daemon/Makefile.am |  4 +-- | ||||||
|  |  daemon/ldm.c       | 89 +++++++++++++++++++++++++--------------------- | ||||||
|  |  2 files changed, 51 insertions(+), 42 deletions(-) | ||||||
|  | 
 | ||||||
|  | diff --git a/daemon/Makefile.am b/daemon/Makefile.am
 | ||||||
|  | index bc74b6ef..bb72c024 100644
 | ||||||
|  | --- a/daemon/Makefile.am
 | ||||||
|  | +++ b/daemon/Makefile.am
 | ||||||
|  | @@ -225,7 +225,7 @@ guestfsd_LDADD = \
 | ||||||
|  |  	camldaemon.o \ | ||||||
|  |  	$(ACL_LIBS) \ | ||||||
|  |  	$(CAP_LIBS) \ | ||||||
|  | -	$(JANSSON_LIBS) \
 | ||||||
|  | +	$(JSON_C_LIBS) \
 | ||||||
|  |  	$(SELINUX_LIBS) \ | ||||||
|  |  	$(AUGEAS_LIBS) \ | ||||||
|  |  	$(HIVEX_LIBS) \ | ||||||
|  | @@ -264,7 +264,7 @@ guestfsd_CFLAGS = \
 | ||||||
|  |  	$(AUGEAS_CFLAGS) \ | ||||||
|  |  	$(HIVEX_CFLAGS) \ | ||||||
|  |  	$(SD_JOURNAL_CFLAGS) \ | ||||||
|  | -	$(JANSSON_CFLAGS) \
 | ||||||
|  | +	$(JSON_C_CFLAGS) \
 | ||||||
|  |  	$(PCRE2_CFLAGS) \ | ||||||
|  |  	$(LIBRPM_CFLAGS) | ||||||
|  |   | ||||||
|  | diff --git a/daemon/ldm.c b/daemon/ldm.c
 | ||||||
|  | index be4fb970..1488b925 100644
 | ||||||
|  | --- a/daemon/ldm.c
 | ||||||
|  | +++ b/daemon/ldm.c
 | ||||||
|  | @@ -25,7 +25,7 @@
 | ||||||
|  |  #include <sys/stat.h> | ||||||
|  |  #include <string.h> | ||||||
|  |   | ||||||
|  | -#include <jansson.h>
 | ||||||
|  | +#include <json.h>
 | ||||||
|  |   | ||||||
|  |  #include "daemon.h" | ||||||
|  |  #include "actions.h" | ||||||
|  | @@ -65,44 +65,54 @@ do_ldmtool_remove_all (void)
 | ||||||
|  |    return 0; | ||||||
|  |  } | ||||||
|  |   | ||||||
|  | -static json_t *
 | ||||||
|  | -parse_json (const char *json, const char *func)
 | ||||||
|  | +static json_object *
 | ||||||
|  | +parse_json (const char *json, const char *caller)
 | ||||||
|  |  { | ||||||
|  | -  json_t *tree;
 | ||||||
|  | -  json_error_t err;
 | ||||||
|  | +  json_object *tree = NULL;
 | ||||||
|  | +  json_tokener *tok = NULL;
 | ||||||
|  | +  enum json_tokener_error err;
 | ||||||
|  |   | ||||||
|  |    if (verbose) | ||||||
|  | -    fprintf (stderr, "%s: parsing json: %s\n", func, json);
 | ||||||
|  | +    fprintf (stderr, "%s: parsing json: %s\n", caller, json);
 | ||||||
|  |   | ||||||
|  | -  tree = json_loads (json, 0, &err);
 | ||||||
|  | -  if (tree == NULL) {
 | ||||||
|  | -    reply_with_error ("parse error: %s",
 | ||||||
|  | -                      strlen (err.text) ? err.text : "unknown error");
 | ||||||
|  | +  tok = json_tokener_new ();
 | ||||||
|  | +  json_tokener_set_flags (tok,
 | ||||||
|  | +                          JSON_TOKENER_STRICT | JSON_TOKENER_VALIDATE_UTF8);
 | ||||||
|  | +  tree = json_tokener_parse_ex (tok, json, strlen (json));
 | ||||||
|  | +  err = json_tokener_get_error (tok);
 | ||||||
|  | +  if (err != json_tokener_success) {
 | ||||||
|  | +    reply_with_error ("%s: parse error: %s",
 | ||||||
|  | +                      caller, json_tokener_error_desc (err));
 | ||||||
|  | +    json_tokener_free (tok);
 | ||||||
|  |      return NULL; | ||||||
|  |    } | ||||||
|  |   | ||||||
|  | -  /* Caller should free this by doing 'json_decref (tree);'. */
 | ||||||
|  | +  json_tokener_free (tok);
 | ||||||
|  | +
 | ||||||
|  | +  /* Caller should free this by doing json_object_put (tree). */
 | ||||||
|  |    return tree; | ||||||
|  |  } | ||||||
|  |   | ||||||
|  |  #define TYPE_ERROR ((char **) -1) | ||||||
|  |   | ||||||
|  |  static char ** | ||||||
|  | -json_value_to_string_list (json_t *node)
 | ||||||
|  | +json_value_to_string_list (json_object *node)
 | ||||||
|  |  { | ||||||
|  |    CLEANUP_FREE_STRINGSBUF DECLARE_STRINGSBUF (strs); | ||||||
|  | -  json_t *n;
 | ||||||
|  | +  json_object *n;
 | ||||||
|  |    size_t i; | ||||||
|  |   | ||||||
|  | -  if (!json_is_array (node))
 | ||||||
|  | +  if (json_object_get_type (node) != json_type_array)
 | ||||||
|  |      return TYPE_ERROR; | ||||||
|  |   | ||||||
|  | -  json_array_foreach (node, i, n) {
 | ||||||
|  | -    if (!json_is_string (n))
 | ||||||
|  | +  for (i = 0; i < json_object_array_length (node); ++i) {
 | ||||||
|  | +    n = json_object_array_get_idx (node, i); /* Doesn't incr the refcount. */
 | ||||||
|  | +    if (json_object_get_type (n) != json_type_string)
 | ||||||
|  |        return TYPE_ERROR; | ||||||
|  | -    if (add_string (&strs, json_string_value (n)) == -1)
 | ||||||
|  | +    if (add_string (&strs, json_object_get_string (n)) == -1)
 | ||||||
|  |        return NULL; | ||||||
|  |    } | ||||||
|  | +
 | ||||||
|  |    if (end_stringsbuf (&strs) == -1) | ||||||
|  |      return NULL; | ||||||
|  |   | ||||||
|  | @@ -111,17 +121,17 @@ json_value_to_string_list (json_t *node)
 | ||||||
|  |   | ||||||
|  |  static char ** | ||||||
|  |  parse_json_get_string_list (const char *json, | ||||||
|  | -                            const char *func, const char *cmd)
 | ||||||
|  | +                            const char *caller, const char *cmd)
 | ||||||
|  |  { | ||||||
|  |    char **ret; | ||||||
|  | -  json_t *tree = NULL;
 | ||||||
|  | +  json_object *tree = NULL;
 | ||||||
|  |   | ||||||
|  | -  tree = parse_json (json, func);
 | ||||||
|  | +  tree = parse_json (json, caller);
 | ||||||
|  |    if (tree == NULL) | ||||||
|  |      return NULL; | ||||||
|  |   | ||||||
|  |    ret = json_value_to_string_list (tree); | ||||||
|  | -  json_decref (tree);
 | ||||||
|  | +  json_object_put (tree);
 | ||||||
|  |    if (ret == TYPE_ERROR) { | ||||||
|  |      reply_with_error ("output of '%s' was not a JSON array of strings", cmd); | ||||||
|  |      return NULL; | ||||||
|  | @@ -133,74 +143,73 @@ parse_json_get_string_list (const char *json,
 | ||||||
|  |   | ||||||
|  |  static char * | ||||||
|  |  parse_json_get_object_string (const char *json, const char *key, int flags, | ||||||
|  | -                              const char *func, const char *cmd)
 | ||||||
|  | +                              const char *caller, const char *cmd)
 | ||||||
|  |  { | ||||||
|  |    const char *str; | ||||||
|  |    char *ret; | ||||||
|  | -  json_t *tree = NULL, *node;
 | ||||||
|  | +  json_object *tree = NULL, *node;
 | ||||||
|  |   | ||||||
|  | -  tree = parse_json (json, func);
 | ||||||
|  | +  tree = parse_json (json, caller);
 | ||||||
|  |    if (tree == NULL) | ||||||
|  |      return NULL; | ||||||
|  |   | ||||||
|  | -  if (!json_is_object (tree))
 | ||||||
|  | +  if (json_object_get_type (tree) != json_type_object)
 | ||||||
|  |      goto bad_type; | ||||||
|  |   | ||||||
|  | -  node = json_object_get (tree, key);
 | ||||||
|  | +  node = json_object_object_get (tree, key);
 | ||||||
|  |    if (node == NULL) | ||||||
|  |      goto bad_type; | ||||||
|  |   | ||||||
|  | -  if ((flags & GET_STRING_NULL_TO_EMPTY) && json_is_null (node))
 | ||||||
|  | +  if ((flags & GET_STRING_NULL_TO_EMPTY) &&
 | ||||||
|  | +      json_object_get_type (node) == json_type_null)
 | ||||||
|  |      ret = strdup (""); | ||||||
|  |    else { | ||||||
|  | -    str = json_string_value (node);
 | ||||||
|  | -    if (str == NULL)
 | ||||||
|  | -      goto bad_type;
 | ||||||
|  | -    ret = strndup (str, json_string_length (node));
 | ||||||
|  | +    str = json_object_get_string (node);
 | ||||||
|  | +    ret = strndup (str, strlen (str));
 | ||||||
|  |    } | ||||||
|  |    if (ret == NULL) | ||||||
|  |      reply_with_perror ("strdup"); | ||||||
|  |   | ||||||
|  | -  json_decref (tree);
 | ||||||
|  | +  json_object_put (tree);
 | ||||||
|  |   | ||||||
|  |    return ret; | ||||||
|  |   | ||||||
|  |   bad_type: | ||||||
|  |    reply_with_error ("output of '%s' was not a JSON object " | ||||||
|  |                      "containing a key '%s' of type string", cmd, key); | ||||||
|  | -  json_decref (tree);
 | ||||||
|  | +  json_object_put (tree);
 | ||||||
|  |    return NULL; | ||||||
|  |  } | ||||||
|  |   | ||||||
|  |  static char ** | ||||||
|  |  parse_json_get_object_string_list (const char *json, const char *key, | ||||||
|  | -                                   const char *func, const char *cmd)
 | ||||||
|  | +                                   const char *caller, const char *cmd)
 | ||||||
|  |  { | ||||||
|  |    char **ret; | ||||||
|  | -  json_t *tree, *node;
 | ||||||
|  | +  json_object *tree, *node;
 | ||||||
|  |   | ||||||
|  | -  tree = parse_json (json, func);
 | ||||||
|  | +  tree = parse_json (json, caller);
 | ||||||
|  |    if (tree == NULL) | ||||||
|  |      return NULL; | ||||||
|  |   | ||||||
|  | -  if (!json_is_object (tree))
 | ||||||
|  | +  if (json_object_get_type (tree) != json_type_object)
 | ||||||
|  |      goto bad_type; | ||||||
|  |   | ||||||
|  | -  node = json_object_get (tree, key);
 | ||||||
|  | +  node = json_object_object_get (tree, key);
 | ||||||
|  |    if (node == NULL) | ||||||
|  |      goto bad_type; | ||||||
|  |   | ||||||
|  |    ret = json_value_to_string_list (node); | ||||||
|  |    if (ret == TYPE_ERROR) | ||||||
|  |      goto bad_type; | ||||||
|  | -  json_decref (tree);
 | ||||||
|  | +  json_object_put (tree);
 | ||||||
|  |    return ret; | ||||||
|  |   | ||||||
|  |   bad_type: | ||||||
|  |    reply_with_error ("output of '%s' was not a JSON object " | ||||||
|  |                      "containing a key '%s' of type array of strings", | ||||||
|  |                      cmd, key); | ||||||
|  | -  json_decref (tree);
 | ||||||
|  | +  json_object_put (tree);
 | ||||||
|  |    return NULL; | ||||||
|  |  } | ||||||
|  |   | ||||||
| @ -1,46 +0,0 @@ | |||||||
| From 56d7564eaa308ef7de44c8b2b5dfc7997140142e Mon Sep 17 00:00:00 2001 |  | ||||||
| From: Laszlo Ersek <lersek@redhat.com> |  | ||||||
| Date: Fri, 19 May 2023 16:08:49 +0200 |  | ||||||
| Subject: [PATCH] LUKS-on-LVM inspection test: test /dev/mapper/VG-LV |  | ||||||
|  translation |  | ||||||
| 
 |  | ||||||
| In the LUKS-on-LVM inspection test, call the "check_filesystems" function |  | ||||||
| yet another time, now with such "--key" options that exercise the recent |  | ||||||
| "/dev/mapper/VG-LV" -> "/dev/VG/LV" translation (unescaping) from |  | ||||||
| libguestfs-common. |  | ||||||
| 
 |  | ||||||
| Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2168506 |  | ||||||
| Signed-off-by: Laszlo Ersek <lersek@redhat.com> |  | ||||||
| Message-Id: <20230519140849.310774-4-lersek@redhat.com> |  | ||||||
| Reviewed-by: Richard W.M. Jones <rjones@redhat.com> |  | ||||||
| (cherry picked from commit 32408a9c36165af376f9f42e7d3e158d3da2c76e) |  | ||||||
| ---
 |  | ||||||
|  .../test-key-option-inspect-luks-on-lvm.sh     | 18 ++++++++++++++++++ |  | ||||||
|  1 file changed, 18 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 a8d72b9f..932862b1 100755
 |  | ||||||
| --- a/tests/luks/test-key-option-inspect-luks-on-lvm.sh
 |  | ||||||
| +++ b/tests/luks/test-key-option-inspect-luks-on-lvm.sh
 |  | ||||||
| @@ -101,3 +101,21 @@ eval "$fish_ref"
 |  | ||||||
|   |  | ||||||
|  # Repeat the test. |  | ||||||
|  check_filesystems |  | ||||||
| +
 |  | ||||||
| +# Exit the current guestfish background process.
 |  | ||||||
| +guestfish --remote -- exit
 |  | ||||||
| +GUESTFISH_PID=
 |  | ||||||
| +
 |  | ||||||
| +# Start up another guestfish background process, and specify the keys in
 |  | ||||||
| +# /dev/mapper/VG-LV format this time.
 |  | ||||||
| +keys_by_mapper_lvname=(
 |  | ||||||
| +  --key /dev/mapper/Volume--Group-Root:key:FEDORA-Root
 |  | ||||||
| +  --key /dev/mapper/Volume--Group-Logical--Volume--1:key:FEDORA-LV1
 |  | ||||||
| +  --key /dev/mapper/Volume--Group-Logical--Volume--2:key:FEDORA-LV2
 |  | ||||||
| +  --key /dev/mapper/Volume--Group-Logical--Volume--3:key:FEDORA-LV3
 |  | ||||||
| +)
 |  | ||||||
| +fish_ref=$("${guestfish[@]}" "${keys_by_mapper_lvname[@]}")
 |  | ||||||
| +eval "$fish_ref"
 |  | ||||||
| +
 |  | ||||||
| +# Repeat the test.
 |  | ||||||
| +check_filesystems
 |  | ||||||
| @ -1,62 +0,0 @@ | |||||||
| From 744a257083ccc30e6b7bae40acc04eb45a59a971 Mon Sep 17 00:00:00 2001 |  | ||||||
| From: "Richard W.M. Jones" <rjones@redhat.com> |  | ||||||
| Date: Mon, 22 May 2023 17:15:39 +0100 |  | ||||||
| Subject: [PATCH] fuse: Don't call fclose(NULL) on error paths |  | ||||||
| MIME-Version: 1.0 |  | ||||||
| Content-Type: text/plain; charset=UTF-8 |  | ||||||
| Content-Transfer-Encoding: 8bit |  | ||||||
| 
 |  | ||||||
| Various errors like this: |  | ||||||
| 
 |  | ||||||
| In function ‘test_fuse’, |  | ||||||
|     inlined from ‘main’ at test-fuse.c:133:11: |  | ||||||
| test-fuse.c:274:5: error: argument 1 null where non-null expected [-Werror=nonnull] |  | ||||||
|   274 |     fclose (fp); |  | ||||||
|       |     ^~~~~~~~~~~ |  | ||||||
| In file included from test-fuse.c:26: |  | ||||||
| /usr/include/stdio.h: In function ‘main’: |  | ||||||
| /usr/include/stdio.h:183:12: note: in a call to function ‘fclose’ declared ‘nonnull’ |  | ||||||
|   183 | extern int fclose (FILE *__stream) __nonnull ((1)); |  | ||||||
|       |            ^~~~~~ |  | ||||||
| 
 |  | ||||||
| (cherry picked from commit ca20f27cb0898c347e49b543a8acdfb0a8a8fa7e) |  | ||||||
| ---
 |  | ||||||
|  fuse/test-fuse.c | 4 ---- |  | ||||||
|  1 file changed, 4 deletions(-) |  | ||||||
| 
 |  | ||||||
| diff --git a/fuse/test-fuse.c b/fuse/test-fuse.c
 |  | ||||||
| index 9c0db594..90a78dc7 100644
 |  | ||||||
| --- a/fuse/test-fuse.c
 |  | ||||||
| +++ b/fuse/test-fuse.c
 |  | ||||||
| @@ -271,7 +271,6 @@ test_fuse (void)
 |  | ||||||
|    fp = fopen ("hello.txt", "r"); |  | ||||||
|    if (fp == NULL) { |  | ||||||
|      perror ("open: hello.txt"); |  | ||||||
| -    fclose (fp);
 |  | ||||||
|      return -1; |  | ||||||
|    } |  | ||||||
|    if (getline (&line, &len, fp) == -1) { |  | ||||||
| @@ -289,7 +288,6 @@ test_fuse (void)
 |  | ||||||
|    fp = fopen ("world.txt", "r"); |  | ||||||
|    if (fp == NULL) { |  | ||||||
|      perror ("open: world.txt"); |  | ||||||
| -    fclose (fp);
 |  | ||||||
|      return -1; |  | ||||||
|    } |  | ||||||
|    if (getline (&line, &len, fp) == -1) { |  | ||||||
| @@ -352,7 +350,6 @@ test_fuse (void)
 |  | ||||||
|    fp = fopen ("new", "w"); |  | ||||||
|    if (fp == NULL) { |  | ||||||
|      perror ("open: new"); |  | ||||||
| -    fclose (fp);
 |  | ||||||
|      return -1; |  | ||||||
|    } |  | ||||||
|    fclose (fp); |  | ||||||
| @@ -615,7 +612,6 @@ test_fuse (void)
 |  | ||||||
|    fp = fopen ("new.txt", "w"); |  | ||||||
|    if (fp == NULL) { |  | ||||||
|      perror ("open: new.txt"); |  | ||||||
| -    fclose (fp);
 |  | ||||||
|      return -1; |  | ||||||
|    } |  | ||||||
|    for (u = 0; u < 1000; ++u) { |  | ||||||
							
								
								
									
										214
									
								
								SOURCES/0010-lib-info.c-Replace-jansson-with-json-c.patch
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										214
									
								
								SOURCES/0010-lib-info.c-Replace-jansson-with-json-c.patch
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,214 @@ | |||||||
|  | From 13e3222f3463578ab18ee8efc8502c6dfd9f51a4 Mon Sep 17 00:00:00 2001 | ||||||
|  | From: "Richard W.M. Jones" <rjones@redhat.com> | ||||||
|  | Date: Tue, 22 Oct 2024 15:55:00 +0100 | ||||||
|  | Subject: [PATCH] lib/info.c: Replace jansson with json-c | ||||||
|  | 
 | ||||||
|  | ---
 | ||||||
|  |  lib/Makefile.am |  4 ++- | ||||||
|  |  lib/info.c      | 85 +++++++++++++++++++++++++------------------------ | ||||||
|  |  2 files changed, 47 insertions(+), 42 deletions(-) | ||||||
|  | 
 | ||||||
|  | diff --git a/lib/Makefile.am b/lib/Makefile.am
 | ||||||
|  | index 0ed1576f..60567b04 100644
 | ||||||
|  | --- a/lib/Makefile.am
 | ||||||
|  | +++ b/lib/Makefile.am
 | ||||||
|  | @@ -138,7 +138,8 @@ libguestfs_la_CFLAGS = \
 | ||||||
|  |  	$(PCRE2_CFLAGS) \ | ||||||
|  |  	$(LIBVIRT_CFLAGS) \ | ||||||
|  |  	$(LIBXML2_CFLAGS) \ | ||||||
|  | -	$(JANSSON_CFLAGS)
 | ||||||
|  | +	$(JANSSON_CFLAGS) \
 | ||||||
|  | +	$(JSON_C_CFLAGS)
 | ||||||
|  |   | ||||||
|  |  libguestfs_la_LIBADD = \ | ||||||
|  |  	../common/errnostring/liberrnostring.la \ | ||||||
|  | @@ -150,6 +151,7 @@ libguestfs_la_LIBADD = \
 | ||||||
|  |  	$(LIBVIRT_LIBS) $(LIBXML2_LIBS) \ | ||||||
|  |  	$(SELINUX_LIBS) \ | ||||||
|  |  	$(JANSSON_LIBS) \ | ||||||
|  | +	$(JSON_C_LIBS) \
 | ||||||
|  |  	../gnulib/lib/libgnu.la \ | ||||||
|  |  	$(LIBSOCKET) \ | ||||||
|  |  	$(LIB_CLOCK_GETTIME) \ | ||||||
|  | diff --git a/lib/info.c b/lib/info.c
 | ||||||
|  | index b60fc8b3..f325bfab 100644
 | ||||||
|  | --- a/lib/info.c
 | ||||||
|  | +++ b/lib/info.c
 | ||||||
|  | @@ -37,42 +37,45 @@
 | ||||||
|  |  #include <sys/resource.h> | ||||||
|  |  #endif | ||||||
|  |   | ||||||
|  | -#include <jansson.h>
 | ||||||
|  | +#include <json.h>
 | ||||||
|  |   | ||||||
|  |  #include "guestfs.h" | ||||||
|  |  #include "guestfs-internal.h" | ||||||
|  |  #include "guestfs-internal-actions.h" | ||||||
|  |   | ||||||
|  | -#define CLEANUP_JSON_T_DECREF __attribute__((cleanup(cleanup_json_t_decref)))
 | ||||||
|  | +#define CLEANUP_JSON_OBJECT_PUT \
 | ||||||
|  | +  __attribute__((cleanup(cleanup_json_object_put)))
 | ||||||
|  |   | ||||||
|  |  static void | ||||||
|  | -cleanup_json_t_decref (void *ptr)
 | ||||||
|  | +cleanup_json_object_put (void *ptr)
 | ||||||
|  |  { | ||||||
|  | -  json_decref (* (json_t **) ptr);
 | ||||||
|  | +  json_object_put (* (json_object **) ptr);
 | ||||||
|  |  } | ||||||
|  |   | ||||||
|  | -static json_t *get_json_output (guestfs_h *g, const char *filename);
 | ||||||
|  | +static json_object *get_json_output (guestfs_h *g, const char *filename);
 | ||||||
|  |  static int qemu_img_supports_U_option (guestfs_h *g); | ||||||
|  |  static void set_child_rlimits (struct command *); | ||||||
|  |   | ||||||
|  |  char * | ||||||
|  |  guestfs_impl_disk_format (guestfs_h *g, const char *filename) | ||||||
|  |  { | ||||||
|  | -  CLEANUP_JSON_T_DECREF json_t *tree = get_json_output (g, filename);
 | ||||||
|  | -  json_t *node;
 | ||||||
|  | +  CLEANUP_JSON_OBJECT_PUT json_object *tree = get_json_output (g, filename);
 | ||||||
|  | +  json_object *node;
 | ||||||
|  | +  const char *format;
 | ||||||
|  |   | ||||||
|  |    if (tree == NULL) | ||||||
|  |      return NULL; | ||||||
|  |   | ||||||
|  | -  if (!json_is_object (tree))
 | ||||||
|  | +  if (json_object_get_type (tree) != json_type_object)
 | ||||||
|  |      goto bad_type; | ||||||
|  |   | ||||||
|  | -  node = json_object_get (tree, "format");
 | ||||||
|  | -  if (!json_is_string (node))
 | ||||||
|  | +  node = json_object_object_get (tree, "format");
 | ||||||
|  | +  if (node == NULL)
 | ||||||
|  |      goto bad_type; | ||||||
|  |   | ||||||
|  | -  return safe_strndup (g, json_string_value (node),
 | ||||||
|  | -                          json_string_length (node)); /* caller frees */
 | ||||||
|  | +  format = json_object_get_string (node);
 | ||||||
|  | +
 | ||||||
|  | +  return safe_strdup (g, format); /* caller frees */
 | ||||||
|  |   | ||||||
|  |   bad_type: | ||||||
|  |    error (g, _("qemu-img info: JSON output did not contain ‘format’ key")); | ||||||
|  | @@ -82,20 +85,20 @@ guestfs_impl_disk_format (guestfs_h *g, const char *filename)
 | ||||||
|  |  int64_t | ||||||
|  |  guestfs_impl_disk_virtual_size (guestfs_h *g, const char *filename) | ||||||
|  |  { | ||||||
|  | -  CLEANUP_JSON_T_DECREF json_t *tree = get_json_output (g, filename);
 | ||||||
|  | -  json_t *node;
 | ||||||
|  | +  CLEANUP_JSON_OBJECT_PUT json_object *tree = get_json_output (g, filename);
 | ||||||
|  | +  json_object *node;
 | ||||||
|  |   | ||||||
|  |    if (tree == NULL) | ||||||
|  |      return -1; | ||||||
|  |   | ||||||
|  | -  if (!json_is_object (tree))
 | ||||||
|  | +  if (json_object_get_type (tree) != json_type_object)
 | ||||||
|  |      goto bad_type; | ||||||
|  |   | ||||||
|  | -  node = json_object_get (tree, "virtual-size");
 | ||||||
|  | -  if (!json_is_integer (node))
 | ||||||
|  | +  node = json_object_object_get (tree, "virtual-size");
 | ||||||
|  | +  if (node == NULL)
 | ||||||
|  |      goto bad_type; | ||||||
|  |   | ||||||
|  | -  return json_integer_value (node);
 | ||||||
|  | +  return json_object_get_int64 (node);
 | ||||||
|  |   | ||||||
|  |   bad_type: | ||||||
|  |    error (g, _("qemu-img info: JSON output did not contain ‘virtual-size’ key")); | ||||||
|  | @@ -105,24 +108,18 @@ guestfs_impl_disk_virtual_size (guestfs_h *g, const char *filename)
 | ||||||
|  |  int | ||||||
|  |  guestfs_impl_disk_has_backing_file (guestfs_h *g, const char *filename) | ||||||
|  |  { | ||||||
|  | -  CLEANUP_JSON_T_DECREF json_t *tree = get_json_output (g, filename);
 | ||||||
|  | -  json_t *node;
 | ||||||
|  | +  CLEANUP_JSON_OBJECT_PUT json_object *tree = get_json_output (g, filename);
 | ||||||
|  | +  json_object *node;
 | ||||||
|  |   | ||||||
|  |    if (tree == NULL) | ||||||
|  |      return -1; | ||||||
|  |   | ||||||
|  | -  if (!json_is_object (tree))
 | ||||||
|  | +  if (json_object_get_type (tree) != json_type_object)
 | ||||||
|  |      goto bad_type; | ||||||
|  |   | ||||||
|  | -  node = json_object_get (tree, "backing-filename");
 | ||||||
|  | +  node = json_object_object_get (tree, "backing-filename");
 | ||||||
|  |    if (node == NULL) | ||||||
|  | -    return 0; /* no backing-filename key means no backing file */
 | ||||||
|  | -
 | ||||||
|  | -  /* Work on the assumption that if this field is null, it means
 | ||||||
|  | -   * no backing file, rather than being an error.
 | ||||||
|  | -   */
 | ||||||
|  | -  if (json_is_null (node))
 | ||||||
|  | -    return 0;
 | ||||||
|  | +    return 0; /* no backing-filename key or null means no backing file */
 | ||||||
|  |    return 1; | ||||||
|  |   | ||||||
|  |   bad_type: | ||||||
|  | @@ -136,12 +133,12 @@ guestfs_impl_disk_has_backing_file (guestfs_h *g, const char *filename)
 | ||||||
|  |  static void parse_json (guestfs_h *g, void *treevp, const char *input, size_t len); | ||||||
|  |  #define PARSE_JSON_NO_OUTPUT ((void *) -1) | ||||||
|  |   | ||||||
|  | -static json_t *
 | ||||||
|  | +static json_object *
 | ||||||
|  |  get_json_output (guestfs_h *g, const char *filename) | ||||||
|  |  { | ||||||
|  |    CLEANUP_CMD_CLOSE struct command *cmd = guestfs_int_new_command (g); | ||||||
|  |    int r; | ||||||
|  | -  json_t *tree = NULL;
 | ||||||
|  | +  json_object *tree = NULL;
 | ||||||
|  |   | ||||||
|  |    guestfs_int_cmd_add_arg (cmd, "qemu-img"); | ||||||
|  |    guestfs_int_cmd_add_arg (cmd, "info"); | ||||||
|  | @@ -176,15 +173,16 @@ get_json_output (guestfs_h *g, const char *filename)
 | ||||||
|  |      return NULL; | ||||||
|  |    } | ||||||
|  |   | ||||||
|  | -  return tree;          /* caller must call json_decref (tree) */
 | ||||||
|  | +  return tree;          /* caller must call json_object_put (tree) */
 | ||||||
|  |  } | ||||||
|  |   | ||||||
|  |  /* Parse the JSON document printed by qemu-img info --output json. */ | ||||||
|  |  static void | ||||||
|  |  parse_json (guestfs_h *g, void *treevp, const char *input, size_t len) | ||||||
|  |  { | ||||||
|  | -  json_t **tree_ret = treevp;
 | ||||||
|  | -  json_error_t err;
 | ||||||
|  | +  json_tokener *tok = NULL;
 | ||||||
|  | +  json_object **tree_ret = treevp;
 | ||||||
|  | +  enum json_tokener_error err;
 | ||||||
|  |   | ||||||
|  |    assert (*tree_ret == NULL); | ||||||
|  |   | ||||||
|  | @@ -197,15 +195,20 @@ parse_json (guestfs_h *g, void *treevp, const char *input, size_t len)
 | ||||||
|  |      return; | ||||||
|  |    } | ||||||
|  |   | ||||||
|  | -  debug (g, "%s: qemu-img info JSON output:\n%.*s\n", __func__, (int) len, input);
 | ||||||
|  | +  debug (g, "%s: qemu-img info JSON output:\n%.*s\n",
 | ||||||
|  | +         __func__, (int) len, input);
 | ||||||
|  |   | ||||||
|  | -  *tree_ret = json_loadb (input, len, 0, &err);
 | ||||||
|  | -  if (*tree_ret == NULL) {
 | ||||||
|  | -    if (strlen (err.text) > 0)
 | ||||||
|  | -      error (g, _("qemu-img info: JSON parse error: %s"), err.text);
 | ||||||
|  | -    else
 | ||||||
|  | -      error (g, _("qemu-img info: unknown JSON parse error"));
 | ||||||
|  | +  tok = json_tokener_new ();
 | ||||||
|  | +  json_tokener_set_flags (tok,
 | ||||||
|  | +                          JSON_TOKENER_STRICT | JSON_TOKENER_VALIDATE_UTF8);
 | ||||||
|  | +  *tree_ret = json_tokener_parse_ex (tok, input, len);
 | ||||||
|  | +  err = json_tokener_get_error (tok);
 | ||||||
|  | +  if (err != json_tokener_success) {
 | ||||||
|  | +    error (g, _("qemu-img info: JSON parse error: %s"),
 | ||||||
|  | +           json_tokener_error_desc (err));
 | ||||||
|  | +    *tree_ret = NULL;           /* should already be */
 | ||||||
|  |    } | ||||||
|  | +  json_tokener_free (tok);
 | ||||||
|  |  } | ||||||
|  |   | ||||||
|  |  static void | ||||||
| @ -0,0 +1,129 @@ | |||||||
|  | From 47857751a78108617e1e25d4949564bc2a182381 Mon Sep 17 00:00:00 2001 | ||||||
|  | From: "Richard W.M. Jones" <rjones@redhat.com> | ||||||
|  | Date: Tue, 22 Oct 2024 16:23:07 +0100 | ||||||
|  | Subject: [PATCH] lib: direct: Remove test for qemu mandatory locking | ||||||
|  | 
 | ||||||
|  | We tested for QEMU >= 2.10 support for mandatory locking.  I believe | ||||||
|  | this is for all practical purposes always enabled now (and qemu 2.10 | ||||||
|  | is ancient history) so simply assume it's true always. | ||||||
|  | ---
 | ||||||
|  |  lib/guestfs-internal.h |  1 - | ||||||
|  |  lib/launch-direct.c    | 19 ++++++----------- | ||||||
|  |  lib/qemu.c             | 48 ------------------------------------------ | ||||||
|  |  3 files changed, 7 insertions(+), 61 deletions(-) | ||||||
|  | 
 | ||||||
|  | diff --git a/lib/guestfs-internal.h b/lib/guestfs-internal.h
 | ||||||
|  | index f9f4628a..bb3772cb 100644
 | ||||||
|  | --- a/lib/guestfs-internal.h
 | ||||||
|  | +++ b/lib/guestfs-internal.h
 | ||||||
|  | @@ -796,7 +796,6 @@ extern struct qemu_data *guestfs_int_test_qemu (guestfs_h *g);
 | ||||||
|  |  extern struct version guestfs_int_qemu_version (guestfs_h *g, struct qemu_data *); | ||||||
|  |  extern int guestfs_int_qemu_supports (guestfs_h *g, const struct qemu_data *, const char *option); | ||||||
|  |  extern int guestfs_int_qemu_supports_device (guestfs_h *g, const struct qemu_data *, const char *device_name); | ||||||
|  | -extern int guestfs_int_qemu_mandatory_locking (guestfs_h *g, const struct qemu_data *data);
 | ||||||
|  |  extern bool guestfs_int_platform_has_kvm (guestfs_h *g, const struct qemu_data *data); | ||||||
|  |  extern char *guestfs_int_drive_source_qemu_param (guestfs_h *g, const struct drive_source *src); | ||||||
|  |  extern bool guestfs_int_discard_possible (guestfs_h *g, struct drive *drv, const struct version *qemu_version); | ||||||
|  | diff --git a/lib/launch-direct.c b/lib/launch-direct.c
 | ||||||
|  | index cdfd25a9..9d0c2215 100644
 | ||||||
|  | --- a/lib/launch-direct.c
 | ||||||
|  | +++ b/lib/launch-direct.c
 | ||||||
|  | @@ -57,7 +57,6 @@ struct backend_direct_data {
 | ||||||
|  |    pid_t recoverypid;            /* Recovery process PID. */ | ||||||
|  |   | ||||||
|  |    struct version qemu_version;  /* qemu version (0 if unable to parse). */ | ||||||
|  | -  int qemu_mandatory_locking;   /* qemu >= 2.10 does mandatory locking */
 | ||||||
|  |    struct qemu_data *qemu_data;  /* qemu -help output etc. */ | ||||||
|  |   | ||||||
|  |    char guestfsd_sock[UNIX_PATH_MAX]; /* Path to daemon socket. */ | ||||||
|  | @@ -240,13 +239,13 @@ add_drive_standard_params (guestfs_h *g, struct backend_direct_data *data,
 | ||||||
|  |      } | ||||||
|  |    } | ||||||
|  |    else { | ||||||
|  | -    /* Writable qcow2 overlay on top of read-only drive. */
 | ||||||
|  | -    if (data->qemu_mandatory_locking &&
 | ||||||
|  | -	/* Add the file-specific locking option only for files, as
 | ||||||
|  | -	 * qemu won't accept options unknown to the block driver in
 | ||||||
|  | -	 * use.
 | ||||||
|  | -	 */
 | ||||||
|  | -	drv->src.protocol == drive_protocol_file) {
 | ||||||
|  | +    /* Writable qcow2 overlay on top of read-only drive.
 | ||||||
|  | +     *
 | ||||||
|  | +     * Add the file-specific locking option only for files, as
 | ||||||
|  | +     * qemu won't accept options unknown to the block driver in
 | ||||||
|  | +     * use.
 | ||||||
|  | +     */
 | ||||||
|  | +    if (drv->src.protocol == drive_protocol_file) {
 | ||||||
|  |        append_list_format ("file.file.filename=%s", drv->overlay); | ||||||
|  |        append_list ("file.driver=qcow2"); | ||||||
|  |        append_list ("file.backing.file.locking=off"); | ||||||
|  | @@ -495,10 +494,6 @@ launch_direct (guestfs_h *g, void *datav, const char *arg)
 | ||||||
|  |      data->qemu_version = guestfs_int_qemu_version (g, data->qemu_data); | ||||||
|  |      debug (g, "qemu version: %d.%d", | ||||||
|  |             data->qemu_version.v_major, data->qemu_version.v_minor); | ||||||
|  | -    data->qemu_mandatory_locking =
 | ||||||
|  | -      guestfs_int_qemu_mandatory_locking (g, data->qemu_data);
 | ||||||
|  | -    debug (g, "qemu mandatory locking: %s",
 | ||||||
|  | -           data->qemu_mandatory_locking ? "yes" : "no");
 | ||||||
|  |    } | ||||||
|  |   | ||||||
|  |    /* Work out if KVM is supported or if the user wants to force TCG. */ | ||||||
|  | diff --git a/lib/qemu.c b/lib/qemu.c
 | ||||||
|  | index 886c92e5..f9270771 100644
 | ||||||
|  | --- a/lib/qemu.c
 | ||||||
|  | +++ b/lib/qemu.c
 | ||||||
|  | @@ -662,54 +662,6 @@ guestfs_int_qemu_supports_device (guestfs_h *g,
 | ||||||
|  |    return strstr (data->qemu_devices, device_name) != NULL; | ||||||
|  |  } | ||||||
|  |   | ||||||
|  | -/**
 | ||||||
|  | - * Test if the qemu binary uses mandatory file locking, added in
 | ||||||
|  | - * QEMU >= 2.10 (but sometimes disabled).
 | ||||||
|  | - */
 | ||||||
|  | -int
 | ||||||
|  | -guestfs_int_qemu_mandatory_locking (guestfs_h *g,
 | ||||||
|  | -                                    const struct qemu_data *data)
 | ||||||
|  | -{
 | ||||||
|  | -  json_t *schema, *v, *meta_type, *members, *m, *name;
 | ||||||
|  | -  size_t i, j;
 | ||||||
|  | -
 | ||||||
|  | -  /* If there's no QMP schema, fall back to checking the version. */
 | ||||||
|  | -  if (!data->qmp_schema_tree) {
 | ||||||
|  | -  fallback:
 | ||||||
|  | -    return guestfs_int_version_ge (&data->qemu_version, 2, 10, 0);
 | ||||||
|  | -  }
 | ||||||
|  | -
 | ||||||
|  | -  /* Top element of qmp_schema_tree is the { "return": ... } wrapper.
 | ||||||
|  | -   * Extract the schema from the wrapper.  Note the returned ‘schema’
 | ||||||
|  | -   * will be an array.
 | ||||||
|  | -   */
 | ||||||
|  | -  schema = json_object_get (data->qmp_schema_tree, "return");
 | ||||||
|  | -  if (!json_is_array (schema))
 | ||||||
|  | -    goto fallback;
 | ||||||
|  | -
 | ||||||
|  | -  /* Now look for any member of the array which has:
 | ||||||
|  | -   * { "meta-type": "object",
 | ||||||
|  | -   *   "members": [ ... { "name": "locking", ... } ... ] ... }
 | ||||||
|  | -   */
 | ||||||
|  | -  json_array_foreach (schema, i, v) {
 | ||||||
|  | -    meta_type = json_object_get (v, "meta-type");
 | ||||||
|  | -    if (json_is_string (meta_type) &&
 | ||||||
|  | -        STREQ (json_string_value (meta_type), "object")) {
 | ||||||
|  | -      members = json_object_get (v, "members");
 | ||||||
|  | -      if (json_is_array (members)) {
 | ||||||
|  | -        json_array_foreach (members, j, m) {
 | ||||||
|  | -          name = json_object_get (m, "name");
 | ||||||
|  | -          if (json_is_string (name) &&
 | ||||||
|  | -              STREQ (json_string_value (name), "locking"))
 | ||||||
|  | -            return 1;
 | ||||||
|  | -        }
 | ||||||
|  | -      }
 | ||||||
|  | -    }
 | ||||||
|  | -  }
 | ||||||
|  | -
 | ||||||
|  | -  return 0;
 | ||||||
|  | -}
 | ||||||
|  | -
 | ||||||
|  |  bool | ||||||
|  |  guestfs_int_platform_has_kvm (guestfs_h *g, const struct qemu_data *data) | ||||||
|  |  { | ||||||
| @ -1,38 +0,0 @@ | |||||||
| From 8aafa0631b55ec92ba1fae34d94500dd1e027083 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) |  | ||||||
|   |  | ||||||
							
								
								
									
										155
									
								
								SOURCES/0012-lib-qemu.c-Replace-jansson-with-json-c.patch
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										155
									
								
								SOURCES/0012-lib-qemu.c-Replace-jansson-with-json-c.patch
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,155 @@ | |||||||
|  | From 9e3c1f44cafc2ce568462fcedc0033cab7d94cae Mon Sep 17 00:00:00 2001 | ||||||
|  | From: "Richard W.M. Jones" <rjones@redhat.com> | ||||||
|  | Date: Tue, 22 Oct 2024 16:24:30 +0100 | ||||||
|  | Subject: [PATCH] lib/qemu.c: Replace jansson with json-c | ||||||
|  | 
 | ||||||
|  | ---
 | ||||||
|  |  lib/qemu.c | 73 ++++++++++++++++++++++++++++-------------------------- | ||||||
|  |  1 file changed, 38 insertions(+), 35 deletions(-) | ||||||
|  | 
 | ||||||
|  | diff --git a/lib/qemu.c b/lib/qemu.c
 | ||||||
|  | index f9270771..1d7f45f0 100644
 | ||||||
|  | --- a/lib/qemu.c
 | ||||||
|  | +++ b/lib/qemu.c
 | ||||||
|  | @@ -37,7 +37,7 @@
 | ||||||
|  |   | ||||||
|  |  #include <libxml/uri.h> | ||||||
|  |   | ||||||
|  | -#include <jansson.h>
 | ||||||
|  | +#include <json.h>
 | ||||||
|  |   | ||||||
|  |  #include "full-write.h" | ||||||
|  |  #include "ignore-value.h" | ||||||
|  | @@ -46,12 +46,13 @@
 | ||||||
|  |  #include "guestfs-internal.h" | ||||||
|  |  #include "guestfs_protocol.h" | ||||||
|  |   | ||||||
|  | -#define CLEANUP_JSON_T_DECREF __attribute__((cleanup(cleanup_json_t_decref)))
 | ||||||
|  | +#define CLEANUP_JSON_OBJECT_PUT \
 | ||||||
|  | +  __attribute__((cleanup(cleanup_json_object_put)))
 | ||||||
|  |   | ||||||
|  |  static void | ||||||
|  | -cleanup_json_t_decref (void *ptr)
 | ||||||
|  | +cleanup_json_object_put (void *ptr)
 | ||||||
|  |  { | ||||||
|  | -  json_decref (* (json_t **) ptr);
 | ||||||
|  | +  json_object_put (* (json_object **) ptr);
 | ||||||
|  |  } | ||||||
|  |   | ||||||
|  |  struct qemu_data { | ||||||
|  | @@ -66,7 +67,7 @@ struct qemu_data {
 | ||||||
|  |   | ||||||
|  |    /* The following fields are derived from the fields above. */ | ||||||
|  |    struct version qemu_version;  /* Parsed qemu version number. */ | ||||||
|  | -  json_t *qmp_schema_tree;      /* qmp_schema parsed into a JSON tree */
 | ||||||
|  | +  json_object *qmp_schema_tree; /* qmp_schema parsed into a JSON tree */
 | ||||||
|  |    bool has_kvm;                 /* If KVM is available. */ | ||||||
|  |  }; | ||||||
|  |   | ||||||
|  | @@ -86,7 +87,7 @@ static int write_cache_query_kvm (guestfs_h *g, const struct qemu_data *data, co
 | ||||||
|  |  static int read_cache_qemu_stat (guestfs_h *g, struct qemu_data *data, const char *filename); | ||||||
|  |  static int write_cache_qemu_stat (guestfs_h *g, const struct qemu_data *data, const char *filename); | ||||||
|  |  static void parse_qemu_version (guestfs_h *g, const char *, struct version *qemu_version); | ||||||
|  | -static void parse_json (guestfs_h *g, const char *, json_t **);
 | ||||||
|  | +static void parse_json (guestfs_h *g, const char *, json_object **);
 | ||||||
|  |  static void parse_has_kvm (guestfs_h *g, const char *, bool *); | ||||||
|  |  static void read_all (guestfs_h *g, void *retv, const char *buf, size_t len); | ||||||
|  |  static int generic_read_cache (guestfs_h *g, const char *filename, char **strp); | ||||||
|  | @@ -442,20 +443,24 @@ parse_qemu_version (guestfs_h *g, const char *qemu_help,
 | ||||||
|  |   * is not possible. | ||||||
|  |   */ | ||||||
|  |  static void | ||||||
|  | -parse_json (guestfs_h *g, const char *json, json_t **treep)
 | ||||||
|  | +parse_json (guestfs_h *g, const char *json, json_object **treep)
 | ||||||
|  |  { | ||||||
|  | -  json_error_t err;
 | ||||||
|  | +  json_tokener *tok;
 | ||||||
|  | +  enum json_tokener_error err;
 | ||||||
|  |   | ||||||
|  |    if (!json) | ||||||
|  |      return; | ||||||
|  |   | ||||||
|  | -  *treep = json_loads (json, 0, &err);
 | ||||||
|  | -  if (*treep == NULL) {
 | ||||||
|  | -    if (strlen (err.text) > 0)
 | ||||||
|  | -      debug (g, "QMP parse error: %s (ignored)", err.text);
 | ||||||
|  | -    else
 | ||||||
|  | -      debug (g, "QMP unknown parse error (ignored)");
 | ||||||
|  | -  }
 | ||||||
|  | +  tok = json_tokener_new ();
 | ||||||
|  | +  json_tokener_set_flags (tok,
 | ||||||
|  | +                          JSON_TOKENER_STRICT | JSON_TOKENER_VALIDATE_UTF8);
 | ||||||
|  | +  *treep = json_tokener_parse_ex (tok, json, strlen (json));
 | ||||||
|  | +  err = json_tokener_get_error (tok);
 | ||||||
|  | +  if (err != json_tokener_success)
 | ||||||
|  | +    debug (g, "QMP parse error: %s (ignored)", json_tokener_error_desc (err));
 | ||||||
|  | +  json_tokener_free (tok);
 | ||||||
|  | +
 | ||||||
|  | +  /* Caller should do json_object_put (*treep) */
 | ||||||
|  |  } | ||||||
|  |   | ||||||
|  |  /** | ||||||
|  | @@ -469,37 +474,35 @@ parse_json (guestfs_h *g, const char *json, json_t **treep)
 | ||||||
|  |  static void | ||||||
|  |  parse_has_kvm (guestfs_h *g, const char *json, bool *ret) | ||||||
|  |  { | ||||||
|  | -  CLEANUP_JSON_T_DECREF json_t *tree = NULL;
 | ||||||
|  | -  json_error_t err;
 | ||||||
|  | -  json_t *return_node, *enabled_node;
 | ||||||
|  | +  CLEANUP_JSON_OBJECT_PUT json_object *tree = NULL;
 | ||||||
|  | +  json_tokener *tok;
 | ||||||
|  | +  enum json_tokener_error err;
 | ||||||
|  | +  json_object *return_node, *enabled_node;
 | ||||||
|  |   | ||||||
|  |    *ret = true;                  /* Assume KVM is enabled. */ | ||||||
|  |   | ||||||
|  |    if (!json) | ||||||
|  |      return; | ||||||
|  |   | ||||||
|  | -  tree = json_loads (json, 0, &err);
 | ||||||
|  | -  if (tree == NULL) {
 | ||||||
|  | -    if (strlen (err.text) > 0)
 | ||||||
|  | -      debug (g, "QMP parse error: %s (ignored)", err.text);
 | ||||||
|  | -    else
 | ||||||
|  | -      debug (g, "QMP unknown parse error (ignored)");
 | ||||||
|  | +  tok = json_tokener_new ();
 | ||||||
|  | +  json_tokener_set_flags (tok,
 | ||||||
|  | +                          JSON_TOKENER_STRICT | JSON_TOKENER_VALIDATE_UTF8);
 | ||||||
|  | +  tree = json_tokener_parse_ex (tok, json, strlen (json));
 | ||||||
|  | +  err = json_tokener_get_error (tok);
 | ||||||
|  | +  if (err != json_tokener_success) {
 | ||||||
|  | +    debug (g, "QMP parse error: %s (ignored)", json_tokener_error_desc (err));
 | ||||||
|  | +    json_tokener_free (tok);
 | ||||||
|  |      return; | ||||||
|  |    } | ||||||
|  | +  json_tokener_free (tok);
 | ||||||
|  |   | ||||||
|  | -  return_node = json_object_get (tree, "return");
 | ||||||
|  | -  if (!json_is_object (return_node)) {
 | ||||||
|  | +  return_node = json_object_object_get (tree, "return");
 | ||||||
|  | +  if (json_object_get_type (return_node) != json_type_object) {
 | ||||||
|  |      debug (g, "QMP query-kvm: no \"return\" node (ignored)"); | ||||||
|  |      return; | ||||||
|  |    } | ||||||
|  | -  enabled_node = json_object_get (return_node, "enabled");
 | ||||||
|  | -  /* Note that json_is_boolean will check that enabled_node != NULL. */
 | ||||||
|  | -  if (!json_is_boolean (enabled_node)) {
 | ||||||
|  | -    debug (g, "QMP query-kvm: no \"enabled\" node or not a boolean (ignored)");
 | ||||||
|  | -    return;
 | ||||||
|  | -  }
 | ||||||
|  | -
 | ||||||
|  | -  *ret = json_is_true (enabled_node);
 | ||||||
|  | +  enabled_node = json_object_object_get (return_node, "enabled");
 | ||||||
|  | +  *ret = json_object_get_boolean (enabled_node);
 | ||||||
|  |  } | ||||||
|  |   | ||||||
|  |  /** | ||||||
|  | @@ -975,7 +978,7 @@ guestfs_int_free_qemu_data (struct qemu_data *data)
 | ||||||
|  |      free (data->qemu_devices); | ||||||
|  |      free (data->qmp_schema); | ||||||
|  |      free (data->query_kvm); | ||||||
|  | -    json_decref (data->qmp_schema_tree);
 | ||||||
|  | +    json_object_put (data->qmp_schema_tree);
 | ||||||
|  |      free (data); | ||||||
|  |    } | ||||||
|  |  } | ||||||
| @ -1,70 +0,0 @@ | |||||||
| From 25108090a1566bc49caab833fe1591a0c6f941be 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 |  | ||||||
							
								
								
									
										65
									
								
								SOURCES/0013-build-Remove-Jansson-dependency.patch
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										65
									
								
								SOURCES/0013-build-Remove-Jansson-dependency.patch
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,65 @@ | |||||||
|  | From 9255abee029e35dd5c6783b8b6037eb71104650c Mon Sep 17 00:00:00 2001 | ||||||
|  | From: "Richard W.M. Jones" <rjones@redhat.com> | ||||||
|  | Date: Tue, 22 Oct 2024 15:22:18 +0100 | ||||||
|  | Subject: [PATCH] build: Remove Jansson dependency | ||||||
|  | 
 | ||||||
|  | After previous changes, this library is no longer used.  We have | ||||||
|  | switched to json-c, for better compatibility with libvirt. | ||||||
|  | 
 | ||||||
|  | (cherry picked from | ||||||
|  | guestfs-tools commit e6dcf7e3a7e9170978e57ce6df1b34f92fac5ae3) | ||||||
|  | ---
 | ||||||
|  |  docs/guestfs-building.pod | 4 ---- | ||||||
|  |  lib/Makefile.am           | 2 -- | ||||||
|  |  m4/guestfs-libraries.m4   | 3 --- | ||||||
|  |  3 files changed, 9 deletions(-) | ||||||
|  | 
 | ||||||
|  | diff --git a/docs/guestfs-building.pod b/docs/guestfs-building.pod
 | ||||||
|  | index de175aaf..aef716ff 100644
 | ||||||
|  | --- a/docs/guestfs-building.pod
 | ||||||
|  | +++ b/docs/guestfs-building.pod
 | ||||||
|  | @@ -185,10 +185,6 @@ I<Required>.
 | ||||||
|  |   | ||||||
|  |  I<Required>. | ||||||
|  |   | ||||||
|  | -=item Jansson E<ge> 2.7
 | ||||||
|  | -
 | ||||||
|  | -I<Required>.
 | ||||||
|  | -
 | ||||||
|  |  =item json-c E<ge> 0.14 | ||||||
|  |   | ||||||
|  |  I<Required>. | ||||||
|  | diff --git a/lib/Makefile.am b/lib/Makefile.am
 | ||||||
|  | index 60567b04..6949884d 100644
 | ||||||
|  | --- a/lib/Makefile.am
 | ||||||
|  | +++ b/lib/Makefile.am
 | ||||||
|  | @@ -138,7 +138,6 @@ libguestfs_la_CFLAGS = \
 | ||||||
|  |  	$(PCRE2_CFLAGS) \ | ||||||
|  |  	$(LIBVIRT_CFLAGS) \ | ||||||
|  |  	$(LIBXML2_CFLAGS) \ | ||||||
|  | -	$(JANSSON_CFLAGS) \
 | ||||||
|  |  	$(JSON_C_CFLAGS) | ||||||
|  |   | ||||||
|  |  libguestfs_la_LIBADD = \ | ||||||
|  | @@ -150,7 +149,6 @@ libguestfs_la_LIBADD = \
 | ||||||
|  |  	$(PCRE2_LIBS) \ | ||||||
|  |  	$(LIBVIRT_LIBS) $(LIBXML2_LIBS) \ | ||||||
|  |  	$(SELINUX_LIBS) \ | ||||||
|  | -	$(JANSSON_LIBS) \
 | ||||||
|  |  	$(JSON_C_LIBS) \ | ||||||
|  |  	../gnulib/lib/libgnu.la \ | ||||||
|  |  	$(LIBSOCKET) \ | ||||||
|  | diff --git a/m4/guestfs-libraries.m4 b/m4/guestfs-libraries.m4
 | ||||||
|  | index ee406d27..51565171 100644
 | ||||||
|  | --- a/m4/guestfs-libraries.m4
 | ||||||
|  | +++ b/m4/guestfs-libraries.m4
 | ||||||
|  | @@ -301,9 +301,6 @@ LIBS="$LIBS $LIBXML2_LIBS"
 | ||||||
|  |  AC_CHECK_FUNCS([xmlBufferDetach]) | ||||||
|  |  LIBS="$old_LIBS" | ||||||
|  |   | ||||||
|  | -dnl Check for Jansson JSON library (required).
 | ||||||
|  | -PKG_CHECK_MODULES([JANSSON], [jansson >= 2.7])
 | ||||||
|  | -
 | ||||||
|  |  dnl Check for JSON-C library (required). | ||||||
|  |  PKG_CHECK_MODULES([JSON_C], [json-c >= 0.14]) | ||||||
|  |   | ||||||
| @ -1,28 +0,0 @@ | |||||||
| From 166e4e90eef0d4c81a92940e5d61450d70f00662 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) { |  | ||||||
| @ -1,73 +0,0 @@ | |||||||
| From c13dd5b6d4ca94eebe32bc32993f5be0b5b373ad 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,23 @@ | |||||||
|  | From a5cc27fc952ec213e82849d7c26f977a6321e0b1 Mon Sep 17 00:00:00 2001 | ||||||
|  | From: "Richard W.M. Jones" <rjones@redhat.com> | ||||||
|  | Date: Tue, 22 Oct 2024 17:44:06 +0100 | ||||||
|  | Subject: [PATCH] website: Fix link to latest development version | ||||||
|  | 
 | ||||||
|  | Fixes: commit 0edaea8f91bf08025651eeff32f53b9335003842 | ||||||
|  | ---
 | ||||||
|  |  website/index.html.in | 2 +- | ||||||
|  |  1 file changed, 1 insertion(+), 1 deletion(-) | ||||||
|  | 
 | ||||||
|  | diff --git a/website/index.html.in b/website/index.html.in
 | ||||||
|  | index 2a0d3221..13c5ff25 100644
 | ||||||
|  | --- a/website/index.html.in
 | ||||||
|  | +++ b/website/index.html.in
 | ||||||
|  | @@ -183,7 +183,7 @@ git clone <a href="https://github.com/libguestfs/libguestfs">https://github.com/
 | ||||||
|  |  <p class="latest"> | ||||||
|  |  <em><small> | ||||||
|  |    <!-- | ||||||
|  | -LATEST-URL: http://libguestfs.org/download/1.53-development/libguestfs-@PACKAGE_VERSION@.tar.gz
 | ||||||
|  | +LATEST-URL: http://libguestfs.org/download/1.55-development/libguestfs-@PACKAGE_VERSION@.tar.gz
 | ||||||
|  |  LATEST-VERSION: @PACKAGE_VERSION@ | ||||||
|  |    --> | ||||||
|  |    <a href="download/1.55-development/">Latest development version: <strong>@PACKAGE_VERSION@</strong></a> (released <strong>@RELEASE_DATE@</strong>).<br/> | ||||||
| @ -1,4 +1,4 @@ | |||||||
| From 66b9338e3d786db28fbd853d397741c3ceb19352 Mon Sep 17 00:00:00 2001 | From 1b6dd045a70a0d44631935f5c47f4a9b9e6a7ccc Mon Sep 17 00:00:00 2001 | ||||||
| From: "Richard W.M. Jones" <rjones@redhat.com> | From: "Richard W.M. Jones" <rjones@redhat.com> | ||||||
| Date: Mon, 29 Jul 2013 14:47:56 +0100 | Date: Mon, 29 Jul 2013 14:47:56 +0100 | ||||||
| Subject: [PATCH] RHEL: Disable unsupported remote drive protocols | Subject: [PATCH] RHEL: Disable unsupported remote drive protocols | ||||||
| @ -10,28 +10,23 @@ This disables support for unsupported remote drive protocols: | |||||||
|  * ftps |  * ftps | ||||||
|  * http |  * http | ||||||
|  * https |  * https | ||||||
|  * tftp |  | ||||||
|  * gluster |  | ||||||
|  * iscsi |  * iscsi | ||||||
|  * sheepdog |  | ||||||
|  * ssh |  * ssh | ||||||
| 
 | 
 | ||||||
| Note 'nbd' is not disabled, and of course 'file' works. | Note 'nbd' is not disabled, and of course 'file' works. | ||||||
| 
 |  | ||||||
| We hope to gradually add some of these back over the lifetime of RHEL. |  | ||||||
| ---
 | ---
 | ||||||
|  docs/guestfs-testing.pod               |  20 ----- |  docs/guestfs-testing.pod               |  20 ----- | ||||||
|  fish/guestfish.pod                     |  66 ++-------------- |  fish/guestfish.pod                     |  42 ++------- | ||||||
|  fish/test-add-uri.sh                   |  32 -------- |  fish/test-add-uri.sh                   |  21 ----- | ||||||
|  generator/actions_core.ml              |  50 +------------ |  generator/actions_core.ml              |  34 +------- | ||||||
|  lib/drives.c                           |   8 ++ |  lib/drives.c                           | 113 ------------------------- | ||||||
|  lib/guestfs.pod                        | 100 ------------------------- |  lib/guestfs.pod                        |  67 --------------- | ||||||
|  tests/disks/test-qemu-drive-libvirt.sh |  28 ------- |  tests/disks/test-qemu-drive-libvirt.sh |   7 -- | ||||||
|  tests/disks/test-qemu-drive.sh         |  60 --------------- |  tests/disks/test-qemu-drive.sh         |  40 --------- | ||||||
|  8 files changed, 16 insertions(+), 348 deletions(-) |  8 files changed, 8 insertions(+), 336 deletions(-) | ||||||
| 
 | 
 | ||||||
| diff --git a/docs/guestfs-testing.pod b/docs/guestfs-testing.pod
 | diff --git a/docs/guestfs-testing.pod b/docs/guestfs-testing.pod
 | ||||||
| index 47f381a7..c7b44928 100644
 | index f5c09df6..ee4b26d6 100644
 | ||||||
| --- a/docs/guestfs-testing.pod
 | --- a/docs/guestfs-testing.pod
 | ||||||
| +++ b/docs/guestfs-testing.pod
 | +++ b/docs/guestfs-testing.pod
 | ||||||
| @@ -109,26 +109,6 @@ image.  To exit, type C<exit>.
 | @@ -109,26 +109,6 @@ image.  To exit, type C<exit>.
 | ||||||
| @ -62,7 +57,7 @@ index 47f381a7..c7b44928 100644 | |||||||
|   |   | ||||||
|  Run L<virt-alignment-scan(1)> on guests or disk images: |  Run L<virt-alignment-scan(1)> on guests or disk images: | ||||||
| diff --git a/fish/guestfish.pod b/fish/guestfish.pod
 | diff --git a/fish/guestfish.pod b/fish/guestfish.pod
 | ||||||
| index ccc0825b..d36cac9d 100644
 | index da47c86d..33fc8b2c 100644
 | ||||||
| --- a/fish/guestfish.pod
 | --- a/fish/guestfish.pod
 | ||||||
| +++ b/fish/guestfish.pod
 | +++ b/fish/guestfish.pod
 | ||||||
| @@ -131,9 +131,9 @@ To list what is available do:
 | @@ -131,9 +131,9 @@ To list what is available do:
 | ||||||
| @ -92,7 +87,7 @@ index ccc0825b..d36cac9d 100644 | |||||||
|   |   | ||||||
|  The possible I<-a URI> formats are described below. |  The possible I<-a URI> formats are described below. | ||||||
|   |   | ||||||
| @@ -1144,40 +1144,6 @@ The possible I<-a URI> formats are described below.
 | @@ -1144,28 +1144,6 @@ The possible I<-a URI> formats are described below.
 | ||||||
|   |   | ||||||
|  Add the local disk image (or device) called F<disk.img>. |  Add the local disk image (or device) called F<disk.img>. | ||||||
|   |   | ||||||
| @ -104,24 +99,12 @@ index ccc0825b..d36cac9d 100644 | |||||||
| -
 | -
 | ||||||
| -=head2 B<-a https://[user@]example.com[:port]/disk.img>
 | -=head2 B<-a https://[user@]example.com[:port]/disk.img>
 | ||||||
| -
 | -
 | ||||||
| -=head2 B<-a tftp://[user@]example.com[:port]/disk.img>
 | -Add a disk located on a remote FTP or HTTP server.
 | ||||||
| -
 |  | ||||||
| -Add a disk located on a remote FTP, HTTP or TFTP server.
 |  | ||||||
| -
 | -
 | ||||||
| -The equivalent API command would be:
 | -The equivalent API command would be:
 | ||||||
| -
 | -
 | ||||||
| - ><fs> add /disk.img protocol:(ftp|...) server:tcp:example.com
 | - ><fs> add /disk.img protocol:(ftp|...) server:tcp:example.com
 | ||||||
| -
 | -
 | ||||||
| -=head2 B<-a gluster://example.com[:port]/volname/image>
 |  | ||||||
| -
 |  | ||||||
| -Add a disk image located on GlusterFS storage.
 |  | ||||||
| -
 |  | ||||||
| -The server is the one running C<glusterd>, and may be C<localhost>.
 |  | ||||||
| -
 |  | ||||||
| -The equivalent API command would be:
 |  | ||||||
| -
 |  | ||||||
| - ><fs> add volname/image protocol:gluster server:tcp:example.com
 |  | ||||||
| -
 |  | ||||||
| -=head2 B<-a iscsi://example.com[:port]/target-iqn-name[/lun]>
 | -=head2 B<-a iscsi://example.com[:port]/target-iqn-name[/lun]>
 | ||||||
| -
 | -
 | ||||||
| -Add a disk located on an iSCSI server.
 | -Add a disk located on an iSCSI server.
 | ||||||
| @ -133,22 +116,10 @@ index ccc0825b..d36cac9d 100644 | |||||||
|  =head2 B<-a nbd://example.com[:port]> |  =head2 B<-a nbd://example.com[:port]> | ||||||
|   |   | ||||||
|  =head2 B<-a nbd://example.com[:port]/exportname> |  =head2 B<-a nbd://example.com[:port]/exportname> | ||||||
| @@ -1212,35 +1178,13 @@ The equivalent API command would be:
 | @@ -1200,23 +1178,13 @@ The equivalent API command would be:
 | ||||||
|   |   | ||||||
|   ><fs> add pool/disk protocol:rbd server:tcp:example.com:port |   ><fs> add pool/disk protocol:rbd server:tcp:example.com:port | ||||||
|   |   | ||||||
| -=head2 B<-a sheepdog://[example.com[:port]]/volume/image>
 |  | ||||||
| -
 |  | ||||||
| -Add a disk image located on a Sheepdog volume.
 |  | ||||||
| -
 |  | ||||||
| -The server name is optional.  Although libguestfs and Sheepdog
 |  | ||||||
| -supports multiple servers, only at most one server can be specified
 |  | ||||||
| -when using this URI syntax.
 |  | ||||||
| -
 |  | ||||||
| -The equivalent API command would be:
 |  | ||||||
| -
 |  | ||||||
| - ><fs> add volume protocol:sheepdog [server:tcp:example.com]
 |  | ||||||
| -
 |  | ||||||
| -=head2 B<-a ssh://[user@]example.com[:port]/disk.img>
 | -=head2 B<-a ssh://[user@]example.com[:port]/disk.img>
 | ||||||
| -
 | -
 | ||||||
| -Add a disk image located on a remote server, accessed using the Secure
 | -Add a disk image located on a remote server, accessed using the Secure
 | ||||||
| @ -171,35 +142,24 @@ index ccc0825b..d36cac9d 100644 | |||||||
|  In this case, the password is C<pass@word>. |  In this case, the password is C<pass@word>. | ||||||
|   |   | ||||||
| diff --git a/fish/test-add-uri.sh b/fish/test-add-uri.sh
 | diff --git a/fish/test-add-uri.sh b/fish/test-add-uri.sh
 | ||||||
| index 21d42498..ddabeb63 100755
 | index 533a3ce0..ddabeb63 100755
 | ||||||
| --- a/fish/test-add-uri.sh
 | --- a/fish/test-add-uri.sh
 | ||||||
| +++ b/fish/test-add-uri.sh
 | +++ b/fish/test-add-uri.sh
 | ||||||
| @@ -40,14 +40,6 @@ function fail ()
 | @@ -40,10 +40,6 @@ function fail ()
 | ||||||
|  $VG guestfish -x -a file://$abs_builddir/test-add-uri.img </dev/null >test-add-uri.out 2>&1 |  $VG guestfish -x -a file://$abs_builddir/test-add-uri.img </dev/null >test-add-uri.out 2>&1 | ||||||
|  grep -sq 'add_drive ".*/test-add-uri.img"' test-add-uri.out || fail |  grep -sq 'add_drive ".*/test-add-uri.img"' test-add-uri.out || fail | ||||||
|   |   | ||||||
| -# curl
 | -# curl
 | ||||||
| -$VG guestfish -x -a ftp://user@example.com/disk.img </dev/null >test-add-uri.out 2>&1
 | -$VG guestfish -x -a ftp://user@example.com/disk.img </dev/null >test-add-uri.out 2>&1
 | ||||||
| -grep -sq 'add_drive "/disk.img" "protocol:ftp" "server:tcp:example.com" "username:user"' test-add-uri.out || fail
 | -grep -sq 'add_drive "/disk.img" "protocol:ftp" "server:tcp:example.com" "username:user"' test-add-uri.out || fail
 | ||||||
| -
 |  | ||||||
| -# gluster
 |  | ||||||
| -$VG guestfish -x -a gluster://example.com/disk </dev/null >test-add-uri.out 2>&1
 |  | ||||||
| -grep -sq 'add_drive "disk" "protocol:gluster" "server:tcp:example.com"' test-add-uri.out || fail
 |  | ||||||
| -
 | -
 | ||||||
|  # NBD |  # NBD | ||||||
|  $VG guestfish -x -a nbd://example.com </dev/null >test-add-uri.out 2>&1 |  $VG guestfish -x -a nbd://example.com </dev/null >test-add-uri.out 2>&1 | ||||||
|  grep -sq 'add_drive "" "protocol:nbd" "server:tcp:example.com"' test-add-uri.out || fail |  grep -sq 'add_drive "" "protocol:nbd" "server:tcp:example.com"' test-add-uri.out || fail | ||||||
| @@ -67,29 +59,5 @@ grep -sq 'add_drive "pool/disk" "protocol:rbd" "server:tcp:example.com:6789"' te
 | @@ -63,22 +59,5 @@ grep -sq 'add_drive "pool/disk" "protocol:rbd" "server:tcp:example.com:6789"' te
 | ||||||
|  $VG guestfish -x -a rbd:///pool/disk </dev/null >test-add-uri.out 2>&1 |  $VG guestfish -x -a rbd:///pool/disk </dev/null >test-add-uri.out 2>&1 | ||||||
|  grep -sq 'add_drive "pool/disk" "protocol:rbd"' test-add-uri.out || fail |  grep -sq 'add_drive "pool/disk" "protocol:rbd"' test-add-uri.out || fail | ||||||
|   |   | ||||||
| -# sheepdog
 |  | ||||||
| -$VG guestfish -x -a sheepdog:///volume/image </dev/null >test-add-uri.out 2>&1
 |  | ||||||
| -grep -sq 'add_drive "volume/image" "protocol:sheepdog"' test-add-uri.out || fail
 |  | ||||||
| -
 |  | ||||||
| -$VG guestfish -x -a sheepdog://example.com:3000/volume/image </dev/null >test-add-uri.out 2>&1
 |  | ||||||
| -grep -sq 'add_drive "volume/image" "protocol:sheepdog" "server:tcp:example.com:3000"' test-add-uri.out || fail
 |  | ||||||
| -
 |  | ||||||
| -# ssh
 | -# ssh
 | ||||||
| -$VG guestfish -x -a ssh://example.com/disk.img </dev/null >test-add-uri.out 2>&1
 | -$VG guestfish -x -a ssh://example.com/disk.img </dev/null >test-add-uri.out 2>&1
 | ||||||
| -grep -sq 'add_drive "/disk.img" "protocol:ssh" "server:tcp:example.com"' test-add-uri.out || fail
 | -grep -sq 'add_drive "/disk.img" "protocol:ssh" "server:tcp:example.com"' test-add-uri.out || fail
 | ||||||
| @ -220,26 +180,19 @@ index 21d42498..ddabeb63 100755 | |||||||
|  rm test-add-uri.out |  rm test-add-uri.out | ||||||
|  rm test-add-uri.img |  rm test-add-uri.img | ||||||
| diff --git a/generator/actions_core.ml b/generator/actions_core.ml
 | diff --git a/generator/actions_core.ml b/generator/actions_core.ml
 | ||||||
| index bfb43a19..314bb0ae 100644
 | index 20f6e843..768f5843 100644
 | ||||||
| --- a/generator/actions_core.ml
 | --- a/generator/actions_core.ml
 | ||||||
| +++ b/generator/actions_core.ml
 | +++ b/generator/actions_core.ml
 | ||||||
| @@ -350,29 +350,6 @@ F<filename> is interpreted as a local file or device.
 | @@ -350,22 +350,6 @@ F<filename> is interpreted as a local file or device.
 | ||||||
|  This is the default if the optional protocol parameter |  This is the default if the optional protocol parameter | ||||||
|  is omitted. |  is omitted. | ||||||
|   |   | ||||||
| -=item C<protocol = \"ftp\"|\"ftps\"|\"http\"|\"https\"|\"tftp\">
 | -=item C<protocol = \"ftp\"|\"ftps\"|\"http\"|\"https\">
 | ||||||
| -
 | -
 | ||||||
| -Connect to a remote FTP, HTTP or TFTP server.
 | -Connect to a remote FTP or HTTP server.
 | ||||||
| -The C<server> parameter must also be supplied - see below.
 | -The C<server> parameter must also be supplied - see below.
 | ||||||
| -
 | -
 | ||||||
| -See also: L<guestfs(3)/FTP, HTTP AND TFTP>
 | -See also: L<guestfs(3)/FTP AND HTTP>
 | ||||||
| -
 |  | ||||||
| -=item C<protocol = \"gluster\">
 |  | ||||||
| -
 |  | ||||||
| -Connect to the GlusterFS server.
 |  | ||||||
| -The C<server> parameter must also be supplied - see below.
 |  | ||||||
| -
 |  | ||||||
| -See also: L<guestfs(3)/GLUSTER>
 |  | ||||||
| -
 | -
 | ||||||
| -=item C<protocol = \"iscsi\">
 | -=item C<protocol = \"iscsi\">
 | ||||||
| -
 | -
 | ||||||
| @ -253,17 +206,10 @@ index bfb43a19..314bb0ae 100644 | |||||||
|  =item C<protocol = \"nbd\"> |  =item C<protocol = \"nbd\"> | ||||||
|   |   | ||||||
|  Connect to the Network Block Device server. |  Connect to the Network Block Device server. | ||||||
| @@ -389,22 +366,6 @@ The C<secret> parameter may be supplied.  See below.
 | @@ -382,15 +366,6 @@ The C<secret> parameter may be supplied.  See below.
 | ||||||
|   |   | ||||||
|  See also: L<guestfs(3)/CEPH>. |  See also: L<guestfs(3)/CEPH>. | ||||||
|   |   | ||||||
| -=item C<protocol = \"sheepdog\">
 |  | ||||||
| -
 |  | ||||||
| -Connect to the Sheepdog server.
 |  | ||||||
| -The C<server> parameter may also be supplied - see below.
 |  | ||||||
| -
 |  | ||||||
| -See also: L<guestfs(3)/SHEEPDOG>.
 |  | ||||||
| -
 |  | ||||||
| -=item C<protocol = \"ssh\">
 | -=item C<protocol = \"ssh\">
 | ||||||
| -
 | -
 | ||||||
| -Connect to the Secure Shell (ssh) server.
 | -Connect to the Secure Shell (ssh) server.
 | ||||||
| @ -276,26 +222,24 @@ index bfb43a19..314bb0ae 100644 | |||||||
|  =back |  =back | ||||||
|   |   | ||||||
|  =item C<server> |  =item C<server> | ||||||
| @@ -415,13 +376,8 @@ is a list of server(s).
 | @@ -401,11 +376,8 @@ is a list of server(s).
 | ||||||
|   Protocol       Number of servers required |   Protocol       Number of servers required | ||||||
|   --------       -------------------------- |   --------       -------------------------- | ||||||
|   file           List must be empty or param not used at all |   file           List must be empty or param not used at all | ||||||
| - ftp|ftps|http|https|tftp  Exactly one
 | - ftp|ftps|http|https  Exactly one
 | ||||||
| - gluster        Exactly one
 |  | ||||||
| - iscsi          Exactly one
 | - iscsi          Exactly one
 | ||||||
|   nbd            Exactly one |   nbd            Exactly one | ||||||
|   rbd            Zero or more |   rbd            Zero or more | ||||||
| - sheepdog       Zero or more
 |  | ||||||
| - ssh            Exactly one
 | - ssh            Exactly one
 | ||||||
|   |   | ||||||
|  Each list element is a string specifying a server.  The string must be |  Each list element is a string specifying a server.  The string must be | ||||||
|  in one of the following formats: |  in one of the following formats: | ||||||
| @@ -437,10 +393,10 @@ for the protocol is used (see F</etc/services>).
 | @@ -421,10 +393,10 @@ for the protocol is used (see F</etc/services>).
 | ||||||
|   |   | ||||||
|  =item C<username> |  =item C<username> | ||||||
|   |   | ||||||
| -For the C<ftp>, C<ftps>, C<http>, C<https>, C<iscsi>, C<rbd>, C<ssh>
 | -For the C<ftp>, C<ftps>, C<http>, C<https>, C<iscsi>, C<rbd> and C<ssh>
 | ||||||
| -and C<tftp> protocols, this specifies the remote username.
 | -protocols, this specifies the remote username.
 | ||||||
| +For the C<rbd>
 | +For the C<rbd>
 | ||||||
| +protocol, this specifies the remote username.
 | +protocol, this specifies the remote username.
 | ||||||
|   |   | ||||||
| @ -305,85 +249,162 @@ index bfb43a19..314bb0ae 100644 | |||||||
|  example if using the libvirt backend and if the libvirt backend is configured to |  example if using the libvirt backend and if the libvirt backend is configured to | ||||||
|  start the qemu appliance as a special user such as C<qemu.qemu>.  If in doubt, |  start the qemu appliance as a special user such as C<qemu.qemu>.  If in doubt, | ||||||
| diff --git a/lib/drives.c b/lib/drives.c
 | diff --git a/lib/drives.c b/lib/drives.c
 | ||||||
| index c5a20846..efb28925 100644
 | index c068b8ec..6e4453ce 100644
 | ||||||
| --- a/lib/drives.c
 | --- a/lib/drives.c
 | ||||||
| +++ b/lib/drives.c
 | +++ b/lib/drives.c
 | ||||||
| @@ -166,6 +166,7 @@ create_drive_non_file (guestfs_h *g,
 | @@ -166,34 +166,6 @@ create_drive_non_file (guestfs_h *g,
 | ||||||
|    return drv; |    return drv; | ||||||
|  } |  } | ||||||
|   |   | ||||||
| +#if 0 /* DISABLED IN RHEL 8 */
 | -static struct drive *
 | ||||||
|  static struct drive * | -create_drive_curl (guestfs_h *g,
 | ||||||
|  create_drive_curl (guestfs_h *g, | -                   const struct drive_create_data *data)
 | ||||||
|                     const struct drive_create_data *data) | -{
 | ||||||
| @@ -224,6 +225,7 @@ create_drive_gluster (guestfs_h *g,
 | -  if (data->nr_servers != 1) {
 | ||||||
|   | -    error (g, _("curl: you must specify exactly one server"));
 | ||||||
|    return create_drive_non_file (g, data); | -    return NULL;
 | ||||||
|  } | -  }
 | ||||||
| +#endif /* DISABLED IN RHEL 8 */
 | -
 | ||||||
|   | -  if (data->servers[0].transport != drive_transport_none &&
 | ||||||
|  | -      data->servers[0].transport != drive_transport_tcp) {
 | ||||||
|  | -    error (g, _("curl: only tcp transport is supported"));
 | ||||||
|  | -    return NULL;
 | ||||||
|  | -  }
 | ||||||
|  | -
 | ||||||
|  | -  if (STREQ (data->exportname, "")) {
 | ||||||
|  | -    error (g, _("curl: pathname should not be an empty string"));
 | ||||||
|  | -    return NULL;
 | ||||||
|  | -  }
 | ||||||
|  | -
 | ||||||
|  | -  if (data->exportname[0] != '/') {
 | ||||||
|  | -    error (g, _("curl: pathname must begin with a '/'"));
 | ||||||
|  | -    return NULL;
 | ||||||
|  | -  }
 | ||||||
|  | -
 | ||||||
|  | -  return create_drive_non_file (g, data);
 | ||||||
|  | -}
 | ||||||
|  | -
 | ||||||
|  static int |  static int | ||||||
|  nbd_port (void) |  nbd_port (void) | ||||||
| @@ -292,6 +294,7 @@ create_drive_rbd (guestfs_h *g,
 |  { | ||||||
|  | @@ -261,67 +233,6 @@ create_drive_rbd (guestfs_h *g,
 | ||||||
|    return create_drive_non_file (g, data); |    return create_drive_non_file (g, data); | ||||||
|  } |  } | ||||||
|   |   | ||||||
| +#if 0 /* DISABLED IN RHEL 8 */
 | -static struct drive *
 | ||||||
|  static struct drive * | -create_drive_ssh (guestfs_h *g,
 | ||||||
|  create_drive_sheepdog (guestfs_h *g, | -                  const struct drive_create_data *data)
 | ||||||
|                         const struct drive_create_data *data) | -{
 | ||||||
| @@ -392,6 +395,7 @@ create_drive_iscsi (guestfs_h *g,
 | -  if (data->nr_servers != 1) {
 | ||||||
|   | -    error (g, _("ssh: you must specify exactly one server"));
 | ||||||
|    return create_drive_non_file (g, data); | -    return NULL;
 | ||||||
|  } | -  }
 | ||||||
| +#endif /* DISABLED IN RHEL 8 */
 | -
 | ||||||
|   | -  if (data->servers[0].transport != drive_transport_none &&
 | ||||||
|  | -      data->servers[0].transport != drive_transport_tcp) {
 | ||||||
|  | -    error (g, _("ssh: only tcp transport is supported"));
 | ||||||
|  | -    return NULL;
 | ||||||
|  | -  }
 | ||||||
|  | -
 | ||||||
|  | -  if (STREQ (data->exportname, "")) {
 | ||||||
|  | -    error (g, _("ssh: pathname should not be an empty string"));
 | ||||||
|  | -    return NULL;
 | ||||||
|  | -  }
 | ||||||
|  | -
 | ||||||
|  | -  if (data->exportname[0] != '/') {
 | ||||||
|  | -    error (g, _("ssh: pathname must begin with a '/'"));
 | ||||||
|  | -    return NULL;
 | ||||||
|  | -  }
 | ||||||
|  | -
 | ||||||
|  | -  if (data->username && STREQ (data->username, "")) {
 | ||||||
|  | -    error (g, _("ssh: username should not be an empty string"));
 | ||||||
|  | -    return NULL;
 | ||||||
|  | -  }
 | ||||||
|  | -
 | ||||||
|  | -  return create_drive_non_file (g, data);
 | ||||||
|  | -}
 | ||||||
|  | -
 | ||||||
|  | -static struct drive *
 | ||||||
|  | -create_drive_iscsi (guestfs_h *g,
 | ||||||
|  | -                    const struct drive_create_data *data)
 | ||||||
|  | -{
 | ||||||
|  | -  if (data->nr_servers != 1) {
 | ||||||
|  | -    error (g, _("iscsi: you must specify exactly one server"));
 | ||||||
|  | -    return NULL;
 | ||||||
|  | -  }
 | ||||||
|  | -
 | ||||||
|  | -  if (data->servers[0].transport != drive_transport_none &&
 | ||||||
|  | -      data->servers[0].transport != drive_transport_tcp) {
 | ||||||
|  | -    error (g, _("iscsi: only tcp transport is supported"));
 | ||||||
|  | -    return NULL;
 | ||||||
|  | -  }
 | ||||||
|  | -
 | ||||||
|  | -  if (STREQ (data->exportname, "")) {
 | ||||||
|  | -    error (g, _("iscsi: target name should not be an empty string"));
 | ||||||
|  | -    return NULL;
 | ||||||
|  | -  }
 | ||||||
|  | -
 | ||||||
|  | -  if (data->exportname[0] == '/') {
 | ||||||
|  | -    error (g, _("iscsi: target string must not begin with a '/'"));
 | ||||||
|  | -    return NULL;
 | ||||||
|  | -  }
 | ||||||
|  | -
 | ||||||
|  | -  return create_drive_non_file (g, data);
 | ||||||
|  | -}
 | ||||||
|  | -
 | ||||||
|  /** |  /** | ||||||
|   * Create the special F</dev/null> drive. |   * Create the special F</dev/null> drive. | ||||||
| @@ -842,6 +846,7 @@ guestfs_impl_add_drive_opts (guestfs_h *g, const char *filename,
 |   * | ||||||
|  | @@ -768,26 +679,6 @@ guestfs_impl_add_drive_opts (guestfs_h *g, const char *filename,
 | ||||||
|        drv = create_drive_file (g, &data); |        drv = create_drive_file (g, &data); | ||||||
|      } |      } | ||||||
|    } |    } | ||||||
| +#if 0 /* DISABLED IN RHEL 8 */
 | -  else if (STREQ (protocol, "ftp")) {
 | ||||||
|    else if (STREQ (protocol, "ftp")) { | -    data.protocol = drive_protocol_ftp;
 | ||||||
|      data.protocol = drive_protocol_ftp; | -    drv = create_drive_curl (g, &data);
 | ||||||
|      drv = create_drive_curl (g, &data); | -  }
 | ||||||
| @@ -866,6 +871,7 @@ guestfs_impl_add_drive_opts (guestfs_h *g, const char *filename,
 | -  else if (STREQ (protocol, "ftps")) {
 | ||||||
|      data.protocol = drive_protocol_iscsi; | -    data.protocol = drive_protocol_ftps;
 | ||||||
|      drv = create_drive_iscsi (g, &data); | -    drv = create_drive_curl (g, &data);
 | ||||||
|    } | -  }
 | ||||||
| +#endif /* DISABLED IN RHEL 8 */
 | -  else if (STREQ (protocol, "http")) {
 | ||||||
|  | -    data.protocol = drive_protocol_http;
 | ||||||
|  | -    drv = create_drive_curl (g, &data);
 | ||||||
|  | -  }
 | ||||||
|  | -  else if (STREQ (protocol, "https")) {
 | ||||||
|  | -    data.protocol = drive_protocol_https;
 | ||||||
|  | -    drv = create_drive_curl (g, &data);
 | ||||||
|  | -  }
 | ||||||
|  | -  else if (STREQ (protocol, "iscsi")) {
 | ||||||
|  | -    data.protocol = drive_protocol_iscsi;
 | ||||||
|  | -    drv = create_drive_iscsi (g, &data);
 | ||||||
|  | -  }
 | ||||||
|    else if (STREQ (protocol, "nbd")) { |    else if (STREQ (protocol, "nbd")) { | ||||||
|      data.protocol = drive_protocol_nbd; |      data.protocol = drive_protocol_nbd; | ||||||
|      drv = create_drive_nbd (g, &data); |      drv = create_drive_nbd (g, &data); | ||||||
| @@ -874,6 +880,7 @@ guestfs_impl_add_drive_opts (guestfs_h *g, const char *filename,
 | @@ -796,10 +687,6 @@ guestfs_impl_add_drive_opts (guestfs_h *g, const char *filename,
 | ||||||
|      data.protocol = drive_protocol_rbd; |      data.protocol = drive_protocol_rbd; | ||||||
|      drv = create_drive_rbd (g, &data); |      drv = create_drive_rbd (g, &data); | ||||||
|    } |    } | ||||||
| +#if 0 /* DISABLED IN RHEL 8 */
 | -  else if (STREQ (protocol, "ssh")) {
 | ||||||
|    else if (STREQ (protocol, "sheepdog")) { | -    data.protocol = drive_protocol_ssh;
 | ||||||
|      data.protocol = drive_protocol_sheepdog; | -    drv = create_drive_ssh (g, &data);
 | ||||||
|      drv = create_drive_sheepdog (g, &data); | -  }
 | ||||||
| @@ -886,6 +893,7 @@ guestfs_impl_add_drive_opts (guestfs_h *g, const char *filename,
 |  | ||||||
|      data.protocol = drive_protocol_tftp; |  | ||||||
|      drv = create_drive_curl (g, &data); |  | ||||||
|    } |  | ||||||
| +#endif /* DISABLED IN RHEL 8 */
 |  | ||||||
|    else { |    else { | ||||||
|      error (g, _("unknown protocol ‘%s’"), protocol); |      error (g, _("unknown protocol ‘%s’"), protocol); | ||||||
|      drv = NULL; /*FALLTHROUGH*/ |      drv = NULL; /*FALLTHROUGH*/ | ||||||
| diff --git a/lib/guestfs.pod b/lib/guestfs.pod
 | diff --git a/lib/guestfs.pod b/lib/guestfs.pod
 | ||||||
| index c6c8cb16..866a4638 100644
 | index ecab0e1f..dff32cc9 100644
 | ||||||
| --- a/lib/guestfs.pod
 | --- a/lib/guestfs.pod
 | ||||||
| +++ b/lib/guestfs.pod
 | +++ b/lib/guestfs.pod
 | ||||||
| @@ -723,70 +723,6 @@ a qcow2 backing file specification, libvirt does not construct an
 | @@ -723,51 +723,6 @@ a qcow2 backing file specification, libvirt does not construct an
 | ||||||
|  ephemeral secret object from those, for Ceph authentication.  Refer to |  ephemeral secret object from those, for Ceph authentication.  Refer to | ||||||
|  L<https://bugzilla.redhat.com/2033247>. |  L<https://bugzilla.redhat.com/2033247>. | ||||||
|   |   | ||||||
| -=head3 FTP, HTTP AND TFTP
 | -=head3 FTP AND HTTP
 | ||||||
| -
 | -
 | ||||||
| -Libguestfs can access remote disks over FTP, FTPS, HTTP, HTTPS
 | -Libguestfs can access remote disks over FTP, FTPS, HTTP or HTTPS
 | ||||||
| -or TFTP protocols.
 | -protocols.
 | ||||||
| -
 | -
 | ||||||
| -To do this, set the optional C<protocol> and C<server> parameters of
 | -To do this, set the optional C<protocol> and C<server> parameters of
 | ||||||
| -L</guestfs_add_drive_opts> like this:
 | -L</guestfs_add_drive_opts> like this:
 | ||||||
| @ -396,35 +417,16 @@ index c6c8cb16..866a4638 100644 | |||||||
| -                         -1);
 | -                         -1);
 | ||||||
| -
 | -
 | ||||||
| -The C<protocol> can be one of C<"ftp">, C<"ftps">, C<"http">,
 | -The C<protocol> can be one of C<"ftp">, C<"ftps">, C<"http">,
 | ||||||
| -C<"https"> or C<"tftp">.
 | -or C<"https">.
 | ||||||
| -
 | -
 | ||||||
| -C<servers> (the C<server> parameter) is a list which must have a
 | -C<servers> (the C<server> parameter) is a list which must have a
 | ||||||
| -single element.  The single element is a string defining the web,
 | -single element.  The single element is a string defining the web
 | ||||||
| -FTP or TFTP server.  The format of this string is documented in
 | -or FTP server.  The format of this string is documented in
 | ||||||
| -L</guestfs_add_drive_opts>.
 | -L</guestfs_add_drive_opts>.
 | ||||||
| -
 | -
 | ||||||
| -=head3 GLUSTER
 | -=head3 GLUSTER
 | ||||||
| -
 | -
 | ||||||
| -Libguestfs can access Gluster disks.
 | -Glusterfs support was removed in libguestfs 1.54 (2024).
 | ||||||
| -
 |  | ||||||
| -To do this, set the optional C<protocol> and C<server> parameters of
 |  | ||||||
| -L</guestfs_add_drive_opts> like this:
 |  | ||||||
| -
 |  | ||||||
| - char **servers = { "gluster.example.org:24007", NULL };
 |  | ||||||
| - guestfs_add_drive_opts (g, "volname/image",
 |  | ||||||
| -                         GUESTFS_ADD_DRIVE_OPTS_FORMAT, "raw",
 |  | ||||||
| -                         GUESTFS_ADD_DRIVE_OPTS_PROTOCOL, "gluster",
 |  | ||||||
| -                         GUESTFS_ADD_DRIVE_OPTS_SERVER, servers,
 |  | ||||||
| -                         -1);
 |  | ||||||
| -
 |  | ||||||
| -C<servers> (the C<server> parameter) is a list which must have a
 |  | ||||||
| -single element.  The single element is a string defining the Gluster
 |  | ||||||
| -server.  The format of this string is documented in
 |  | ||||||
| -L</guestfs_add_drive_opts>.
 |  | ||||||
| -
 |  | ||||||
| -Note that gluster usually requires the client process (ie. libguestfs)
 |  | ||||||
| -to run as B<root> and will give unfathomable errors if it is not
 |  | ||||||
| -(eg. "No data available").
 |  | ||||||
| -
 | -
 | ||||||
| -=head3 ISCSI
 | -=head3 ISCSI
 | ||||||
| -
 | -
 | ||||||
| @ -447,27 +449,13 @@ index c6c8cb16..866a4638 100644 | |||||||
|  =head3 NETWORK BLOCK DEVICE |  =head3 NETWORK BLOCK DEVICE | ||||||
|   |   | ||||||
|  Libguestfs can access Network Block Device (NBD) disks remotely. |  Libguestfs can access Network Block Device (NBD) disks remotely. | ||||||
| @@ -849,42 +785,6 @@ L<https://bugs.launchpad.net/qemu/+bug/1155677>
 | @@ -830,28 +785,6 @@ L<https://bugs.launchpad.net/qemu/+bug/1155677>
 | ||||||
|   |   | ||||||
|  =back |  =back | ||||||
|   |   | ||||||
| -=head3 SHEEPDOG
 | -=head3 SHEEPDOG
 | ||||||
| -
 | -
 | ||||||
| -Libguestfs can access Sheepdog disks.
 | -Sheepdog support was removed in libguestfs 1.54 (2024).
 | ||||||
| -
 |  | ||||||
| -To do this, set the optional C<protocol> and C<server> parameters of
 |  | ||||||
| -L</guestfs_add_drive_opts> like this:
 |  | ||||||
| -
 |  | ||||||
| - char **servers = { /* optional servers ... */ NULL };
 |  | ||||||
| - guestfs_add_drive_opts (g, "volume",
 |  | ||||||
| -                         GUESTFS_ADD_DRIVE_OPTS_FORMAT, "raw",
 |  | ||||||
| -                         GUESTFS_ADD_DRIVE_OPTS_PROTOCOL, "sheepdog",
 |  | ||||||
| -                         GUESTFS_ADD_DRIVE_OPTS_SERVER, servers,
 |  | ||||||
| -                         -1);
 |  | ||||||
| -
 |  | ||||||
| -The optional list of C<servers> may be zero or more server addresses
 |  | ||||||
| -(C<"hostname:port">).  The format of the server strings is documented
 |  | ||||||
| -in L</guestfs_add_drive_opts>.
 |  | ||||||
| -
 | -
 | ||||||
| -=head3 SSH
 | -=head3 SSH
 | ||||||
| -
 | -
 | ||||||
| @ -491,20 +479,13 @@ index c6c8cb16..866a4638 100644 | |||||||
|   |   | ||||||
|  Libguestfs has APIs for inspecting an unknown disk image to find out |  Libguestfs has APIs for inspecting an unknown disk image to find out | ||||||
| diff --git a/tests/disks/test-qemu-drive-libvirt.sh b/tests/disks/test-qemu-drive-libvirt.sh
 | diff --git a/tests/disks/test-qemu-drive-libvirt.sh b/tests/disks/test-qemu-drive-libvirt.sh
 | ||||||
| index d86a1ecd..cf7d2a0c 100755
 | index afbeddec..93df4be0 100755
 | ||||||
| --- a/tests/disks/test-qemu-drive-libvirt.sh
 | --- a/tests/disks/test-qemu-drive-libvirt.sh
 | ||||||
| +++ b/tests/disks/test-qemu-drive-libvirt.sh
 | +++ b/tests/disks/test-qemu-drive-libvirt.sh
 | ||||||
| @@ -65,34 +65,6 @@ check_output
 | @@ -65,13 +65,6 @@ check_output
 | ||||||
|  grep -sq -- '-drive file=rbd:abc-def/ghi-jkl:auth_supported=none,' "$DEBUG_QEMU_FILE" || fail ceph2 |  grep -sq -- '-drive file=rbd:abc-def/ghi-jkl:auth_supported=none,' "$DEBUG_QEMU_FILE" || fail ceph2 | ||||||
|  rm "$DEBUG_QEMU_FILE" |  rm "$DEBUG_QEMU_FILE" | ||||||
|   |   | ||||||
| -# Gluster.
 |  | ||||||
| -
 |  | ||||||
| -$guestfish -d gluster run ||:
 |  | ||||||
| -check_output
 |  | ||||||
| -grep -sq -- '-drive file=gluster://1.2.3.4:1234/volname/image,' "$DEBUG_QEMU_FILE" || fail gluster
 |  | ||||||
| -rm "$DEBUG_QEMU_FILE"
 |  | ||||||
| -
 |  | ||||||
| -# iSCSI.
 | -# iSCSI.
 | ||||||
| -
 | -
 | ||||||
| -$guestfish -d iscsi run ||:
 | -$guestfish -d iscsi run ||:
 | ||||||
| @ -512,28 +493,14 @@ index d86a1ecd..cf7d2a0c 100755 | |||||||
| -grep -sq -- '-drive file=iscsi://1.2.3.4:1234/iqn.2003-01.org.linux-iscsi.fedora' "$DEBUG_QEMU_FILE" || fail iscsi
 | -grep -sq -- '-drive file=iscsi://1.2.3.4:1234/iqn.2003-01.org.linux-iscsi.fedora' "$DEBUG_QEMU_FILE" || fail iscsi
 | ||||||
| -rm "$DEBUG_QEMU_FILE"
 | -rm "$DEBUG_QEMU_FILE"
 | ||||||
| -
 | -
 | ||||||
| -# NBD.
 |  # NBD. | ||||||
| -
 |  | ||||||
| -$guestfish -d nbd run ||:
 |  | ||||||
| -check_output
 |  | ||||||
| -grep -sq -- '-drive file=nbd:1.2.3.4:1234,' "$DEBUG_QEMU_FILE" || fail nbd
 |  | ||||||
| -rm "$DEBUG_QEMU_FILE"
 |  | ||||||
| -
 |  | ||||||
| -# Sheepdog.
 |  | ||||||
| -
 |  | ||||||
| -$guestfish -d sheepdog run ||:
 |  | ||||||
| -check_output
 |  | ||||||
| -grep -sq -- '-drive file=sheepdog:volume,' "$DEBUG_QEMU_FILE" || fail sheepdog
 |  | ||||||
| -rm "$DEBUG_QEMU_FILE"
 |  | ||||||
| -
 |  | ||||||
|  # Local, stored in a pool. |  | ||||||
|   |   | ||||||
|  $guestfish -d pool1 run ||: |  $guestfish -d nbd run ||: | ||||||
| diff --git a/tests/disks/test-qemu-drive.sh b/tests/disks/test-qemu-drive.sh
 | diff --git a/tests/disks/test-qemu-drive.sh b/tests/disks/test-qemu-drive.sh
 | ||||||
| index 12937fb3..b3e4f990 100755
 | index 9ee7df38..b3e4f990 100755
 | ||||||
| --- a/tests/disks/test-qemu-drive.sh
 | --- a/tests/disks/test-qemu-drive.sh
 | ||||||
| +++ b/tests/disks/test-qemu-drive.sh
 | +++ b/tests/disks/test-qemu-drive.sh
 | ||||||
| @@ -62,45 +62,6 @@ check_output
 | @@ -62,35 +62,6 @@ check_output
 | ||||||
|  grep -sq -- '-drive file=rbd:abc-def/ghi-jkl:auth_supported=none,' "$DEBUG_QEMU_FILE" || fail |  grep -sq -- '-drive file=rbd:abc-def/ghi-jkl:auth_supported=none,' "$DEBUG_QEMU_FILE" || fail | ||||||
|  rm "$DEBUG_QEMU_FILE" |  rm "$DEBUG_QEMU_FILE" | ||||||
|   |   | ||||||
| @ -547,16 +514,6 @@ index 12937fb3..b3e4f990 100755 | |||||||
| -grep -sq -- '-drive file=http://www.example.com/disk.img,' "$DEBUG_QEMU_FILE" || fail
 | -grep -sq -- '-drive file=http://www.example.com/disk.img,' "$DEBUG_QEMU_FILE" || fail
 | ||||||
| -rm "$DEBUG_QEMU_FILE"
 | -rm "$DEBUG_QEMU_FILE"
 | ||||||
| -
 | -
 | ||||||
| -# Gluster.
 |  | ||||||
| -
 |  | ||||||
| -guestfish <<EOF ||:
 |  | ||||||
| -  add "volname/image" "format:raw" "protocol:gluster" "server:www.example.com:24007"
 |  | ||||||
| -  run
 |  | ||||||
| -EOF
 |  | ||||||
| -check_output
 |  | ||||||
| -grep -sq -- '-drive file=gluster://www.example.com:24007/volname/image,' "$DEBUG_QEMU_FILE" || fail
 |  | ||||||
| -rm "$DEBUG_QEMU_FILE"
 |  | ||||||
| -
 |  | ||||||
| -# iSCSI.
 | -# iSCSI.
 | ||||||
| -
 | -
 | ||||||
| -guestfish <<EOF ||:
 | -guestfish <<EOF ||:
 | ||||||
| @ -579,21 +536,11 @@ index 12937fb3..b3e4f990 100755 | |||||||
|  # NBD. |  # NBD. | ||||||
|   |   | ||||||
|  guestfish <<EOF ||: |  guestfish <<EOF ||: | ||||||
| @@ -118,24 +79,3 @@ EOF
 | @@ -108,14 +79,3 @@ EOF
 | ||||||
|  check_output |  check_output | ||||||
|  grep -sq -- '-drive file=nbd:unix:/socket,' "$DEBUG_QEMU_FILE" || fail |  grep -sq -- '-drive file=nbd:unix:/socket,' "$DEBUG_QEMU_FILE" || fail | ||||||
|  rm "$DEBUG_QEMU_FILE" |  rm "$DEBUG_QEMU_FILE" | ||||||
| -
 | -
 | ||||||
| -# Sheepdog.
 |  | ||||||
| -
 |  | ||||||
| -guestfish <<EOF ||:
 |  | ||||||
| -  add "volume" "format:raw" "protocol:sheepdog"
 |  | ||||||
| -  run
 |  | ||||||
| -EOF
 |  | ||||||
| -check_output
 |  | ||||||
| -grep -sq -- '-drive file=sheepdog:volume,' "$DEBUG_QEMU_FILE" || fail
 |  | ||||||
| -rm "$DEBUG_QEMU_FILE"
 |  | ||||||
| -
 |  | ||||||
| -# SSH.
 | -# SSH.
 | ||||||
| -
 | -
 | ||||||
| -guestfish <<EOF ||:
 | -guestfish <<EOF ||:
 | ||||||
| @ -1,59 +0,0 @@ | |||||||
| From b6c9d4624899f4d81cc8d64d47ecef60aad8dd94 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 ()
 |  | ||||||
| @ -1,4 +1,4 @@ | |||||||
| From b875668bfa9f596aba2e84999c7c9921f8dcb55e Mon Sep 17 00:00:00 2001 | From 0212c0fe22d0da787ca906d32d31f8b6d3e3ae3f Mon Sep 17 00:00:00 2001 | ||||||
| From: "Richard W.M. Jones" <rjones@redhat.com> | From: "Richard W.M. Jones" <rjones@redhat.com> | ||||||
| Date: Tue, 7 Jul 2015 09:28:03 -0400 | Date: Tue, 7 Jul 2015 09:28:03 -0400 | ||||||
| Subject: [PATCH] RHEL: Reject use of libguestfs-winsupport features except for | Subject: [PATCH] RHEL: Reject use of libguestfs-winsupport features except for | ||||||
| @ -13,14 +13,14 @@ edits. | |||||||
|  3 files changed, 19 insertions(+) |  3 files changed, 19 insertions(+) | ||||||
| 
 | 
 | ||||||
| diff --git a/generator/c.ml b/generator/c.ml
 | diff --git a/generator/c.ml b/generator/c.ml
 | ||||||
| index 447059b8..0391dd3d 100644
 | index 838e7f42..09181028 100644
 | ||||||
| --- a/generator/c.ml
 | --- a/generator/c.ml
 | ||||||
| +++ b/generator/c.ml
 | +++ b/generator/c.ml
 | ||||||
| @@ -1846,6 +1846,22 @@ and generate_client_actions actions () =
 | @@ -1836,6 +1836,22 @@ and generate_client_actions actions () =
 | ||||||
|      check_args_validity c_name style; |      check_args_validity c_name style; | ||||||
|      trace_call name c_name style; |      trace_call name c_name style; | ||||||
|   |   | ||||||
| +    (* RHEL 8 *)
 | +    (* RHEL *)
 | ||||||
| +    if name = "mount" || name = "mount_ro" || name = "mount_options" ||
 | +    if name = "mount" || name = "mount_ro" || name = "mount_options" ||
 | ||||||
| +       name = "mount_vfs" then (
 | +       name = "mount_vfs" then (
 | ||||||
| +      pr "  if (g->program && !STRPREFIX (g->program, \"virt-\")) {\n";
 | +      pr "  if (g->program && !STRPREFIX (g->program, \"virt-\")) {\n";
 | ||||||
| @ -1,25 +0,0 @@ | |||||||
| From ff62b8f758e16aab82960474c79a7fc10a0af3ed 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 |  | ||||||
| @ -1,4 +1,4 @@ | |||||||
| From d8142f0dc4c422b7ea372d1291807bf7492c1662 Mon Sep 17 00:00:00 2001 | From 42ae34115f1e6bff2b501d8ff3ab9ac26c892a22 Mon Sep 17 00:00:00 2001 | ||||||
| From: "Richard W.M. Jones" <rjones@redhat.com> | From: "Richard W.M. Jones" <rjones@redhat.com> | ||||||
| Date: Wed, 19 Feb 2025 11:11:24 +0000 | Date: Wed, 19 Feb 2025 11:11:24 +0000 | ||||||
| Subject: [PATCH] daemon: New command_out and sh_out APIs | Subject: [PATCH] daemon: New command_out and sh_out APIs | ||||||
| @ -9,7 +9,6 @@ generate more output than the protocol limit allows. | |||||||
| Thanks: Nijin Ashok | Thanks: Nijin Ashok | ||||||
| Fixes: https://issues.redhat.com/browse/RHEL-80159 | Fixes: https://issues.redhat.com/browse/RHEL-80159 | ||||||
| (cherry picked from commit 47ac4871b2c1dcde317d116c52b13916ab368ea4) | (cherry picked from commit 47ac4871b2c1dcde317d116c52b13916ab368ea4) | ||||||
| (cherry picked from commit 42ae34115f1e6bff2b501d8ff3ab9ac26c892a22) |  | ||||||
| ---
 | ---
 | ||||||
|  .gitignore                                |  1 + |  .gitignore                                |  1 + | ||||||
|  daemon/sh.c                               | 42 +++++++++++++ |  daemon/sh.c                               | 42 +++++++++++++ | ||||||
| @ -24,10 +23,10 @@ Fixes: https://issues.redhat.com/browse/RHEL-80159 | |||||||
|  create mode 100755 tests/large-command/test-large-command.sh |  create mode 100755 tests/large-command/test-large-command.sh | ||||||
| 
 | 
 | ||||||
| diff --git a/.gitignore b/.gitignore
 | diff --git a/.gitignore b/.gitignore
 | ||||||
| index 00e59fb3..73a561c2 100644
 | index 2fc52e84..68b27c79 100644
 | ||||||
| --- a/.gitignore
 | --- a/.gitignore
 | ||||||
| +++ b/.gitignore
 | +++ b/.gitignore
 | ||||||
| @@ -422,6 +422,7 @@ Makefile.in
 | @@ -423,6 +423,7 @@ Makefile.in
 | ||||||
|  /tests/disks/test-add-disks |  /tests/disks/test-add-disks | ||||||
|  /tests/disks/test-qemu-drive-libvirt.xml |  /tests/disks/test-qemu-drive-libvirt.xml | ||||||
|  /tests/events/test-libvirt-auth-callbacks |  /tests/events/test-libvirt-auth-callbacks | ||||||
| @ -36,10 +35,10 @@ index 00e59fb3..73a561c2 100644 | |||||||
|  /tests/mountable/test-internal-parse-mountable |  /tests/mountable/test-internal-parse-mountable | ||||||
|  /tests/parallel/test-parallel |  /tests/parallel/test-parallel | ||||||
| diff --git a/daemon/sh.c b/daemon/sh.c
 | diff --git a/daemon/sh.c b/daemon/sh.c
 | ||||||
| index 92ce08be..c8fdf0bf 100644
 | index 21d4deea..f8440c1d 100644
 | ||||||
| --- a/daemon/sh.c
 | --- a/daemon/sh.c
 | ||||||
| +++ b/daemon/sh.c
 | +++ b/daemon/sh.c
 | ||||||
| @@ -299,6 +299,40 @@ do_command_lines (char *const *argv)
 | @@ -294,6 +294,40 @@ do_command_lines (char *const *argv)
 | ||||||
|    return lines;			/* Caller frees. */ |    return lines;			/* Caller frees. */ | ||||||
|  } |  } | ||||||
|   |   | ||||||
| @ -80,7 +79,7 @@ index 92ce08be..c8fdf0bf 100644 | |||||||
|  char * |  char * | ||||||
|  do_sh (const char *cmd) |  do_sh (const char *cmd) | ||||||
|  { |  { | ||||||
| @@ -314,3 +348,11 @@ do_sh_lines (const char *cmd)
 | @@ -309,3 +343,11 @@ do_sh_lines (const char *cmd)
 | ||||||
|   |   | ||||||
|    return do_command_lines ((char **) argv); |    return do_command_lines ((char **) argv); | ||||||
|  } |  } | ||||||
| @ -93,7 +92,7 @@ index 92ce08be..c8fdf0bf 100644 | |||||||
| +  return do_command_out ((char **) argv);
 | +  return do_command_out ((char **) argv);
 | ||||||
| +}
 | +}
 | ||||||
| diff --git a/generator/actions_core.ml b/generator/actions_core.ml
 | diff --git a/generator/actions_core.ml b/generator/actions_core.ml
 | ||||||
| index c3afe810..60c4b577 100644
 | index 768f5843..eb047b6b 100644
 | ||||||
| --- a/generator/actions_core.ml
 | --- a/generator/actions_core.ml
 | ||||||
| +++ b/generator/actions_core.ml
 | +++ b/generator/actions_core.ml
 | ||||||
| @@ -2352,6 +2352,19 @@ result into a list of lines.
 | @@ -2352,6 +2352,19 @@ result into a list of lines.
 | ||||||
| @ -116,7 +115,7 @@ index c3afe810..60c4b577 100644 | |||||||
|    { defaults with |    { defaults with | ||||||
|      name = "statvfs"; added = (1, 9, 2); |      name = "statvfs"; added = (1, 9, 2); | ||||||
|      style = RStruct ("statbuf", "statvfs"), [String (Pathname, "path")], []; |      style = RStruct ("statbuf", "statvfs"), [String (Pathname, "path")], []; | ||||||
| @@ -3454,6 +3467,18 @@ into a list of lines.
 | @@ -3461,6 +3474,18 @@ into a list of lines.
 | ||||||
|   |   | ||||||
|  See also: C<guestfs_command_lines>" }; |  See also: C<guestfs_command_lines>" }; | ||||||
|   |   | ||||||
| @ -156,7 +155,7 @@ index 3cda32fc..ac953cd0 100644 | |||||||
| -515
 | -515
 | ||||||
| +517
 | +517
 | ||||||
| diff --git a/tests/Makefile.am b/tests/Makefile.am
 | diff --git a/tests/Makefile.am b/tests/Makefile.am
 | ||||||
| index b87d4ce2..9ad3cd1d 100644
 | index 52155f64..f23fb6e9 100644
 | ||||||
| --- a/tests/Makefile.am
 | --- a/tests/Makefile.am
 | ||||||
| +++ b/tests/Makefile.am
 | +++ b/tests/Makefile.am
 | ||||||
| @@ -440,6 +440,16 @@ EXTRA_DIST += http/test-http.py
 | @@ -440,6 +440,16 @@ EXTRA_DIST += http/test-http.py
 | ||||||
| @ -1,398 +0,0 @@ | |||||||
| From 0be1035c710d95aeca68a10fe9a7b4b740ae7aff Mon Sep 17 00:00:00 2001 |  | ||||||
| From: "Richard W.M. Jones" <rjones@redhat.com> |  | ||||||
| Date: Thu, 29 Jun 2023 13:33:04 +0100 |  | ||||||
| Subject: [PATCH] generator: Add --chown option for virt-customize |  | ||||||
| 
 |  | ||||||
| Also this updates the common submodule to include the changes. |  | ||||||
| 
 |  | ||||||
| Fixes: https://github.com/rwmjones/guestfs-tools/issues/12 |  | ||||||
| Acked-by: Laszlo Ersek <lersek@redhat.com> |  | ||||||
| (cherry picked from commit d8e48bff212f9b0558480ffedf8158157360d0d5) |  | ||||||
| ---
 |  | ||||||
|  common                 |  2 +- |  | ||||||
|  generator/customize.ml | 28 ++++++++++++++++++++++++++++ |  | ||||||
|  2 files changed, 29 insertions(+), 1 deletion(-) |  | ||||||
| 
 |  | ||||||
| Submodule common d61cd820..bbb54714: |  | ||||||
| diff --git a/common/mlcustomize/customize-options.pod b/common/mlcustomize/customize-options.pod
 |  | ||||||
| index 22a96e04..22724600 100644
 |  | ||||||
| --- a/common/mlcustomize/customize-options.pod
 |  | ||||||
| +++ b/common/mlcustomize/customize-options.pod
 |  | ||||||
| @@ -63,6 +63,30 @@ Change the permissions of C<FILE> to C<PERMISSIONS>.
 |  | ||||||
|  I<Note>: C<PERMISSIONS> by default would be decimal, unless you prefix |  | ||||||
|  it with C<0> to get octal, ie. use C<0700> not C<700>. |  | ||||||
|   |  | ||||||
| +=item B<--chown> UID.GID:PATH
 |  | ||||||
| +
 |  | ||||||
| +Change the owner user and group ID of a file or directory in the guest.
 |  | ||||||
| +Note:
 |  | ||||||
| +
 |  | ||||||
| +=over 4
 |  | ||||||
| +
 |  | ||||||
| +=item *
 |  | ||||||
| +
 |  | ||||||
| +Only numeric UIDs and GIDs will work, and these may not be the same
 |  | ||||||
| +inside the guest as on the host.
 |  | ||||||
| +
 |  | ||||||
| +=item *
 |  | ||||||
| +
 |  | ||||||
| +This will not work with Windows guests.
 |  | ||||||
| +
 |  | ||||||
| +=back
 |  | ||||||
| +
 |  | ||||||
| +For example:
 |  | ||||||
| +
 |  | ||||||
| + virt-customize --chown '0.0:/var/log/audit.log'
 |  | ||||||
| +
 |  | ||||||
| +See also: I<--upload>.
 |  | ||||||
| +
 |  | ||||||
|  =item B<--commands-from-file> FILENAME |  | ||||||
|   |  | ||||||
|  Read the customize commands from a file, one (and its arguments) |  | ||||||
| diff --git a/common/mlcustomize/customize-synopsis.pod b/common/mlcustomize/customize-synopsis.pod
 |  | ||||||
| index d04f421e..e20b12d4 100644
 |  | ||||||
| --- a/common/mlcustomize/customize-synopsis.pod
 |  | ||||||
| +++ b/common/mlcustomize/customize-synopsis.pod
 |  | ||||||
| @@ -1,15 +1,15 @@
 |  | ||||||
|      [--append-line FILE:LINE] [--chmod PERMISSIONS:FILE] |  | ||||||
| -    [--commands-from-file FILENAME] [--copy SOURCE:DEST]
 |  | ||||||
| -    [--copy-in LOCALPATH:REMOTEDIR] [--delete PATH] [--edit FILE:EXPR]
 |  | ||||||
| -    [--firstboot SCRIPT] [--firstboot-command 'CMD+ARGS']
 |  | ||||||
| -    [--firstboot-install PKG,PKG..] [--hostname HOSTNAME]
 |  | ||||||
| -    [--inject-qemu-ga METHOD] [--inject-virtio-win METHOD]
 |  | ||||||
| -    [--install PKG,PKG..] [--link TARGET:LINK[:LINK..]] [--mkdir DIR]
 |  | ||||||
| -    [--move SOURCE:DEST] [--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]
 |  | ||||||
| +    [--chown UID.GID:PATH] [--commands-from-file FILENAME]
 |  | ||||||
| +    [--copy SOURCE:DEST] [--copy-in LOCALPATH:REMOTEDIR]
 |  | ||||||
| +    [--delete PATH] [--edit FILE:EXPR] [--firstboot SCRIPT]
 |  | ||||||
| +    [--firstboot-command 'CMD+ARGS'] [--firstboot-install PKG,PKG..]
 |  | ||||||
| +    [--hostname HOSTNAME] [--inject-qemu-ga METHOD]
 |  | ||||||
| +    [--inject-virtio-win METHOD] [--install PKG,PKG..]
 |  | ||||||
| +    [--link TARGET:LINK[:LINK..]] [--mkdir DIR] [--move SOURCE:DEST]
 |  | ||||||
| +    [--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] |  | ||||||
|      [--uninstall PKG,PKG..] [--update] [--upload FILE:DEST] |  | ||||||
|      [--write FILE:CONTENT] [--no-logfile] |  | ||||||
| diff --git a/common/mlcustomize/customize_cmdline.ml b/common/mlcustomize/customize_cmdline.ml
 |  | ||||||
| index 3c24315d..fd3074ad 100644
 |  | ||||||
| --- a/common/mlcustomize/customize_cmdline.ml
 |  | ||||||
| +++ b/common/mlcustomize/customize_cmdline.ml
 |  | ||||||
| @@ -41,6 +41,8 @@ and op = [
 |  | ||||||
|        (* --append-line FILE:LINE *) |  | ||||||
|    | `Chmod of string * string |  | ||||||
|        (* --chmod PERMISSIONS:FILE *) |  | ||||||
| +  | `Chown of string * string
 |  | ||||||
| +      (* --chown UID.GID:PATH *)
 |  | ||||||
|    | `CommandsFromFile of string |  | ||||||
|        (* --commands-from-file FILENAME *) |  | ||||||
|    | `Copy of string * string |  | ||||||
| @@ -187,6 +189,17 @@ let rec argspec () =
 |  | ||||||
|        s_"Change the permissions of a file" |  | ||||||
|      ), |  | ||||||
|      Some "PERMISSIONS:FILE", "Change the permissions of C<FILE> to C<PERMISSIONS>.\n\nI<Note>: C<PERMISSIONS> by default would be decimal, unless you prefix\nit with C<0> to get octal, ie. use C<0700> not C<700>."; |  | ||||||
| +    (
 |  | ||||||
| +      [ L"chown" ],
 |  | ||||||
| +      Getopt.String (
 |  | ||||||
| +        s_"UID.GID:PATH",
 |  | ||||||
| +        fun s ->
 |  | ||||||
| +          let p = split_string_pair "chown" s in
 |  | ||||||
| +          List.push_front (`Chown p) ops
 |  | ||||||
| +      ),
 |  | ||||||
| +      s_"Change the owner user and group ID of a file or directory"
 |  | ||||||
| +    ),
 |  | ||||||
| +    Some "UID.GID:PATH", "Change the owner user and group ID of a file or directory in the guest.\nNote:\n\n=over 4\n\n=item *\n\nOnly numeric UIDs and GIDs will work, and these may not be the same\ninside the guest as on the host.\n\n=item *\n\nThis will not work with Windows guests.\n\n=back\n\nFor example:\n\n virt-customize --chown '0.0:/var/log/audit.log'\n\nSee also: I<--upload>.";
 |  | ||||||
|      ( |  | ||||||
|        [ L"commands-from-file" ], |  | ||||||
|        Getopt.String ( |  | ||||||
| diff --git a/common/mlcustomize/customize_cmdline.mli b/common/mlcustomize/customize_cmdline.mli
 |  | ||||||
| index 0cc166e6..5883bbe0 100644
 |  | ||||||
| --- a/common/mlcustomize/customize_cmdline.mli
 |  | ||||||
| +++ b/common/mlcustomize/customize_cmdline.mli
 |  | ||||||
| @@ -33,6 +33,8 @@ and op = [
 |  | ||||||
|        (* --append-line FILE:LINE *) |  | ||||||
|    | `Chmod of string * string |  | ||||||
|        (* --chmod PERMISSIONS:FILE *) |  | ||||||
| +  | `Chown of string * string
 |  | ||||||
| +      (* --chown UID.GID:PATH *)
 |  | ||||||
|    | `CommandsFromFile of string |  | ||||||
|        (* --commands-from-file FILENAME *) |  | ||||||
|    | `Copy of string * string |  | ||||||
| diff --git a/common/mltools/curl.ml b/common/mltools/curl.ml
 |  | ||||||
| index 6dba9753..73eed903 100644
 |  | ||||||
| --- a/common/mltools/curl.ml
 |  | ||||||
| +++ b/common/mltools/curl.ml
 |  | ||||||
| @@ -20,11 +20,13 @@ open Printf
 |  | ||||||
|   |  | ||||||
|  open Std_utils |  | ||||||
|  open Tools_utils |  | ||||||
| +open Common_gettext.Gettext
 |  | ||||||
|   |  | ||||||
|  type t = { |  | ||||||
|    curl : string; |  | ||||||
|    args : args; |  | ||||||
|    tmpdir : string option; |  | ||||||
| +  url : string;
 |  | ||||||
|  } |  | ||||||
|  and args = (string * string option) list |  | ||||||
|   |  | ||||||
| @@ -40,11 +42,17 @@ let args_of_proxy = function
 |  | ||||||
|    | SystemProxy ->     [] |  | ||||||
|    | ForcedProxy url -> [ "proxy", Some url; "noproxy", Some "" ] |  | ||||||
|   |  | ||||||
| -let create ?(curl = "curl") ?(proxy = SystemProxy) ?tmpdir args =
 |  | ||||||
| +let create ?(curl = "curl") ?(proxy = SystemProxy) ?tmpdir args url =
 |  | ||||||
| +  (* The ["url"] key must not appear in [args].  This was how the
 |  | ||||||
| +   * previous version of this module worked, so lets check there
 |  | ||||||
| +   * are no callers still doing this.
 |  | ||||||
| +   *)
 |  | ||||||
| +  List.iter (function "url", _ -> assert false | _ -> ()) args;
 |  | ||||||
| +
 |  | ||||||
|    let args = safe_args @ args_of_proxy proxy @ args in |  | ||||||
| -  { curl = curl; args = args; tmpdir = tmpdir }
 |  | ||||||
| +  { curl; args; tmpdir; url }
 |  | ||||||
|   |  | ||||||
| -let run { curl; args; tmpdir } =
 |  | ||||||
| +let run { curl; args; tmpdir; url } =
 |  | ||||||
|    let config_file, chan = Filename.open_temp_file ?temp_dir:tmpdir |  | ||||||
|      "guestfscurl" ".conf" in |  | ||||||
|    List.iter ( |  | ||||||
| @@ -67,15 +75,16 @@ let run { curl; args; tmpdir } =
 |  | ||||||
|          | c -> output_char chan c |  | ||||||
|        done; |  | ||||||
|        fprintf chan "\"\n" |  | ||||||
| -  ) args;
 |  | ||||||
| +  ) (("url", Some url) :: args);
 |  | ||||||
|    close_out chan; |  | ||||||
|   |  | ||||||
|    let cmd = sprintf "%s -q --config %s" (quote curl) (quote config_file) in |  | ||||||
| -  let lines = external_command ~echo_cmd:false cmd in
 |  | ||||||
| +  let help = sprintf (f_"downloading %s") url in
 |  | ||||||
| +  let lines = external_command ~echo_cmd:false ~help cmd in
 |  | ||||||
|    Unix.unlink config_file; |  | ||||||
|    lines |  | ||||||
|   |  | ||||||
| -let to_string { curl; args } =
 |  | ||||||
| +let to_string { curl; args; url } =
 |  | ||||||
|    let b = Buffer.create 128 in |  | ||||||
|    bprintf b "%s -q" (quote curl); |  | ||||||
|    List.iter ( |  | ||||||
| @@ -85,7 +94,7 @@ let to_string { curl; args } =
 |  | ||||||
|      | "user", Some _ -> bprintf b " --user <hidden>" |  | ||||||
|      | name, Some value -> bprintf b " --%s %s" name (quote value) |  | ||||||
|    ) args; |  | ||||||
| -  bprintf b "\n";
 |  | ||||||
| +  bprintf b " %s\n" (quote url);
 |  | ||||||
|    Buffer.contents b |  | ||||||
|   |  | ||||||
|  let print chan t = output_string chan (to_string t) |  | ||||||
| diff --git a/common/mltools/curl.mli b/common/mltools/curl.mli
 |  | ||||||
| index a3e98dc6..1606a79a 100644
 |  | ||||||
| --- a/common/mltools/curl.mli
 |  | ||||||
| +++ b/common/mltools/curl.mli
 |  | ||||||
| @@ -27,13 +27,16 @@ type proxy =
 |  | ||||||
|    | SystemProxy           (** Use the system settings. *) |  | ||||||
|    | ForcedProxy of string (** The proxy is forced to the specified URL. *) |  | ||||||
|   |  | ||||||
| -val create : ?curl:string -> ?proxy:proxy -> ?tmpdir:string -> args -> t
 |  | ||||||
| +val create : ?curl:string -> ?proxy:proxy -> ?tmpdir:string -> args -> string
 |  | ||||||
| +             -> t
 |  | ||||||
|  (** Create a curl command handle. |  | ||||||
|   |  | ||||||
|      The curl arguments are a list of key, value pairs corresponding |  | ||||||
|      to curl command line parameters, without leading dashes, |  | ||||||
|      eg. [("user", Some "user:password")]. |  | ||||||
|   |  | ||||||
| +    The string parameter is the URL (which is required).
 |  | ||||||
| +
 |  | ||||||
|      The optional [?curl] parameter controls the name of the curl |  | ||||||
|      binary (default ["curl"]). |  | ||||||
|   |  | ||||||
| diff --git a/common/mltools/tools_utils.ml b/common/mltools/tools_utils.ml
 |  | ||||||
| index 8b611e77..23f16c51 100644
 |  | ||||||
| --- a/common/mltools/tools_utils.ml
 |  | ||||||
| +++ b/common/mltools/tools_utils.ml
 |  | ||||||
| @@ -435,8 +435,12 @@ let create_standard_options argspec ?anon_fun ?(key_opts = false)
 |  | ||||||
|    let getopt = Getopt.create argspec ?anon_fun usage_msg in |  | ||||||
|    { getopt; ks; debug_gc } |  | ||||||
|   |  | ||||||
| +let external_command_failed help cmd reason =
 |  | ||||||
| +  let help_prefix = match help with None -> "" | Some str -> str ^ ": " in
 |  | ||||||
| +  error "%s%s ‘%s’: %s" help_prefix (s_"external command") cmd reason
 |  | ||||||
| +
 |  | ||||||
|  (* Run an external command, slurp up the output as a list of lines. *) |  | ||||||
| -let external_command ?(echo_cmd = true) cmd =
 |  | ||||||
| +let external_command ?(echo_cmd = true) ?help cmd =
 |  | ||||||
|    if echo_cmd then |  | ||||||
|      debug "%s" cmd; |  | ||||||
|    let chan = Unix.open_process_in cmd in |  | ||||||
| @@ -448,15 +452,18 @@ let external_command ?(echo_cmd = true) cmd =
 |  | ||||||
|    (match stat with |  | ||||||
|    | Unix.WEXITED 0 -> () |  | ||||||
|    | Unix.WEXITED i -> |  | ||||||
| -    error (f_"external command ‘%s’ exited with error %d") cmd i
 |  | ||||||
| +     let reason = sprintf (f_"exited with error %d") i in
 |  | ||||||
| +     external_command_failed help cmd reason
 |  | ||||||
|    | Unix.WSIGNALED i -> |  | ||||||
| -    error (f_"external command ‘%s’ killed by signal %d") cmd i
 |  | ||||||
| +     let reason = sprintf (f_"killed by signal %d") i in
 |  | ||||||
| +     external_command_failed help cmd reason
 |  | ||||||
|    | Unix.WSTOPPED i -> |  | ||||||
| -    error (f_"external command ‘%s’ stopped by signal %d") cmd i
 |  | ||||||
| +     let reason = sprintf (f_"stopped by signal %d") i in
 |  | ||||||
| +     external_command_failed help cmd reason
 |  | ||||||
|    ); |  | ||||||
|    lines |  | ||||||
|   |  | ||||||
| -let rec run_commands ?(echo_cmd = true) cmds =
 |  | ||||||
| +let rec run_commands ?(echo_cmd = true) ?help cmds =
 |  | ||||||
|    let res = Array.make (List.length cmds) 0 in |  | ||||||
|    let pids = |  | ||||||
|      List.mapi ( |  | ||||||
| @@ -482,21 +489,21 @@ let rec run_commands ?(echo_cmd = true) cmds =
 |  | ||||||
|        let matching_pair = List.hd matching_pair in |  | ||||||
|        let idx, _, app, outfd, errfd = matching_pair in |  | ||||||
|        pids := new_pids; |  | ||||||
| -      res.(idx) <- do_teardown app outfd errfd stat
 |  | ||||||
| +      res.(idx) <- do_teardown help app outfd errfd stat
 |  | ||||||
|      ); |  | ||||||
|    done; |  | ||||||
|    Array.to_list res |  | ||||||
|   |  | ||||||
| -and run_command ?(echo_cmd = true) ?stdout_fd ?stderr_fd args =
 |  | ||||||
| +and run_command ?(echo_cmd = true) ?help ?stdout_fd ?stderr_fd args =
 |  | ||||||
|    let run_res = do_run args ~echo_cmd ?stdout_fd ?stderr_fd in |  | ||||||
|    match run_res with |  | ||||||
|    | Either (pid, app, outfd, errfd) -> |  | ||||||
|      let _, stat = Unix.waitpid [] pid in |  | ||||||
| -    do_teardown app outfd errfd stat
 |  | ||||||
| +    do_teardown help app outfd errfd stat
 |  | ||||||
|    | Or code -> |  | ||||||
|      code |  | ||||||
|   |  | ||||||
| -and do_run ?(echo_cmd = true) ?stdout_fd ?stderr_fd args =
 |  | ||||||
| +and do_run ?(echo_cmd = true) ?help ?stdout_fd ?stderr_fd args =
 |  | ||||||
|    let app = List.hd args in |  | ||||||
|    let get_fd default = function |  | ||||||
|      | None -> |  | ||||||
| @@ -522,16 +529,18 @@ and do_run ?(echo_cmd = true) ?stdout_fd ?stderr_fd args =
 |  | ||||||
|       debug "%s: %s: executable not found" app fn; |  | ||||||
|       Or 127 |  | ||||||
|   |  | ||||||
| -and do_teardown app outfd errfd exitstat =
 |  | ||||||
| +and do_teardown help app outfd errfd exitstat =
 |  | ||||||
|    Option.iter Unix.close outfd; |  | ||||||
|    Option.iter Unix.close errfd; |  | ||||||
|    match exitstat with |  | ||||||
|    | Unix.WEXITED i -> |  | ||||||
| -    i
 |  | ||||||
| +     i
 |  | ||||||
|    | Unix.WSIGNALED i -> |  | ||||||
| -    error (f_"external command ‘%s’ killed by signal %d") app i
 |  | ||||||
| +     let reason = sprintf (f_"killed by signal %d") i in
 |  | ||||||
| +     external_command_failed help app reason
 |  | ||||||
|    | Unix.WSTOPPED i -> |  | ||||||
| -    error (f_"external command ‘%s’ stopped by signal %d") app i
 |  | ||||||
| +     let reason = sprintf (f_"stopped by signal %d") i in
 |  | ||||||
| +     external_command_failed help app reason
 |  | ||||||
|   |  | ||||||
|  let shell_command ?(echo_cmd = true) cmd = |  | ||||||
|    if echo_cmd then |  | ||||||
| diff --git a/common/mltools/tools_utils.mli b/common/mltools/tools_utils.mli
 |  | ||||||
| index ec900e63..193ba7b6 100644
 |  | ||||||
| --- a/common/mltools/tools_utils.mli
 |  | ||||||
| +++ b/common/mltools/tools_utils.mli
 |  | ||||||
| @@ -103,13 +103,17 @@ val create_standard_options : Getopt.speclist -> ?anon_fun:Getopt.anon_fun -> ?k
 |  | ||||||
|   |  | ||||||
|      Returns a new {!cmdline_options} structure. *) |  | ||||||
|   |  | ||||||
| -val external_command : ?echo_cmd:bool -> string -> string list
 |  | ||||||
| +val external_command : ?echo_cmd:bool -> ?help:string -> string -> string list
 |  | ||||||
|  (** Run an external command, slurp up the output as a list of lines. |  | ||||||
|   |  | ||||||
|      [echo_cmd] specifies whether to output the full command on verbose |  | ||||||
| -    mode, and it's on by default. *)
 |  | ||||||
| +    mode, and it's on by default.
 |  | ||||||
|   |  | ||||||
| -val run_commands : ?echo_cmd:bool -> (string list * Unix.file_descr option * Unix.file_descr option) list -> int list
 |  | ||||||
| +    [help] is an optional string which is printed as a prefix in
 |  | ||||||
| +    case the external command fails, eg as a hint to the user about
 |  | ||||||
| +    what we were trying to do. *)
 |  | ||||||
| +
 |  | ||||||
| +val run_commands : ?echo_cmd:bool -> ?help:string -> (string list * Unix.file_descr option * Unix.file_descr option) list -> int list
 |  | ||||||
|  (** Run external commands in parallel without using a shell, |  | ||||||
|      and return a list with their exit codes. |  | ||||||
|   |  | ||||||
| @@ -126,16 +130,24 @@ val run_commands : ?echo_cmd:bool -> (string list * Unix.file_descr option * Uni
 |  | ||||||
|      end of the execution of the command for which it was specified. |  | ||||||
|   |  | ||||||
|      [echo_cmd] specifies whether output the full command on verbose |  | ||||||
| -    mode, and it's on by default. *)
 |  | ||||||
| +    mode, and it's on by default.
 |  | ||||||
|   |  | ||||||
| -val run_command : ?echo_cmd:bool -> ?stdout_fd:Unix.file_descr -> ?stderr_fd:Unix.file_descr -> string list -> int
 |  | ||||||
| +    [help] is an optional string which is printed as a prefix in
 |  | ||||||
| +    case the external command fails, eg as a hint to the user about
 |  | ||||||
| +    what we were trying to do. *)
 |  | ||||||
| +
 |  | ||||||
| +val run_command : ?echo_cmd:bool -> ?help:string -> ?stdout_fd:Unix.file_descr -> ?stderr_fd:Unix.file_descr -> string list -> int
 |  | ||||||
|  (** Run an external command without using a shell, and return its exit code. |  | ||||||
|   |  | ||||||
|      If [stdout_fd] or [stderr_fd] is specified, the file descriptor |  | ||||||
|      is automatically closed after executing the command. |  | ||||||
|   |  | ||||||
|      [echo_cmd] specifies whether output the full command on verbose |  | ||||||
| -    mode, and it's on by default. *)
 |  | ||||||
| +    mode, and it's on by default.
 |  | ||||||
| +
 |  | ||||||
| +    [help] is an optional string which is printed as a prefix in
 |  | ||||||
| +    case the external command fails, eg as a hint to the user about
 |  | ||||||
| +    what we were trying to do. *)
 |  | ||||||
|   |  | ||||||
|  val shell_command : ?echo_cmd:bool -> string -> int |  | ||||||
|  (** Run an external shell command, and return its exit code. |  | ||||||
| diff --git a/generator/customize.ml b/generator/customize.ml
 |  | ||||||
| index aa7ac8e8..8d3dec3e 100644
 |  | ||||||
| --- a/generator/customize.ml
 |  | ||||||
| +++ b/generator/customize.ml
 |  | ||||||
| @@ -95,6 +95,34 @@ I<Note>: C<PERMISSIONS> by default would be decimal, unless you prefix
 |  | ||||||
|  it with C<0> to get octal, ie. use C<0700> not C<700>."; |  | ||||||
|    }; |  | ||||||
|   |  | ||||||
| +  { op_name = "chown";
 |  | ||||||
| +    op_type = StringPair "UID.GID:PATH";
 |  | ||||||
| +    op_discrim = "`Chown";
 |  | ||||||
| +    op_shortdesc = "Change the owner user and group ID of a file or directory";
 |  | ||||||
| +    op_pod_longdesc = "\
 |  | ||||||
| +Change the owner user and group ID of a file or directory in the guest.
 |  | ||||||
| +Note:
 |  | ||||||
| +
 |  | ||||||
| +=over 4
 |  | ||||||
| +
 |  | ||||||
| +=item *
 |  | ||||||
| +
 |  | ||||||
| +Only numeric UIDs and GIDs will work, and these may not be the same
 |  | ||||||
| +inside the guest as on the host.
 |  | ||||||
| +
 |  | ||||||
| +=item *
 |  | ||||||
| +
 |  | ||||||
| +This will not work with Windows guests.
 |  | ||||||
| +
 |  | ||||||
| +=back
 |  | ||||||
| +
 |  | ||||||
| +For example:
 |  | ||||||
| +
 |  | ||||||
| + virt-customize --chown '0.0:/var/log/audit.log'
 |  | ||||||
| +
 |  | ||||||
| +See also: I<--upload>.";
 |  | ||||||
| +  };
 |  | ||||||
| +
 |  | ||||||
|    { op_name = "commands-from-file"; |  | ||||||
|      op_type = StringFn ("FILENAME", "customize_read_from_file"); |  | ||||||
|      op_discrim = "`CommandsFromFile"; |  | ||||||
| @ -1,4 +1,4 @@ | |||||||
| From 287213b44674cac24ad4eb09dbf2c4a21538462a Mon Sep 17 00:00:00 2001 | From 19c4d1c8b9f278e054594660b5392d6c08a59d8f Mon Sep 17 00:00:00 2001 | ||||||
| From: "Richard W.M. Jones" <rjones@redhat.com> | From: "Richard W.M. Jones" <rjones@redhat.com> | ||||||
| Date: Mon, 10 Mar 2025 18:52:08 +0000 | Date: Mon, 10 Mar 2025 18:52:08 +0000 | ||||||
| Subject: [PATCH] lib: Print kernel utsname in debug output | Subject: [PATCH] lib: Print kernel utsname in debug output | ||||||
| @ -8,13 +8,12 @@ particular we were looking at a problem with passt creating a user | |||||||
| namespace but didn't know what exact kernel was being used. | namespace but didn't know what exact kernel was being used. | ||||||
| 
 | 
 | ||||||
| (cherry picked from commit 31fa712aa07190f2c5ed789712b92b4be2d51488) | (cherry picked from commit 31fa712aa07190f2c5ed789712b92b4be2d51488) | ||||||
| (cherry picked from commit 19c4d1c8b9f278e054594660b5392d6c08a59d8f) |  | ||||||
| ---
 | ---
 | ||||||
|  lib/launch.c | 6 ++++++ |  lib/launch.c | 6 ++++++ | ||||||
|  1 file changed, 6 insertions(+) |  1 file changed, 6 insertions(+) | ||||||
| 
 | 
 | ||||||
| diff --git a/lib/launch.c b/lib/launch.c
 | diff --git a/lib/launch.c b/lib/launch.c
 | ||||||
| index bd0526c9..22196819 100644
 | index b9b76e50..9c44612d 100644
 | ||||||
| --- a/lib/launch.c
 | --- a/lib/launch.c
 | ||||||
| +++ b/lib/launch.c
 | +++ b/lib/launch.c
 | ||||||
| @@ -36,6 +36,7 @@
 | @@ -36,6 +36,7 @@
 | ||||||
| @ -22,10 +21,10 @@ index bd0526c9..22196819 100644 | |||||||
|  #include <sys/stat.h> |  #include <sys/stat.h> | ||||||
|  #include <sys/types.h> |  #include <sys/types.h> | ||||||
| +#include <sys/utsname.h>
 | +#include <sys/utsname.h>
 | ||||||
|  |  #include <sys/wait.h> | ||||||
|  #include <errno.h> |  #include <errno.h> | ||||||
|  #include <assert.h> |  #include <assert.h> | ||||||
|  #include <libintl.h> | @@ -93,6 +94,7 @@ guestfs_impl_launch (guestfs_h *g)
 | ||||||
| @@ -92,6 +93,7 @@ guestfs_impl_launch (guestfs_h *g)
 |  | ||||||
|      struct backend *b; |      struct backend *b; | ||||||
|      CLEANUP_FREE char *backend = guestfs_get_backend (g); |      CLEANUP_FREE char *backend = guestfs_get_backend (g); | ||||||
|      int mask; |      int mask; | ||||||
| @ -33,7 +32,7 @@ index bd0526c9..22196819 100644 | |||||||
|   |   | ||||||
|      debug (g, "launch: program=%s", g->program); |      debug (g, "launch: program=%s", g->program); | ||||||
|      if (STRNEQ (g->identifier, "")) |      if (STRNEQ (g->identifier, "")) | ||||||
| @@ -108,6 +110,10 @@ guestfs_impl_launch (guestfs_h *g)
 | @@ -109,6 +111,10 @@ guestfs_impl_launch (guestfs_h *g)
 | ||||||
|      if (mask >= 0) |      if (mask >= 0) | ||||||
|        debug (g, "launch: umask=0%03o", (unsigned) mask); |        debug (g, "launch: umask=0%03o", (unsigned) mask); | ||||||
|      debug (g, "launch: euid=%ju", (uintmax_t) geteuid ()); |      debug (g, "launch: euid=%ju", (uintmax_t) geteuid ()); | ||||||
| @ -1,101 +0,0 @@ | |||||||
| From cda24a0207fda8659790376a79fdac3d1775da83 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,29 @@ | |||||||
|  | From fa1c16528267c89de8a2ecebd44405cbd04fa0ee Mon Sep 17 00:00:00 2001 | ||||||
|  | From: "Richard W.M. Jones" <rjones@redhat.com> | ||||||
|  | Date: Tue, 11 Mar 2025 13:36:12 +0000 | ||||||
|  | Subject: [PATCH] daemon: Fix loongarch64 detection on RHEL 9 | ||||||
|  | 
 | ||||||
|  | $ rpm -q file | ||||||
|  | file-5.39-16.el9.x86_64 | ||||||
|  | $ file ./test-data/binaries/bin-loongarch64-dynamic | ||||||
|  | ./test-data/binaries/bin-loongarch64-dynamic: ELF 64-bit LSB pie executable, *unknown arch 0x102* version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-loongarch-lp64d.so.1, BuildID[sha1]=7622a1a70bf6e697851ac3790557e1ca686459b5, for GNU/Linux 5.19.0, stripped | ||||||
|  | 
 | ||||||
|  | Updates: commit 729d6d55ea84494f0398d02450bd29c39c55f0bd | ||||||
|  | (cherry picked from commit 4176b2043f6cf65f8f5f4f7d6fa39beb9c0a22c6) | ||||||
|  | ---
 | ||||||
|  |  daemon/filearch.ml | 2 ++ | ||||||
|  |  1 file changed, 2 insertions(+) | ||||||
|  | 
 | ||||||
|  | diff --git a/daemon/filearch.ml b/daemon/filearch.ml
 | ||||||
|  | index 7dfc1cb7..e2bd5a2c 100644
 | ||||||
|  | --- a/daemon/filearch.ml
 | ||||||
|  | +++ b/daemon/filearch.ml
 | ||||||
|  | @@ -100,6 +100,8 @@ and canonical_elf_arch bits endianness elf_arch =
 | ||||||
|  |    ) | ||||||
|  |    else if substr "LoongArch" then | ||||||
|  |      sprintf "loongarch%s" bits | ||||||
|  | +  else if substr "*unknown arch 0x102*" then (* file command on RHEL 9 *)
 | ||||||
|  | +    sprintf "loongarch%s" bits
 | ||||||
|  |    else | ||||||
|  |      elf_arch | ||||||
|  |   | ||||||
| @ -1,34 +0,0 @@ | |||||||
| From 1eaf876ff2a3bfeaa8756b92e5fa74a91b74f45c 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 |  | ||||||
| @ -1,10 +1,9 @@ | |||||||
| From 0de9a79780bffab93edbf2a609fc33c3afd02605 Mon Sep 17 00:00:00 2001 | From 68cecb64758b8ff6d3af842721cb7cf706cb5d0c Mon Sep 17 00:00:00 2001 | ||||||
| From: "Richard W.M. Jones" <rjones@redhat.com> | From: "Richard W.M. Jones" <rjones@redhat.com> | ||||||
| Date: Wed, 16 Apr 2025 10:01:33 +0100 | Date: Wed, 16 Apr 2025 10:01:33 +0100 | ||||||
| Subject: [PATCH] daemon: inspect: Add some debugging of /usr merging | Subject: [PATCH] daemon: inspect: Add some debugging of /usr merging | ||||||
| 
 | 
 | ||||||
| (cherry picked from commit 2d1e8941301373d04a436333219358a72f9660f1) | (cherry picked from commit 2d1e8941301373d04a436333219358a72f9660f1) | ||||||
| (cherry picked from commit 68cecb64758b8ff6d3af842721cb7cf706cb5d0c) |  | ||||||
| ---
 | ---
 | ||||||
|  daemon/inspect.ml | 15 ++++++++++++++- |  daemon/inspect.ml | 15 ++++++++++++++- | ||||||
|  1 file changed, 14 insertions(+), 1 deletion(-) |  1 file changed, 14 insertions(+), 1 deletion(-) | ||||||
| @ -1,75 +0,0 @@ | |||||||
| From bb3b9ac1ec7021ac04bca03748f15761c6c97487 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/>. |  | ||||||
| @ -1,4 +1,4 @@ | |||||||
| From 983159e5f0d31ae64dfc0a584c089699315196a6 Mon Sep 17 00:00:00 2001 | From 4e27b259c166d87a57d133a79b8eed3b556288b8 Mon Sep 17 00:00:00 2001 | ||||||
| From: "Richard W.M. Jones" <rjones@redhat.com> | From: "Richard W.M. Jones" <rjones@redhat.com> | ||||||
| Date: Wed, 16 Apr 2025 11:35:13 +0100 | Date: Wed, 16 Apr 2025 11:35:13 +0100 | ||||||
| Subject: [PATCH] generator: Implement struct FDevice type | Subject: [PATCH] generator: Implement struct FDevice type | ||||||
| @ -17,7 +17,6 @@ translated in the daemon, we just treat it exactly the same as | |||||||
| FString.  The vast majority of this patch is this mechanical change. | FString.  The vast majority of this patch is this mechanical change. | ||||||
| 
 | 
 | ||||||
| (cherry picked from commit 0ff73a42c7f4f309fbab11ea2e89ee6f0501367d) | (cherry picked from commit 0ff73a42c7f4f309fbab11ea2e89ee6f0501367d) | ||||||
| (cherry picked from commit 4e27b259c166d87a57d133a79b8eed3b556288b8) |  | ||||||
| ---
 | ---
 | ||||||
|  generator/GObject.ml |  6 +++--- |  generator/GObject.ml |  6 +++--- | ||||||
|  generator/OCaml.ml   |  6 ++---- |  generator/OCaml.ml   |  6 ++---- | ||||||
| @ -107,7 +106,7 @@ index 566ba69e..e71d97f5 100644 | |||||||
|                     | name, FUUID -> pr "  opaque %s[32];\n" name |                     | name, FUUID -> pr "  opaque %s[32];\n" name | ||||||
|                     | name, FInt32 -> pr "  int %s;\n" name |                     | name, FInt32 -> pr "  int %s;\n" name | ||||||
| diff --git a/generator/c.ml b/generator/c.ml
 | diff --git a/generator/c.ml b/generator/c.ml
 | ||||||
| index 0391dd3d..e850885e 100644
 | index 09181028..124aeb6d 100644
 | ||||||
| --- a/generator/c.ml
 | --- a/generator/c.ml
 | ||||||
| +++ b/generator/c.ml
 | +++ b/generator/c.ml
 | ||||||
| @@ -352,7 +352,7 @@ and generate_structs_pod () =
 | @@ -352,7 +352,7 @@ and generate_structs_pod () =
 | ||||||
| @ -128,7 +127,7 @@ index 0391dd3d..e850885e 100644 | |||||||
|          | name, FBuffer -> |          | name, FBuffer -> | ||||||
|              pr "  uint32_t %s_len;\n" name; |              pr "  uint32_t %s_len;\n" name; | ||||||
|              pr "  char *%s;\n" name |              pr "  char *%s;\n" name | ||||||
| @@ -926,7 +926,7 @@ and generate_client_structs_compare () =
 | @@ -916,7 +916,7 @@ and generate_client_structs_compare () =
 | ||||||
|      fun { s_name = typ; s_cols = cols } -> |      fun { s_name = typ; s_cols = cols } -> | ||||||
|        let has_nonnumeric_cols = |        let has_nonnumeric_cols = | ||||||
|          let nonnumeric = function |          let nonnumeric = function | ||||||
| @ -137,7 +136,7 @@ index 0391dd3d..e850885e 100644 | |||||||
|            | _,(FChar|FUInt32|FInt32|FUInt64|FBytes|FInt64|FOptPercent) -> false |            | _,(FChar|FUInt32|FInt32|FUInt64|FBytes|FInt64|FOptPercent) -> false | ||||||
|          in |          in | ||||||
|          List.exists nonnumeric cols in |          List.exists nonnumeric cols in | ||||||
| @@ -942,7 +942,7 @@ and generate_client_structs_compare () =
 | @@ -932,7 +932,7 @@ and generate_client_structs_compare () =
 | ||||||
|        ); |        ); | ||||||
|        List.iter ( |        List.iter ( | ||||||
|          function |          function | ||||||
| @ -146,7 +145,7 @@ index 0391dd3d..e850885e 100644 | |||||||
|            pr "  r = strcmp (s1->%s, s2->%s);\n" name name; |            pr "  r = strcmp (s1->%s, s2->%s);\n" name name; | ||||||
|            pr "  if (r != 0) return r;\n" |            pr "  if (r != 0) return r;\n" | ||||||
|          | name, FBuffer -> |          | name, FBuffer -> | ||||||
| @@ -1011,7 +1011,7 @@ and generate_client_structs_copy () =
 | @@ -1001,7 +1001,7 @@ and generate_client_structs_copy () =
 | ||||||
|      fun { s_name = typ; s_cols = cols } -> |      fun { s_name = typ; s_cols = cols } -> | ||||||
|        let has_boxed_cols = |        let has_boxed_cols = | ||||||
|          let boxed = function |          let boxed = function | ||||||
| @ -155,7 +154,7 @@ index 0391dd3d..e850885e 100644 | |||||||
|            | _,(FChar|FUUID|FUInt32|FInt32|FUInt64|FBytes|FInt64|FOptPercent) -> |            | _,(FChar|FUUID|FUInt32|FInt32|FUInt64|FBytes|FInt64|FOptPercent) -> | ||||||
|              false |              false | ||||||
|          in |          in | ||||||
| @@ -1024,8 +1024,7 @@ and generate_client_structs_copy () =
 | @@ -1014,8 +1014,7 @@ and generate_client_structs_copy () =
 | ||||||
|          pr "{\n"; |          pr "{\n"; | ||||||
|          List.iter ( |          List.iter ( | ||||||
|            function |            function | ||||||
| @ -165,7 +164,7 @@ index 0391dd3d..e850885e 100644 | |||||||
|            | _, FChar |            | _, FChar | ||||||
|            | _, FUUID |            | _, FUUID | ||||||
|            | _, FUInt32 |            | _, FUInt32 | ||||||
| @@ -1048,8 +1047,7 @@ and generate_client_structs_copy () =
 | @@ -1038,8 +1037,7 @@ and generate_client_structs_copy () =
 | ||||||
|          pr "\n"; |          pr "\n"; | ||||||
|          List.iter ( |          List.iter ( | ||||||
|            function |            function | ||||||
| @ -175,7 +174,7 @@ index 0391dd3d..e850885e 100644 | |||||||
|            | _, FChar |            | _, FChar | ||||||
|            | _, FUUID |            | _, FUUID | ||||||
|            | _, FUInt32 |            | _, FUInt32 | ||||||
| @@ -1061,7 +1059,7 @@ and generate_client_structs_copy () =
 | @@ -1051,7 +1049,7 @@ and generate_client_structs_copy () =
 | ||||||
|          ) cols; |          ) cols; | ||||||
|          List.iter ( |          List.iter ( | ||||||
|            function |            function | ||||||
| @ -184,7 +183,7 @@ index 0391dd3d..e850885e 100644 | |||||||
|              pr "  out->%s = strdup (inp->%s);\n" name name; |              pr "  out->%s = strdup (inp->%s);\n" name name; | ||||||
|              pr "  if (out->%s == NULL) goto error;\n" name |              pr "  if (out->%s == NULL) goto error;\n" name | ||||||
|            | name, FBuffer -> |            | name, FBuffer -> | ||||||
| @@ -1244,7 +1242,7 @@ and generate_client_structs_print_c () =
 | @@ -1234,7 +1232,7 @@ and generate_client_structs_print_c () =
 | ||||||
|          ); |          ); | ||||||
|          List.iter ( |          List.iter ( | ||||||
|            function |            function | ||||||
| @ -207,10 +206,10 @@ index 43579df5..6ab6c3c9 100644 | |||||||
|              pr "      uint %s_len;\n" name; |              pr "      uint %s_len;\n" name; | ||||||
|              pr "      string %s;\n" name |              pr "      string %s;\n" name | ||||||
| diff --git a/generator/daemon.ml b/generator/daemon.ml
 | diff --git a/generator/daemon.ml b/generator/daemon.ml
 | ||||||
| index 78a2412d..0218d3e5 100644
 | index 9ab9e12d..0baa7708 100644
 | ||||||
| --- a/generator/daemon.ml
 | --- a/generator/daemon.ml
 | ||||||
| +++ b/generator/daemon.ml
 | +++ b/generator/daemon.ml
 | ||||||
| @@ -447,15 +447,37 @@ let generate_daemon_stubs actions () =
 | @@ -442,15 +442,37 @@ let generate_daemon_stubs actions () =
 | ||||||
|              pr "  ret.%s.%s_val = r;\n" n n; |              pr "  ret.%s.%s_val = r;\n" n n; | ||||||
|              pr "  reply ((xdrproc_t) &xdr_guestfs_%s_ret, (char *) &ret);\n" |              pr "  reply ((xdrproc_t) &xdr_guestfs_%s_ret, (char *) &ret);\n" | ||||||
|                name |                name | ||||||
| @ -250,7 +249,7 @@ index 78a2412d..0218d3e5 100644 | |||||||
|              pr "  ret.%s = *r;\n" n; |              pr "  ret.%s = *r;\n" n; | ||||||
|              pr "  reply ((xdrproc_t) xdr_guestfs_%s_ret, (char *) &ret);\n" |              pr "  reply ((xdrproc_t) xdr_guestfs_%s_ret, (char *) &ret);\n" | ||||||
|                name; |                name; | ||||||
| @@ -624,7 +646,7 @@ let generate_daemon_caml_stubs () =
 | @@ -619,7 +641,7 @@ let generate_daemon_caml_stubs () =
 | ||||||
|        fun i -> |        fun i -> | ||||||
|          pr "  v = Field (retv, %d);\n" i; |          pr "  v = Field (retv, %d);\n" i; | ||||||
|          function |          function | ||||||
| @ -259,7 +258,7 @@ index 78a2412d..0218d3e5 100644 | |||||||
|             pr "  ret->%s = strdup (String_val (v));\n" n; |             pr "  ret->%s = strdup (String_val (v));\n" n; | ||||||
|             pr "  if (ret->%s == NULL) return NULL;\n" n |             pr "  if (ret->%s == NULL) return NULL;\n" n | ||||||
|          | n, FBuffer -> |          | n, FBuffer -> | ||||||
| @@ -991,7 +1013,7 @@ let generate_daemon_lvm_tokenization () =
 | @@ -986,7 +1008,7 @@ let generate_daemon_lvm_tokenization () =
 | ||||||
|              pr "  if (*p) next = p+1; else next = NULL;\n"; |              pr "  if (*p) next = p+1; else next = NULL;\n"; | ||||||
|              pr "  *p = '\\0';\n"; |              pr "  *p = '\\0';\n"; | ||||||
|              (match coltype with |              (match coltype with | ||||||
| @ -1,144 +0,0 @@ | |||||||
| From 8ba3628594c354dafcc715a842199c75a5676b57 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. |  | ||||||
| @ -1,4 +1,4 @@ | |||||||
| From b7286e1ac371d27d24f88aa646f6cd726443d926 Mon Sep 17 00:00:00 2001 | From b306532e7a4a3f235b24e5dab22ab36b849ac886 Mon Sep 17 00:00:00 2001 | ||||||
| From: "Richard W.M. Jones" <rjones@redhat.com> | From: "Richard W.M. Jones" <rjones@redhat.com> | ||||||
| Date: Wed, 16 Apr 2025 11:50:37 +0100 | Date: Wed, 16 Apr 2025 11:50:37 +0100 | ||||||
| Subject: [PATCH] generator: Use new FDevice type for the pvs-full pv_name | Subject: [PATCH] generator: Use new FDevice type for the pvs-full pv_name | ||||||
| @ -8,7 +8,6 @@ Remove the code which did explicit reverse device name translation, | |||||||
| and use the generator's code instead. | and use the generator's code instead. | ||||||
| 
 | 
 | ||||||
| (cherry picked from commit 5a16d1120fb7b046974abde43b1c40250bfd1a95) | (cherry picked from commit 5a16d1120fb7b046974abde43b1c40250bfd1a95) | ||||||
| (cherry picked from commit b306532e7a4a3f235b24e5dab22ab36b849ac886) |  | ||||||
| ---
 | ---
 | ||||||
|  daemon/lvm.c         | 29 +---------------------------- |  daemon/lvm.c         | 29 +---------------------------- | ||||||
|  generator/structs.ml |  2 +- |  generator/structs.ml |  2 +- | ||||||
| @ -1,241 +0,0 @@ | |||||||
| From e7501a32cb096c1957aae0de934c0b563ff18a5f Mon Sep 17 00:00:00 2001 |  | ||||||
| From: "Richard W.M. Jones" <rjones@redhat.com> |  | ||||||
| Date: Sat, 15 Jul 2023 16:33:18 +0100 |  | ||||||
| Subject: [PATCH] generator: customize: Add new StringTriplet for use by |  | ||||||
|  --chown |  | ||||||
| MIME-Version: 1.0 |  | ||||||
| Content-Type: text/plain; charset=UTF-8 |  | ||||||
| Content-Transfer-Encoding: 8bit |  | ||||||
| 
 |  | ||||||
| The just added --chown option previously used StringPair, splitting |  | ||||||
| the argument as ‘UID.GID:FILENAME’.  However this will not work if we |  | ||||||
| ever extend this with the ability to use user or group names, since |  | ||||||
| they may contain dot (but not colon).  Add a new StringTriplet type |  | ||||||
| and split the argument string three ways.  The new option becomes: |  | ||||||
| 
 |  | ||||||
|   virt-customize ... --chown UID:GID:FILENAME |  | ||||||
| 
 |  | ||||||
| Include the following commit from the common submodule: |  | ||||||
| 
 |  | ||||||
|   commit e70d89a58dae068be2e19c7c21558707261af96a |  | ||||||
|   Author: Richard W.M. Jones <rjones@redhat.com> |  | ||||||
|   Date:   Sat Jul 15 16:42:06 2023 +0100 |  | ||||||
| 
 |  | ||||||
|     customize: Update generated files for --chown with StringTriplet |  | ||||||
| 
 |  | ||||||
| Updates: commit d8e48bff212f9b0558480ffedf8158157360d0d5 |  | ||||||
| (cherry picked from commit c08032ebe2763f5e9ce5b14e003721475219d390) |  | ||||||
| ---
 |  | ||||||
|  common                 |  2 +- |  | ||||||
|  generator/customize.ml | 44 ++++++++++++++++++++++++++++++++---------- |  | ||||||
|  2 files changed, 35 insertions(+), 11 deletions(-) |  | ||||||
| 
 |  | ||||||
| Submodule common bbb54714..e70d89a5: |  | ||||||
| diff --git a/common/mlcustomize/customize-options.pod b/common/mlcustomize/customize-options.pod
 |  | ||||||
| index 22724600..e658a447 100644
 |  | ||||||
| --- a/common/mlcustomize/customize-options.pod
 |  | ||||||
| +++ b/common/mlcustomize/customize-options.pod
 |  | ||||||
| @@ -63,7 +63,7 @@ Change the permissions of C<FILE> to C<PERMISSIONS>.
 |  | ||||||
|  I<Note>: C<PERMISSIONS> by default would be decimal, unless you prefix |  | ||||||
|  it with C<0> to get octal, ie. use C<0700> not C<700>. |  | ||||||
|   |  | ||||||
| -=item B<--chown> UID.GID:PATH
 |  | ||||||
| +=item B<--chown> UID:GID:PATH
 |  | ||||||
|   |  | ||||||
|  Change the owner user and group ID of a file or directory in the guest. |  | ||||||
|  Note: |  | ||||||
| @@ -83,7 +83,7 @@ This will not work with Windows guests.
 |  | ||||||
|   |  | ||||||
|  For example: |  | ||||||
|   |  | ||||||
| - virt-customize --chown '0.0:/var/log/audit.log'
 |  | ||||||
| + virt-customize --chown '0:0:/var/log/audit.log'
 |  | ||||||
|   |  | ||||||
|  See also: I<--upload>. |  | ||||||
|   |  | ||||||
| diff --git a/common/mlcustomize/customize-synopsis.pod b/common/mlcustomize/customize-synopsis.pod
 |  | ||||||
| index e20b12d4..5031b015 100644
 |  | ||||||
| --- a/common/mlcustomize/customize-synopsis.pod
 |  | ||||||
| +++ b/common/mlcustomize/customize-synopsis.pod
 |  | ||||||
| @@ -1,5 +1,5 @@
 |  | ||||||
|      [--append-line FILE:LINE] [--chmod PERMISSIONS:FILE] |  | ||||||
| -    [--chown UID.GID:PATH] [--commands-from-file FILENAME]
 |  | ||||||
| +    [--chown UID:GID:PATH] [--commands-from-file FILENAME]
 |  | ||||||
|      [--copy SOURCE:DEST] [--copy-in LOCALPATH:REMOTEDIR] |  | ||||||
|      [--delete PATH] [--edit FILE:EXPR] [--firstboot SCRIPT] |  | ||||||
|      [--firstboot-command 'CMD+ARGS'] [--firstboot-install PKG,PKG..] |  | ||||||
| diff --git a/common/mlcustomize/customize_cmdline.ml b/common/mlcustomize/customize_cmdline.ml
 |  | ||||||
| index fd3074ad..3ce901db 100644
 |  | ||||||
| --- a/common/mlcustomize/customize_cmdline.ml
 |  | ||||||
| +++ b/common/mlcustomize/customize_cmdline.ml
 |  | ||||||
| @@ -41,8 +41,8 @@ and op = [
 |  | ||||||
|        (* --append-line FILE:LINE *) |  | ||||||
|    | `Chmod of string * string |  | ||||||
|        (* --chmod PERMISSIONS:FILE *) |  | ||||||
| -  | `Chown of string * string
 |  | ||||||
| -      (* --chown UID.GID:PATH *)
 |  | ||||||
| +  | `Chown of string * string * string
 |  | ||||||
| +      (* --chown UID:GID:PATH *)
 |  | ||||||
|    | `CommandsFromFile of string |  | ||||||
|        (* --commands-from-file FILENAME *) |  | ||||||
|    | `Copy of string * string |  | ||||||
| @@ -154,8 +154,13 @@ let rec argspec () =
 |  | ||||||
|            option_name in |  | ||||||
|      let len = String.length arg in |  | ||||||
|      String.sub arg 0 i, String.sub arg (i+1) (len-(i+1)) |  | ||||||
| -  in
 |  | ||||||
| -  let split_string_list arg =
 |  | ||||||
| +  and split_string_triplet option_name arg =
 |  | ||||||
| +    match String.nsplit ~max:3 "," arg with
 |  | ||||||
| +    | [a; b; c] -> a, b, c
 |  | ||||||
| +    | _ ->
 |  | ||||||
| +        error (f_"invalid format for '--%s' parameter, see the man page")
 |  | ||||||
| +          option_name
 |  | ||||||
| +  and split_string_list arg =
 |  | ||||||
|      String.nsplit "," arg |  | ||||||
|    in |  | ||||||
|    let split_links_list option_name arg = |  | ||||||
| @@ -192,14 +197,14 @@ let rec argspec () =
 |  | ||||||
|      ( |  | ||||||
|        [ L"chown" ], |  | ||||||
|        Getopt.String ( |  | ||||||
| -        s_"UID.GID:PATH",
 |  | ||||||
| +        s_"UID:GID:PATH",
 |  | ||||||
|          fun s -> |  | ||||||
| -          let p = split_string_pair "chown" s in
 |  | ||||||
| +          let p = split_string_triplet "chown" s in
 |  | ||||||
|            List.push_front (`Chown p) ops |  | ||||||
|        ), |  | ||||||
|        s_"Change the owner user and group ID of a file or directory" |  | ||||||
|      ), |  | ||||||
| -    Some "UID.GID:PATH", "Change the owner user and group ID of a file or directory in the guest.\nNote:\n\n=over 4\n\n=item *\n\nOnly numeric UIDs and GIDs will work, and these may not be the same\ninside the guest as on the host.\n\n=item *\n\nThis will not work with Windows guests.\n\n=back\n\nFor example:\n\n virt-customize --chown '0.0:/var/log/audit.log'\n\nSee also: I<--upload>.";
 |  | ||||||
| +    Some "UID:GID:PATH", "Change the owner user and group ID of a file or directory in the guest.\nNote:\n\n=over 4\n\n=item *\n\nOnly numeric UIDs and GIDs will work, and these may not be the same\ninside the guest as on the host.\n\n=item *\n\nThis will not work with Windows guests.\n\n=back\n\nFor example:\n\n virt-customize --chown '0:0:/var/log/audit.log'\n\nSee also: I<--upload>.";
 |  | ||||||
|      ( |  | ||||||
|        [ L"commands-from-file" ], |  | ||||||
|        Getopt.String ( |  | ||||||
| diff --git a/common/mlcustomize/customize_cmdline.mli b/common/mlcustomize/customize_cmdline.mli
 |  | ||||||
| index 5883bbe0..112b74dc 100644
 |  | ||||||
| --- a/common/mlcustomize/customize_cmdline.mli
 |  | ||||||
| +++ b/common/mlcustomize/customize_cmdline.mli
 |  | ||||||
| @@ -33,8 +33,8 @@ and op = [
 |  | ||||||
|        (* --append-line FILE:LINE *) |  | ||||||
|    | `Chmod of string * string |  | ||||||
|        (* --chmod PERMISSIONS:FILE *) |  | ||||||
| -  | `Chown of string * string
 |  | ||||||
| -      (* --chown UID.GID:PATH *)
 |  | ||||||
| +  | `Chown of string * string * string
 |  | ||||||
| +      (* --chown UID:GID:PATH *)
 |  | ||||||
|    | `CommandsFromFile of string |  | ||||||
|        (* --commands-from-file FILENAME *) |  | ||||||
|    | `Copy of string * string |  | ||||||
| diff --git a/generator/customize.ml b/generator/customize.ml
 |  | ||||||
| index 8d3dec3e..fe87ef5e 100644
 |  | ||||||
| --- a/generator/customize.ml
 |  | ||||||
| +++ b/generator/customize.ml
 |  | ||||||
| @@ -41,6 +41,7 @@ and op_type =
 |  | ||||||
|  | Unit                                  (* no argument *) |  | ||||||
|  | String of string                      (* string *) |  | ||||||
|  | StringPair of string                  (* string:string *) |  | ||||||
| +| StringTriplet of string               (* string:string:string *)
 |  | ||||||
|  | StringList of string                  (* string,string,... *) |  | ||||||
|  | TargetLinks of string                 (* target:link[:link...] *) |  | ||||||
|  | PasswordSelector of string            (* password selector *) |  | ||||||
| @@ -96,7 +97,7 @@ it with C<0> to get octal, ie. use C<0700> not C<700>.";
 |  | ||||||
|    }; |  | ||||||
|   |  | ||||||
|    { op_name = "chown"; |  | ||||||
| -    op_type = StringPair "UID.GID:PATH";
 |  | ||||||
| +    op_type = StringTriplet "UID:GID:PATH";
 |  | ||||||
|      op_discrim = "`Chown"; |  | ||||||
|      op_shortdesc = "Change the owner user and group ID of a file or directory"; |  | ||||||
|      op_pod_longdesc = "\ |  | ||||||
| @@ -118,7 +119,7 @@ This will not work with Windows guests.
 |  | ||||||
|   |  | ||||||
|  For example: |  | ||||||
|   |  | ||||||
| - virt-customize --chown '0.0:/var/log/audit.log'
 |  | ||||||
| + virt-customize --chown '0:0:/var/log/audit.log'
 |  | ||||||
|   |  | ||||||
|  See also: I<--upload>."; |  | ||||||
|    }; |  | ||||||
| @@ -761,8 +762,13 @@ let rec argspec () =
 |  | ||||||
|            option_name in |  | ||||||
|      let len = String.length arg in |  | ||||||
|      String.sub arg 0 i, String.sub arg (i+1) (len-(i+1)) |  | ||||||
| -  in
 |  | ||||||
| -  let split_string_list arg =
 |  | ||||||
| +  and split_string_triplet option_name arg =
 |  | ||||||
| +    match String.nsplit ~max:3 \",\" arg with
 |  | ||||||
| +    | [a; b; c] -> a, b, c
 |  | ||||||
| +    | _ ->
 |  | ||||||
| +        error (f_\"invalid format for '--%%s' parameter, see the man page\")
 |  | ||||||
| +          option_name
 |  | ||||||
| +  and split_string_list arg =
 |  | ||||||
|      String.nsplit \",\" arg |  | ||||||
|    in |  | ||||||
|    let split_links_list option_name arg = |  | ||||||
| @@ -807,6 +813,19 @@ let rec argspec () =
 |  | ||||||
|        pr "      s_\"%s\"\n" shortdesc; |  | ||||||
|        pr "    ),\n"; |  | ||||||
|        pr "    Some %S, %S;\n" v longdesc |  | ||||||
| +    | { op_type = StringTriplet v; op_name = name; op_discrim = discrim;
 |  | ||||||
| +        op_shortdesc = shortdesc; op_pod_longdesc = longdesc } ->
 |  | ||||||
| +      pr "    (\n";
 |  | ||||||
| +      pr "      [ L\"%s\" ],\n" name;
 |  | ||||||
| +      pr "      Getopt.String (\n";
 |  | ||||||
| +      pr "        s_\"%s\",\n" v;
 |  | ||||||
| +      pr "        fun s ->\n";
 |  | ||||||
| +      pr "          let p = split_string_triplet \"%s\" s in\n" name;
 |  | ||||||
| +      pr "          List.push_front (%s p) ops\n" discrim;
 |  | ||||||
| +      pr "      ),\n";
 |  | ||||||
| +      pr "      s_\"%s\"\n" shortdesc;
 |  | ||||||
| +      pr "    ),\n";
 |  | ||||||
| +      pr "    Some %S, %S;\n" v longdesc
 |  | ||||||
|      | { op_type = StringList v; op_name = name; op_discrim = discrim; |  | ||||||
|          op_shortdesc = shortdesc; op_pod_longdesc = longdesc } -> |  | ||||||
|        pr "    (\n"; |  | ||||||
| @@ -956,6 +975,7 @@ let rec argspec () =
 |  | ||||||
|      | { op_type = Unit; } |  | ||||||
|      | { op_type = String _; } |  | ||||||
|      | { op_type = StringPair _; } |  | ||||||
| +    | { op_type = StringTriplet _; }
 |  | ||||||
|      | { op_type = StringList _; } |  | ||||||
|      | { op_type = TargetLinks _; } |  | ||||||
|      | { op_type = PasswordSelector _; } |  | ||||||
| @@ -1021,6 +1041,10 @@ type ops = {
 |  | ||||||
|      | { op_type = StringPair v; op_discrim = discrim; |  | ||||||
|          op_name = name } -> |  | ||||||
|        pr "  | %s of string * string\n      (* --%s %s *)\n" discrim name v |  | ||||||
| +    | { op_type = StringTriplet v; op_discrim = discrim;
 |  | ||||||
| +        op_name = name } ->
 |  | ||||||
| +      pr "  | %s of string * string * string\n      (* --%s %s *)\n"
 |  | ||||||
| +        discrim name v
 |  | ||||||
|      | { op_type = StringList v; op_discrim = discrim; |  | ||||||
|          op_name = name } -> |  | ||||||
|        pr "  | %s of string list\n      (* --%s %s *)\n" discrim name v |  | ||||||
| @@ -1073,9 +1097,9 @@ let generate_customize_synopsis_pod () =
 |  | ||||||
|        function |  | ||||||
|        | { op_type = Unit; op_name = n } -> |  | ||||||
|          n, sprintf "[--%s]" n |  | ||||||
| -      | { op_type = String v | StringPair v | StringList v | TargetLinks v
 |  | ||||||
| -            | PasswordSelector v | UserPasswordSelector v | SSHKeySelector v
 |  | ||||||
| -            | StringFn (v, _) | SMPoolSelector v;
 |  | ||||||
| +      | { op_type = String v | StringPair v | StringTriplet v | StringList v
 |  | ||||||
| +            | TargetLinks v | PasswordSelector v | UserPasswordSelector v
 |  | ||||||
| +            | SSHKeySelector v | StringFn (v, _) | SMPoolSelector v;
 |  | ||||||
|            op_name = n } -> |  | ||||||
|          n, sprintf "[--%s %s]" n v |  | ||||||
|      ) ops @ |  | ||||||
| @@ -1116,9 +1140,9 @@ let generate_customize_options_pod () =
 |  | ||||||
|        function |  | ||||||
|        | { op_type = Unit; op_name = n; op_pod_longdesc = ld } -> |  | ||||||
|          n, sprintf "B<--%s>" n, ld |  | ||||||
| -      | { op_type = String v | StringPair v | StringList v | TargetLinks v
 |  | ||||||
| -            | PasswordSelector v | UserPasswordSelector v | SSHKeySelector v
 |  | ||||||
| -            | StringFn (v, _) | SMPoolSelector v;
 |  | ||||||
| +      | { op_type = String v | StringPair v | StringTriplet v | StringList v
 |  | ||||||
| +            | TargetLinks v | PasswordSelector v | UserPasswordSelector v
 |  | ||||||
| +            | SSHKeySelector v | StringFn (v, _) | SMPoolSelector v;
 |  | ||||||
|            op_name = n; op_pod_longdesc = ld } -> |  | ||||||
|          n, sprintf "B<--%s> %s" n v, ld |  | ||||||
|      ) ops @ |  | ||||||
| @ -1,4 +1,4 @@ | |||||||
| From a3ac31c6dc06a83086c1de2f013ce907883b343b Mon Sep 17 00:00:00 2001 | From 0d466cb25e86ab6f7f6838d35afb37b99f83e0e4 Mon Sep 17 00:00:00 2001 | ||||||
| From: "Richard W.M. Jones" <rjones@redhat.com> | From: "Richard W.M. Jones" <rjones@redhat.com> | ||||||
| Date: Wed, 16 Apr 2025 10:13:52 +0100 | Date: Wed, 16 Apr 2025 10:13:52 +0100 | ||||||
| Subject: [PATCH] daemon: inspect: Resolve Ubuntu 22+ /dev/disk/by-uuid/ in | Subject: [PATCH] daemon: inspect: Resolve Ubuntu 22+ /dev/disk/by-uuid/ in | ||||||
| @ -16,7 +16,6 @@ The comment is generated by the installer and appears in the fstab. | |||||||
| This entry would be translated to /dev/sda2. | This entry would be translated to /dev/sda2. | ||||||
| 
 | 
 | ||||||
| (cherry picked from commit 7a1ffd744b12c4c79fa1b78341ea714d831f4205) | (cherry picked from commit 7a1ffd744b12c4c79fa1b78341ea714d831f4205) | ||||||
| (cherry picked from commit 0d466cb25e86ab6f7f6838d35afb37b99f83e0e4) |  | ||||||
| ---
 | ---
 | ||||||
|  daemon/inspect_fs_unix_fstab.ml | 13 +++++++++++++ |  daemon/inspect_fs_unix_fstab.ml | 13 +++++++++++++ | ||||||
|  1 file changed, 13 insertions(+) |  1 file changed, 13 insertions(+) | ||||||
| @ -1,57 +0,0 @@ | |||||||
| From 981b48085a2d0e422578bc12d6c3b68e312bad44 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 * |  | ||||||
| @ -1,4 +1,4 @@ | |||||||
| From af2e259ff72d5a41c9cfe453a67ecff77190cbc6 Mon Sep 17 00:00:00 2001 | From 1b64c54b8a7f3a0ada0cc52fc74d800a55318112 Mon Sep 17 00:00:00 2001 | ||||||
| From: "Richard W.M. Jones" <rjones@redhat.com> | From: "Richard W.M. Jones" <rjones@redhat.com> | ||||||
| Date: Wed, 16 Apr 2025 13:19:17 +0100 | Date: Wed, 16 Apr 2025 13:19:17 +0100 | ||||||
| Subject: [PATCH] generator: Fix implementation of FUUID for OCaml functions | Subject: [PATCH] generator: Fix implementation of FUUID for OCaml functions | ||||||
| @ -11,16 +11,15 @@ by OCaml is correct (if not we just assert, it's an internal error). | |||||||
| (It didn't even compile before, so we know it was never used). | (It didn't even compile before, so we know it was never used). | ||||||
| 
 | 
 | ||||||
| (cherry picked from commit bcd6b3ec3a1038d840e832732b3910f939566436) | (cherry picked from commit bcd6b3ec3a1038d840e832732b3910f939566436) | ||||||
| (cherry picked from commit 1b64c54b8a7f3a0ada0cc52fc74d800a55318112) |  | ||||||
| ---
 | ---
 | ||||||
|  generator/daemon.ml | 6 +++++- |  generator/daemon.ml | 6 +++++- | ||||||
|  1 file changed, 5 insertions(+), 1 deletion(-) |  1 file changed, 5 insertions(+), 1 deletion(-) | ||||||
| 
 | 
 | ||||||
| diff --git a/generator/daemon.ml b/generator/daemon.ml
 | diff --git a/generator/daemon.ml b/generator/daemon.ml
 | ||||||
| index 0218d3e5..d9f22c51 100644
 | index 0baa7708..91decf40 100644
 | ||||||
| --- a/generator/daemon.ml
 | --- a/generator/daemon.ml
 | ||||||
| +++ b/generator/daemon.ml
 | +++ b/generator/daemon.ml
 | ||||||
| @@ -611,6 +611,7 @@ let generate_daemon_caml_stubs () =
 | @@ -606,6 +606,7 @@ let generate_daemon_caml_stubs () =
 | ||||||
|  #include <string.h> |  #include <string.h> | ||||||
|  #include <inttypes.h> |  #include <inttypes.h> | ||||||
|  #include <errno.h> |  #include <errno.h> | ||||||
| @ -28,7 +27,7 @@ index 0218d3e5..d9f22c51 100644 | |||||||
|   |   | ||||||
|  #include <caml/alloc.h> |  #include <caml/alloc.h> | ||||||
|  #include <caml/callback.h> |  #include <caml/callback.h> | ||||||
| @@ -646,9 +647,12 @@ let generate_daemon_caml_stubs () =
 | @@ -641,9 +642,12 @@ let generate_daemon_caml_stubs () =
 | ||||||
|        fun i -> |        fun i -> | ||||||
|          pr "  v = Field (retv, %d);\n" i; |          pr "  v = Field (retv, %d);\n" i; | ||||||
|          function |          function | ||||||
| @ -1,208 +0,0 @@ | |||||||
| From 12873e21070ba3d0aca45b626f4df00adb14aad5 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() |  | ||||||
| @ -1,17 +1,15 @@ | |||||||
| From e0798c2658a1f9f44380224b93de7e42869b3a3b Mon Sep 17 00:00:00 2001 | From c7930f21405720f51d74efa9f6f7b9da0132a929 Mon Sep 17 00:00:00 2001 | ||||||
| From: "Richard W.M. Jones" <rjones@redhat.com> | From: "Richard W.M. Jones" <rjones@redhat.com> | ||||||
| Date: Wed, 16 Apr 2025 21:31:49 +0100 | Date: Wed, 16 Apr 2025 21:31:49 +0100 | ||||||
| Subject: [PATCH] Update common submodule | Subject: [PATCH] Update common submodule | ||||||
| 
 | 
 | ||||||
|   Richard W.M. Jones (1): |   Richard W.M. Jones (1): | ||||||
|       mlstdutils: Implement String.implode |       mlstdutils: Implement String.implode | ||||||
| 
 |  | ||||||
| (cherry picked from commit c7930f21405720f51d74efa9f6f7b9da0132a929) |  | ||||||
| ---
 | ---
 | ||||||
|  common | 2 +- |  common | 2 +- | ||||||
|  1 file changed, 1 insertion(+), 1 deletion(-) |  1 file changed, 1 insertion(+), 1 deletion(-) | ||||||
| 
 | 
 | ||||||
| Submodule common 93a7f3af..9c178a92: | Submodule common e9eea65a..8aed7b6a: | ||||||
| diff --git a/common/mlstdutils/std_utils.ml b/common/mlstdutils/std_utils.ml
 | diff --git a/common/mlstdutils/std_utils.ml b/common/mlstdutils/std_utils.ml
 | ||||||
| index 86b21a7c..1177ff69 100644
 | index 86b21a7c..1177ff69 100644
 | ||||||
| --- a/common/mlstdutils/std_utils.ml
 | --- a/common/mlstdutils/std_utils.ml
 | ||||||
| @ -1,278 +0,0 @@ | |||||||
| From fbe7e96cee460e26a0ff6a9c293c155a78bfdfde 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'
 |  | ||||||
| @ -1,4 +1,4 @@ | |||||||
| From c34a91bb2301d2ba61849126c9d365760ff7bf5f Mon Sep 17 00:00:00 2001 | From 80b2fcb243613bc16217b5908941ed2607f398fd Mon Sep 17 00:00:00 2001 | ||||||
| From: "Richard W.M. Jones" <rjones@redhat.com> | From: "Richard W.M. Jones" <rjones@redhat.com> | ||||||
| Date: Wed, 16 Apr 2025 10:41:59 +0100 | Date: Wed, 16 Apr 2025 10:41:59 +0100 | ||||||
| Subject: [PATCH] daemon: Rewrite {pvs,vgs,lvs}-full APIs in OCaml | Subject: [PATCH] daemon: Rewrite {pvs,vgs,lvs}-full APIs in OCaml | ||||||
| @ -13,7 +13,6 @@ already supports many more fields.  We should replace these with APIs | |||||||
| for getting single named fields from LVM. | for getting single named fields from LVM. | ||||||
| 
 | 
 | ||||||
| (cherry picked from commit a73f248369d35249a9324a0e0df9f7ccd1420d3f) | (cherry picked from commit a73f248369d35249a9324a0e0df9f7ccd1420d3f) | ||||||
| (cherry picked from commit 80b2fcb243613bc16217b5908941ed2607f398fd) |  | ||||||
| ---
 | ---
 | ||||||
|  .gitignore                |   2 +- |  .gitignore                |   2 +- | ||||||
|  daemon/Makefile.am        |   5 +- |  daemon/Makefile.am        |   5 +- | ||||||
| @ -31,7 +30,7 @@ for getting single named fields from LVM. | |||||||
|  create mode 100644 daemon/lvm_full.ml |  create mode 100644 daemon/lvm_full.ml | ||||||
| 
 | 
 | ||||||
| diff --git a/.gitignore b/.gitignore
 | diff --git a/.gitignore b/.gitignore
 | ||||||
| index 73a561c2..f58f909d 100644
 | index 68b27c79..c5e8f802 100644
 | ||||||
| --- a/.gitignore
 | --- a/.gitignore
 | ||||||
| +++ b/.gitignore
 | +++ b/.gitignore
 | ||||||
| @@ -97,7 +97,7 @@ Makefile.in
 | @@ -97,7 +97,7 @@ Makefile.in
 | ||||||
| @ -44,7 +43,7 @@ index 73a561c2..f58f909d 100644 | |||||||
|  /daemon/mount.mli |  /daemon/mount.mli | ||||||
|  /daemon/names.c |  /daemon/names.c | ||||||
| diff --git a/daemon/Makefile.am b/daemon/Makefile.am
 | diff --git a/daemon/Makefile.am b/daemon/Makefile.am
 | ||||||
| index 7109e114..409c5ca7 100644
 | index bb72c024..90ece846 100644
 | ||||||
| --- a/daemon/Makefile.am
 | --- a/daemon/Makefile.am
 | ||||||
| +++ b/daemon/Makefile.am
 | +++ b/daemon/Makefile.am
 | ||||||
| @@ -22,7 +22,6 @@ BUILT_SOURCES = \
 | @@ -22,7 +22,6 @@ BUILT_SOURCES = \
 | ||||||
| @ -63,7 +62,7 @@ index 7109e114..409c5ca7 100644 | |||||||
|  	md.mli \ |  	md.mli \ | ||||||
|  	mount.mli \ |  	mount.mli \ | ||||||
|  	optgroups.ml \ |  	optgroups.ml \ | ||||||
| @@ -151,7 +151,6 @@ guestfsd_SOURCES = \
 | @@ -152,7 +152,6 @@ guestfsd_SOURCES = \
 | ||||||
|  	luks.c \ |  	luks.c \ | ||||||
|  	lvm.c \ |  	lvm.c \ | ||||||
|  	lvm-filter.c \ |  	lvm-filter.c \ | ||||||
| @ -71,7 +70,7 @@ index 7109e114..409c5ca7 100644 | |||||||
|  	md.c \ |  	md.c \ | ||||||
|  	mkfs.c \ |  	mkfs.c \ | ||||||
|  	mknod.c \ |  	mknod.c \ | ||||||
| @@ -296,6 +295,7 @@ SOURCES_MLI = \
 | @@ -298,6 +297,7 @@ SOURCES_MLI = \
 | ||||||
|  	listfs.mli \ |  	listfs.mli \ | ||||||
|  	lvm.mli \ |  	lvm.mli \ | ||||||
|  	lvm_dm.mli \ |  	lvm_dm.mli \ | ||||||
| @ -79,7 +78,7 @@ index 7109e114..409c5ca7 100644 | |||||||
|  	lvm_utils.mli \ |  	lvm_utils.mli \ | ||||||
|  	md.mli \ |  	md.mli \ | ||||||
|  	mount.mli \ |  	mount.mli \ | ||||||
| @@ -329,6 +329,7 @@ SOURCES_ML = \
 | @@ -333,6 +333,7 @@ SOURCES_ML = \
 | ||||||
|  	ldm.ml \ |  	ldm.ml \ | ||||||
|  	link.ml \ |  	link.ml \ | ||||||
|  	lvm.ml \ |  	lvm.ml \ | ||||||
| @ -360,7 +359,7 @@ index 0038f95e..cdfb1d61 100644 | |||||||
|  daemon/md.c |  daemon/md.c | ||||||
|  daemon/mkfs.c |  daemon/mkfs.c | ||||||
| diff --git a/generator/actions_core.ml b/generator/actions_core.ml
 | diff --git a/generator/actions_core.ml b/generator/actions_core.ml
 | ||||||
| index 60c4b577..32dd47c7 100644
 | index eb047b6b..01991dd0 100644
 | ||||||
| --- a/generator/actions_core.ml
 | --- a/generator/actions_core.ml
 | ||||||
| +++ b/generator/actions_core.ml
 | +++ b/generator/actions_core.ml
 | ||||||
| @@ -1767,6 +1767,7 @@ See also C<guestfs_lvs_full>, C<guestfs_list_filesystems>." };
 | @@ -1767,6 +1767,7 @@ See also C<guestfs_lvs_full>, C<guestfs_list_filesystems>." };
 | ||||||
| @ -388,10 +387,10 @@ index 60c4b577..32dd47c7 100644 | |||||||
|      shortdesc = "list the LVM logical volumes (LVs)"; |      shortdesc = "list the LVM logical volumes (LVs)"; | ||||||
|      longdesc = "\ |      longdesc = "\ | ||||||
| diff --git a/generator/daemon.ml b/generator/daemon.ml
 | diff --git a/generator/daemon.ml b/generator/daemon.ml
 | ||||||
| index d9f22c51..25be2bef 100644
 | index 91decf40..f9b77a18 100644
 | ||||||
| --- a/generator/daemon.ml
 | --- a/generator/daemon.ml
 | ||||||
| +++ b/generator/daemon.ml
 | +++ b/generator/daemon.ml
 | ||||||
| @@ -956,196 +956,6 @@ let generate_daemon_dispatch () =
 | @@ -951,196 +951,6 @@ let generate_daemon_dispatch () =
 | ||||||
|    pr "}\n"; |    pr "}\n"; | ||||||
|    pr "\n" |    pr "\n" | ||||||
|   |   | ||||||
| @ -601,7 +600,7 @@ index edf331a9..77c6e632 100644 | |||||||
|  val generate_daemon_optgroups_c : unit -> unit |  val generate_daemon_optgroups_c : unit -> unit | ||||||
|  val generate_daemon_optgroups_h : unit -> unit |  val generate_daemon_optgroups_h : unit -> unit | ||||||
| diff --git a/generator/main.ml b/generator/main.ml
 | diff --git a/generator/main.ml b/generator/main.ml
 | ||||||
| index e124047e..18afd3bb 100644
 | index ff5e964a..6e36d9c7 100644
 | ||||||
| --- a/generator/main.ml
 | --- a/generator/main.ml
 | ||||||
| +++ b/generator/main.ml
 | +++ b/generator/main.ml
 | ||||||
| @@ -147,8 +147,6 @@ Run it from the top source directory using the command
 | @@ -147,8 +147,6 @@ Run it from the top source directory using the command
 | ||||||
| @ -1,63 +0,0 @@ | |||||||
| From 7408a59c6b43253cc7323269258851fb6be287c4 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"; |  | ||||||
| @ -1,4 +1,4 @@ | |||||||
| From 2f529e9a07eb351510a880a4256111014bcf9235 Mon Sep 17 00:00:00 2001 | From 180293338e0d127d0545fe03b6141ed04e22e441 Mon Sep 17 00:00:00 2001 | ||||||
| From: "Richard W.M. Jones" <rjones@redhat.com> | From: "Richard W.M. Jones" <rjones@redhat.com> | ||||||
| Date: Wed, 16 Apr 2025 10:27:25 +0100 | Date: Wed, 16 Apr 2025 10:27:25 +0100 | ||||||
| Subject: [PATCH] daemon: inspect: Resolve Ubuntu 22+ | Subject: [PATCH] daemon: inspect: Resolve Ubuntu 22+ | ||||||
| @ -25,7 +25,6 @@ Reported-by: Jaroslav Spanko | |||||||
| Thanks: Daniel Berrange | Thanks: Daniel Berrange | ||||||
| Fixes: https://issues.redhat.com/browse/RHEL-87493 | Fixes: https://issues.redhat.com/browse/RHEL-87493 | ||||||
| (cherry picked from commit e43ca1912973b3ddfa73b09a4690aa8bb26e08af) | (cherry picked from commit e43ca1912973b3ddfa73b09a4690aa8bb26e08af) | ||||||
| (cherry picked from commit 180293338e0d127d0545fe03b6141ed04e22e441) |  | ||||||
| ---
 | ---
 | ||||||
|  daemon/inspect_fs_unix_fstab.ml | 21 +++++++++++++++++++++ |  daemon/inspect_fs_unix_fstab.ml | 21 +++++++++++++++++++++ | ||||||
|  1 file changed, 21 insertions(+) |  1 file changed, 21 insertions(+) | ||||||
| @ -1,173 +0,0 @@ | |||||||
| From 3cf513cab7bc93a80c8d9f1dea221cba471cafb9 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"; |  | ||||||
| @ -1,271 +0,0 @@ | |||||||
| From 8dc3b9fb23e4af1b6a5271a7d40d6c2706cf1f78 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+', |  | ||||||
| @ -1,21 +1,19 @@ | |||||||
| From 4c7c0bca7a433ad03cdbc9128f53a1904758f8fb Mon Sep 17 00:00:00 2001 | From 14b2ac2d5f087b0d8fc8c1e0451cae22af753734 Mon Sep 17 00:00:00 2001 | ||||||
| From: "Richard W.M. Jones" <rjones@redhat.com> | From: "Richard W.M. Jones" <rjones@redhat.com> | ||||||
| Date: Fri, 25 Apr 2025 15:14:24 +0100 | Date: Fri, 25 Apr 2025 15:14:24 +0100 | ||||||
| Subject: [PATCH] daemon/fstrim.c: Run the fstrim command twice | Subject: [PATCH] RHEL 9: daemon/fstrim.c: Run the fstrim command twice | ||||||
| 
 | 
 | ||||||
| In upstream kernels, for XFS, you may have to run fstrim twice for it | Workaround for https://issues.redhat.com/browse/RHEL-88450 | ||||||
| to be effective. |  | ||||||
| 
 | 
 | ||||||
| Fixes: https://issues.redhat.com/browse/RHEL-88508 | Fixes: https://issues.redhat.com/browse/RHEL-88508 | ||||||
| Related: https://issues.redhat.com/browse/RHEL-88450 | Related: https://issues.redhat.com/browse/RHEL-88450 | ||||||
| Thanks: Eric Sandeen | Thanks: Eric Sandeen | ||||||
| (cherry picked from commit ca87485eea79d2c8943458f8f4ff12e72ce2eb0b) |  | ||||||
| ---
 | ---
 | ||||||
|  daemon/fstrim.c | 11 +++++++++++ |  daemon/fstrim.c | 11 +++++++++++ | ||||||
|  1 file changed, 11 insertions(+) |  1 file changed, 11 insertions(+) | ||||||
| 
 | 
 | ||||||
| diff --git a/daemon/fstrim.c b/daemon/fstrim.c
 | diff --git a/daemon/fstrim.c b/daemon/fstrim.c
 | ||||||
| index 3928f8bb..474ef72d 100644
 | index f6869042..06707a7f 100644
 | ||||||
| --- a/daemon/fstrim.c
 | --- a/daemon/fstrim.c
 | ||||||
| +++ b/daemon/fstrim.c
 | +++ b/daemon/fstrim.c
 | ||||||
| @@ -101,8 +101,19 @@ do_fstrim (const char *path,
 | @@ -101,8 +101,19 @@ do_fstrim (const char *path,
 | ||||||
| @ -1,590 +0,0 @@ | |||||||
| From 86408417cfe9d742b70104187e52b775e89e497e Mon Sep 17 00:00:00 2001 |  | ||||||
| From: "Richard W.M. Jones" <rjones@redhat.com> |  | ||||||
| Date: Thu, 16 Nov 2023 10:52:11 +0000 |  | ||||||
| Subject: [PATCH] New mailing list archives |  | ||||||
| 
 |  | ||||||
| (cherry picked from commit b2f3994de26c25d61ed94d2ee3b2ea9600755ee1) |  | ||||||
| ---
 |  | ||||||
|  README                      |  2 +- |  | ||||||
|  configure.ac                |  2 +- |  | ||||||
|  docs/guestfs-faq.pod        |  6 +++--- |  | ||||||
|  docs/guestfs-hacking.pod    |  2 +- |  | ||||||
|  docs/guestfs-security.pod   |  2 +- |  | ||||||
|  docs/guestfs-testing.pod    |  2 +- |  | ||||||
|  po-docs/cs.po               |  4 ++-- |  | ||||||
|  po-docs/de.po               |  4 ++-- |  | ||||||
|  po-docs/en_GB.po            |  8 ++++---- |  | ||||||
|  po-docs/es.po               |  4 ++-- |  | ||||||
|  po-docs/eu.po               |  4 ++-- |  | ||||||
|  po-docs/fi.po               | 12 ++++++------ |  | ||||||
|  po-docs/fr.po               |  4 ++-- |  | ||||||
|  po-docs/ja.po               |  6 +++--- |  | ||||||
|  po-docs/libguestfs-docs.pot | 12 ++++++------ |  | ||||||
|  po-docs/nl.po               |  4 ++-- |  | ||||||
|  po-docs/pt_BR.po            |  4 ++-- |  | ||||||
|  po-docs/si.po               | 12 ++++++------ |  | ||||||
|  po-docs/tg.po               |  4 ++-- |  | ||||||
|  po-docs/uk.po               |  6 +++--- |  | ||||||
|  po-docs/zh_CN.po            |  4 ++-- |  | ||||||
|  website/index.html.in       |  2 +- |  | ||||||
|  22 files changed, 55 insertions(+), 55 deletions(-) |  | ||||||
| 
 |  | ||||||
| diff --git a/README b/README
 |  | ||||||
| index 40a7267e..b350edb5 100644
 |  | ||||||
| --- a/README
 |  | ||||||
| +++ b/README
 |  | ||||||
| @@ -6,7 +6,7 @@ disk images.  For more information see the home page:
 |  | ||||||
|  For discussion, development, patches, etc. please use the mailing |  | ||||||
|  list: |  | ||||||
|   |  | ||||||
| -  http://www.redhat.com/mailman/listinfo/libguestfs
 |  | ||||||
| +  https://lists.libguestfs.org
 |  | ||||||
|   |  | ||||||
|  To find out how to build libguestfs from source, read: |  | ||||||
|   |  | ||||||
| diff --git a/configure.ac b/configure.ac
 |  | ||||||
| index b72e99cf..92479e20 100644
 |  | ||||||
| --- a/configure.ac
 |  | ||||||
| +++ b/configure.ac
 |  | ||||||
| @@ -321,7 +321,7 @@ echo "If any optional component is configured 'no' when you expected 'yes'"
 |  | ||||||
|  echo "then you should check the preceding messages." |  | ||||||
|  echo |  | ||||||
|  echo "Please report bugs back to the mailing list:" |  | ||||||
| -echo "http://www.redhat.com/mailman/listinfo/libguestfs"
 |  | ||||||
| +echo "https://lists.libguestfs.org"
 |  | ||||||
|  echo |  | ||||||
|  echo "Next you should type 'make' to build the package," |  | ||||||
|  echo "then 'make check' to run the tests." |  | ||||||
| diff --git a/docs/guestfs-faq.pod b/docs/guestfs-faq.pod
 |  | ||||||
| index 1e83a9c5..3a03282f 100644
 |  | ||||||
| --- a/docs/guestfs-faq.pod
 |  | ||||||
| +++ b/docs/guestfs-faq.pod
 |  | ||||||
| @@ -106,7 +106,7 @@ contact S<Red Hat Support>: L<http://redhat.com/support>
 |  | ||||||
|   |  | ||||||
|  There is a mailing list, mainly for development, but users are also |  | ||||||
|  welcome to ask questions about libguestfs and the virt tools: |  | ||||||
| -L<https://www.redhat.com/mailman/listinfo/libguestfs>
 |  | ||||||
| +L<https://lists.libguestfs.org>
 |  | ||||||
|   |  | ||||||
|  You can also talk to us on IRC channel C<#guestfs> on Libera Chat. |  | ||||||
|  We're not always around, so please stay in the channel after asking |  | ||||||
| @@ -1289,7 +1289,7 @@ documented stable API.
 |  | ||||||
|  =head2 Where do I send patches? |  | ||||||
|   |  | ||||||
|  Please send patches to the libguestfs mailing list |  | ||||||
| -L<https://www.redhat.com/mailman/listinfo/libguestfs>.  You don't have
 |  | ||||||
| +L<https://lists.libguestfs.org>.  You don't have
 |  | ||||||
|  to be subscribed, but there will be a delay until your posting is |  | ||||||
|  manually approved. |  | ||||||
|   |  | ||||||
| @@ -1302,7 +1302,7 @@ prefer to have a linear history.
 |  | ||||||
|   |  | ||||||
|  Large new features that you intend to contribute should be discussed |  | ||||||
|  on the mailing list first |  | ||||||
| -(L<https://www.redhat.com/mailman/listinfo/libguestfs>).  This avoids
 |  | ||||||
| +(L<https://lists.libguestfs.org>).  This avoids
 |  | ||||||
|  disappointment and wasted work if we don't think the feature would fit |  | ||||||
|  into the libguestfs project. |  | ||||||
|   |  | ||||||
| diff --git a/docs/guestfs-hacking.pod b/docs/guestfs-hacking.pod
 |  | ||||||
| index e1b47ec1..987697b2 100644
 |  | ||||||
| --- a/docs/guestfs-hacking.pod
 |  | ||||||
| +++ b/docs/guestfs-hacking.pod
 |  | ||||||
| @@ -804,7 +804,7 @@ examining the F<tmp/valgrind*> log files carefully.
 |  | ||||||
|  =head2 SUBMITTING PATCHES |  | ||||||
|   |  | ||||||
|  Submit patches to the mailing list: |  | ||||||
| -L<http://www.redhat.com/mailman/listinfo/libguestfs>
 |  | ||||||
| +L<https://lists.libguestfs.org>
 |  | ||||||
|  and CC to L<rjones@redhat.com>. |  | ||||||
|   |  | ||||||
|  You do not need to subscribe to the mailing list if you don’t want to. |  | ||||||
| diff --git a/docs/guestfs-security.pod b/docs/guestfs-security.pod
 |  | ||||||
| index afacb091..60d22952 100644
 |  | ||||||
| --- a/docs/guestfs-security.pod
 |  | ||||||
| +++ b/docs/guestfs-security.pod
 |  | ||||||
| @@ -15,7 +15,7 @@ L<https://access.redhat.com/security/team/contact>
 |  | ||||||
|   |  | ||||||
|  If the security problem is not so serious, you can simply file a bug |  | ||||||
|  (see L</BUGS> below), or send an email to our mailing list |  | ||||||
| -(L<https://www.redhat.com/mailman/listinfo/libguestfs>).  You do not
 |  | ||||||
| +(L<https://lists.libguestfs.org>).  You do not
 |  | ||||||
|  need to subscribe to the mailing list to send email, but there will be |  | ||||||
|  a delay while the message is moderated. |  | ||||||
|   |  | ||||||
| diff --git a/docs/guestfs-testing.pod b/docs/guestfs-testing.pod
 |  | ||||||
| index c7b44928..ee4b26d6 100644
 |  | ||||||
| --- a/docs/guestfs-testing.pod
 |  | ||||||
| +++ b/docs/guestfs-testing.pod
 |  | ||||||
| @@ -21,7 +21,7 @@ or post on the mailing list (registration is B<not> required, but if
 |  | ||||||
|  you're not registered then you'll have to wait for a moderator to |  | ||||||
|  manually approve your message): |  | ||||||
|   |  | ||||||
| -L<https://www.redhat.com/mailman/listinfo/libguestfs>
 |  | ||||||
| +L<https://lists.libguestfs.org>
 |  | ||||||
|   |  | ||||||
|  =head1 TESTS |  | ||||||
|   |  | ||||||
| diff --git a/po-docs/cs.po b/po-docs/cs.po
 |  | ||||||
| index d50e53bf..60c29165 100644
 |  | ||||||
| --- a/po-docs/cs.po
 |  | ||||||
| +++ b/po-docs/cs.po
 |  | ||||||
| @@ -16000,7 +16000,7 @@ msgstr ""
 |  | ||||||
|  #: ../docs/guestfs-faq.pod:1297 |  | ||||||
|  msgid "" |  | ||||||
|  "Large new features that you intend to contribute should be discussed on the " |  | ||||||
| -"mailing list first (L<https://www.redhat.com/mailman/listinfo/libguestfs>).  "
 |  | ||||||
| +"mailing list first (L<https://lists.libguestfs.org>).  "
 |  | ||||||
|  "This avoids disappointment and wasted work if we don't think the feature " |  | ||||||
|  "would fit into the libguestfs project." |  | ||||||
|  msgstr "" |  | ||||||
| @@ -38700,7 +38700,7 @@ msgstr ""
 |  | ||||||
|   |  | ||||||
|  #. type: textblock |  | ||||||
|  #: ../docs/guestfs-testing.pod:24 |  | ||||||
| -msgid "L<https://www.redhat.com/mailman/listinfo/libguestfs>"
 |  | ||||||
| +msgid "L<https://lists.libguestfs.org>"
 |  | ||||||
|  msgstr "" |  | ||||||
|   |  | ||||||
|  #. type: =head1 |  | ||||||
| diff --git a/po-docs/de.po b/po-docs/de.po
 |  | ||||||
| index 76abc8d3..565cd66f 100644
 |  | ||||||
| --- a/po-docs/de.po
 |  | ||||||
| +++ b/po-docs/de.po
 |  | ||||||
| @@ -16118,7 +16118,7 @@ msgstr ""
 |  | ||||||
|  #: ../docs/guestfs-faq.pod:1297 |  | ||||||
|  msgid "" |  | ||||||
|  "Large new features that you intend to contribute should be discussed on the " |  | ||||||
| -"mailing list first (L<https://www.redhat.com/mailman/listinfo/libguestfs>).  "
 |  | ||||||
| +"mailing list first (L<https://lists.libguestfs.org>).  "
 |  | ||||||
|  "This avoids disappointment and wasted work if we don't think the feature " |  | ||||||
|  "would fit into the libguestfs project." |  | ||||||
|  msgstr "" |  | ||||||
| @@ -38822,7 +38822,7 @@ msgstr ""
 |  | ||||||
|   |  | ||||||
|  #. type: textblock |  | ||||||
|  #: ../docs/guestfs-testing.pod:24 |  | ||||||
| -msgid "L<https://www.redhat.com/mailman/listinfo/libguestfs>"
 |  | ||||||
| +msgid "L<https://lists.libguestfs.org>"
 |  | ||||||
|  msgstr "" |  | ||||||
|   |  | ||||||
|  #. type: =head1 |  | ||||||
| diff --git a/po-docs/en_GB.po b/po-docs/en_GB.po
 |  | ||||||
| index 75610b9e..31edb8bf 100644
 |  | ||||||
| --- a/po-docs/en_GB.po
 |  | ||||||
| +++ b/po-docs/en_GB.po
 |  | ||||||
| @@ -17054,12 +17054,12 @@ msgstr "How do I propose a feature?"
 |  | ||||||
|  #: ../docs/guestfs-faq.pod:1297 |  | ||||||
|  msgid "" |  | ||||||
|  "Large new features that you intend to contribute should be discussed on the " |  | ||||||
| -"mailing list first (L<https://www.redhat.com/mailman/listinfo/libguestfs>).  "
 |  | ||||||
| +"mailing list first (L<https://lists.libguestfs.org>).  "
 |  | ||||||
|  "This avoids disappointment and wasted work if we don't think the feature " |  | ||||||
|  "would fit into the libguestfs project." |  | ||||||
|  msgstr "" |  | ||||||
|  "Large new features that you intend to contribute should be discussed on the " |  | ||||||
| -"mailing list first (L<https://www.redhat.com/mailman/listinfo/libguestfs>).  "
 |  | ||||||
| +"mailing list first (L<https://lists.libguestfs.org>).  "
 |  | ||||||
|  "This avoids disappointment and wasted work if we don't think the feature " |  | ||||||
|  "would fit into the libguestfs project." |  | ||||||
|   |  | ||||||
| @@ -42254,8 +42254,8 @@ msgstr ""
 |  | ||||||
|   |  | ||||||
|  #. type: textblock |  | ||||||
|  #: ../docs/guestfs-testing.pod:24 |  | ||||||
| -msgid "L<https://www.redhat.com/mailman/listinfo/libguestfs>"
 |  | ||||||
| -msgstr "L<https://www.redhat.com/mailman/listinfo/libguestfs>"
 |  | ||||||
| +msgid "L<https://lists.libguestfs.org>"
 |  | ||||||
| +msgstr "L<https://lists.libguestfs.org>"
 |  | ||||||
|   |  | ||||||
|  #. type: =head1 |  | ||||||
|  #: ../docs/guestfs-testing.pod:26 |  | ||||||
| diff --git a/po-docs/es.po b/po-docs/es.po
 |  | ||||||
| index defbd61d..c84192f4 100644
 |  | ||||||
| --- a/po-docs/es.po
 |  | ||||||
| +++ b/po-docs/es.po
 |  | ||||||
| @@ -16057,7 +16057,7 @@ msgstr ""
 |  | ||||||
|  #: ../docs/guestfs-faq.pod:1297 |  | ||||||
|  msgid "" |  | ||||||
|  "Large new features that you intend to contribute should be discussed on the " |  | ||||||
| -"mailing list first (L<https://www.redhat.com/mailman/listinfo/libguestfs>).  "
 |  | ||||||
| +"mailing list first (L<https://lists.libguestfs.org>).  "
 |  | ||||||
|  "This avoids disappointment and wasted work if we don't think the feature " |  | ||||||
|  "would fit into the libguestfs project." |  | ||||||
|  msgstr "" |  | ||||||
| @@ -38908,7 +38908,7 @@ msgstr ""
 |  | ||||||
|   |  | ||||||
|  #. type: textblock |  | ||||||
|  #: ../docs/guestfs-testing.pod:24 |  | ||||||
| -msgid "L<https://www.redhat.com/mailman/listinfo/libguestfs>"
 |  | ||||||
| +msgid "L<https://lists.libguestfs.org>"
 |  | ||||||
|  msgstr "" |  | ||||||
|   |  | ||||||
|  #. type: =head1 |  | ||||||
| diff --git a/po-docs/eu.po b/po-docs/eu.po
 |  | ||||||
| index 63653271..44bc885d 100644
 |  | ||||||
| --- a/po-docs/eu.po
 |  | ||||||
| +++ b/po-docs/eu.po
 |  | ||||||
| @@ -15951,7 +15951,7 @@ msgstr ""
 |  | ||||||
|  #: ../docs/guestfs-faq.pod:1297 |  | ||||||
|  msgid "" |  | ||||||
|  "Large new features that you intend to contribute should be discussed on the " |  | ||||||
| -"mailing list first (L<https://www.redhat.com/mailman/listinfo/libguestfs>).  "
 |  | ||||||
| +"mailing list first (L<https://lists.libguestfs.org>).  "
 |  | ||||||
|  "This avoids disappointment and wasted work if we don't think the feature " |  | ||||||
|  "would fit into the libguestfs project." |  | ||||||
|  msgstr "" |  | ||||||
| @@ -38651,7 +38651,7 @@ msgstr ""
 |  | ||||||
|   |  | ||||||
|  #. type: textblock |  | ||||||
|  #: ../docs/guestfs-testing.pod:24 |  | ||||||
| -msgid "L<https://www.redhat.com/mailman/listinfo/libguestfs>"
 |  | ||||||
| +msgid "L<https://lists.libguestfs.org>"
 |  | ||||||
|  msgstr "" |  | ||||||
|   |  | ||||||
|  #. type: =head1 |  | ||||||
| diff --git a/po-docs/fi.po b/po-docs/fi.po
 |  | ||||||
| index 361de115..3ff70b33 100644
 |  | ||||||
| --- a/po-docs/fi.po
 |  | ||||||
| +++ b/po-docs/fi.po
 |  | ||||||
| @@ -13507,7 +13507,7 @@ msgstr ""
 |  | ||||||
|  msgid "" |  | ||||||
|  "There is a mailing list, mainly for development, but users are also welcome " |  | ||||||
|  "to ask questions about libguestfs and the virt tools: " |  | ||||||
| -"L<https://www.redhat.com/mailman/listinfo/libguestfs>"
 |  | ||||||
| +"L<https://lists.libguestfs.org>"
 |  | ||||||
|  msgstr "" |  | ||||||
|   |  | ||||||
|  #. type: textblock |  | ||||||
| @@ -15849,7 +15849,7 @@ msgstr ""
 |  | ||||||
|  #: docs/guestfs-faq.pod:1285 |  | ||||||
|  msgid "" |  | ||||||
|  "Please send patches to the libguestfs mailing list " |  | ||||||
| -"L<https://www.redhat.com/mailman/listinfo/libguestfs>.  You don't have to be "
 |  | ||||||
| +"L<https://lists.libguestfs.org>.  You don't have to be "
 |  | ||||||
|  "subscribed, but there will be a delay until your posting is manually " |  | ||||||
|  "approved." |  | ||||||
|  msgstr "" |  | ||||||
| @@ -15872,7 +15872,7 @@ msgstr ""
 |  | ||||||
|  #: docs/guestfs-faq.pod:1297 |  | ||||||
|  msgid "" |  | ||||||
|  "Large new features that you intend to contribute should be discussed on the " |  | ||||||
| -"mailing list first (L<https://www.redhat.com/mailman/listinfo/libguestfs>).  "
 |  | ||||||
| +"mailing list first (L<https://lists.libguestfs.org>).  "
 |  | ||||||
|  "This avoids disappointment and wasted work if we don't think the feature " |  | ||||||
|  "would fit into the libguestfs project." |  | ||||||
|  msgstr "" |  | ||||||
| @@ -17816,7 +17816,7 @@ msgstr ""
 |  | ||||||
|  #: docs/guestfs-hacking.pod:840 |  | ||||||
|  msgid "" |  | ||||||
|  "Submit patches to the mailing list: " |  | ||||||
| -"L<http://www.redhat.com/mailman/listinfo/libguestfs> and CC to "
 |  | ||||||
| +"L<https://lists.libguestfs.org> and CC to "
 |  | ||||||
|  "L<rjones@redhat.com>." |  | ||||||
|  msgstr "" |  | ||||||
|   |  | ||||||
| @@ -37995,7 +37995,7 @@ msgstr ""
 |  | ||||||
|  msgid "" |  | ||||||
|  "If the security problem is not so serious, you can simply file a bug (see " |  | ||||||
|  "L</BUGS> below), or send an email to our mailing list " |  | ||||||
| -"(L<https://www.redhat.com/mailman/listinfo/libguestfs>).  You do not need to "
 |  | ||||||
| +"(L<https://lists.libguestfs.org>).  You do not need to "
 |  | ||||||
|  "subscribe to the mailing list to send email, but there will be a delay while " |  | ||||||
|  "the message is moderated." |  | ||||||
|  msgstr "" |  | ||||||
| @@ -38598,7 +38598,7 @@ msgstr ""
 |  | ||||||
|   |  | ||||||
|  #. type: textblock |  | ||||||
|  #: docs/guestfs-testing.pod:24 |  | ||||||
| -msgid "L<https://www.redhat.com/mailman/listinfo/libguestfs>"
 |  | ||||||
| +msgid "L<https://lists.libguestfs.org>"
 |  | ||||||
|  msgstr "" |  | ||||||
|   |  | ||||||
|  #. type: =head1 |  | ||||||
| diff --git a/po-docs/fr.po b/po-docs/fr.po
 |  | ||||||
| index cd903c0e..34b6149e 100644
 |  | ||||||
| --- a/po-docs/fr.po
 |  | ||||||
| +++ b/po-docs/fr.po
 |  | ||||||
| @@ -16363,7 +16363,7 @@ msgstr ""
 |  | ||||||
|  #: ../docs/guestfs-faq.pod:1297 |  | ||||||
|  msgid "" |  | ||||||
|  "Large new features that you intend to contribute should be discussed on the " |  | ||||||
| -"mailing list first (L<https://www.redhat.com/mailman/listinfo/libguestfs>).  "
 |  | ||||||
| +"mailing list first (L<https://lists.libguestfs.org>).  "
 |  | ||||||
|  "This avoids disappointment and wasted work if we don't think the feature " |  | ||||||
|  "would fit into the libguestfs project." |  | ||||||
|  msgstr "" |  | ||||||
| @@ -40728,7 +40728,7 @@ msgstr ""
 |  | ||||||
|   |  | ||||||
|  #. type: textblock |  | ||||||
|  #: ../docs/guestfs-testing.pod:24 |  | ||||||
| -msgid "L<https://www.redhat.com/mailman/listinfo/libguestfs>"
 |  | ||||||
| +msgid "L<https://lists.libguestfs.org>"
 |  | ||||||
|  msgstr "" |  | ||||||
|   |  | ||||||
|  #. type: =head1 |  | ||||||
| diff --git a/po-docs/ja.po b/po-docs/ja.po
 |  | ||||||
| index d90437dc..d00d73d2 100644
 |  | ||||||
| --- a/po-docs/ja.po
 |  | ||||||
| +++ b/po-docs/ja.po
 |  | ||||||
| @@ -16574,7 +16574,7 @@ msgstr ""
 |  | ||||||
|  #: ../docs/guestfs-faq.pod:1297 |  | ||||||
|  msgid "" |  | ||||||
|  "Large new features that you intend to contribute should be discussed on the " |  | ||||||
| -"mailing list first (L<https://www.redhat.com/mailman/listinfo/libguestfs>).  "
 |  | ||||||
| +"mailing list first (L<https://lists.libguestfs.org>).  "
 |  | ||||||
|  "This avoids disappointment and wasted work if we don't think the feature " |  | ||||||
|  "would fit into the libguestfs project." |  | ||||||
|  msgstr "" |  | ||||||
| @@ -39859,8 +39859,8 @@ msgstr ""
 |  | ||||||
|   |  | ||||||
|  #. type: textblock |  | ||||||
|  #: ../docs/guestfs-testing.pod:24 |  | ||||||
| -msgid "L<https://www.redhat.com/mailman/listinfo/libguestfs>"
 |  | ||||||
| -msgstr "L<https://www.redhat.com/mailman/listinfo/libguestfs>"
 |  | ||||||
| +msgid "L<https://lists.libguestfs.org>"
 |  | ||||||
| +msgstr "L<https://lists.libguestfs.org>"
 |  | ||||||
|   |  | ||||||
|  #. type: =head1 |  | ||||||
|  #: ../docs/guestfs-testing.pod:26 |  | ||||||
| diff --git a/po-docs/libguestfs-docs.pot b/po-docs/libguestfs-docs.pot
 |  | ||||||
| index 3954a51e..56d0777b 100644
 |  | ||||||
| --- a/po-docs/libguestfs-docs.pot
 |  | ||||||
| +++ b/po-docs/libguestfs-docs.pot
 |  | ||||||
| @@ -13453,7 +13453,7 @@ msgstr ""
 |  | ||||||
|  msgid "" |  | ||||||
|  "There is a mailing list, mainly for development, but users are also welcome " |  | ||||||
|  "to ask questions about libguestfs and the virt tools: " |  | ||||||
| -"L<https://www.redhat.com/mailman/listinfo/libguestfs>"
 |  | ||||||
| +"L<https://lists.libguestfs.org>"
 |  | ||||||
|  msgstr "" |  | ||||||
|   |  | ||||||
|  #. type: textblock |  | ||||||
| @@ -15795,7 +15795,7 @@ msgstr ""
 |  | ||||||
|  #: docs/guestfs-faq.pod:1285 |  | ||||||
|  msgid "" |  | ||||||
|  "Please send patches to the libguestfs mailing list " |  | ||||||
| -"L<https://www.redhat.com/mailman/listinfo/libguestfs>.  You don't have to be "
 |  | ||||||
| +"L<https://lists.libguestfs.org>.  You don't have to be "
 |  | ||||||
|  "subscribed, but there will be a delay until your posting is manually " |  | ||||||
|  "approved." |  | ||||||
|  msgstr "" |  | ||||||
| @@ -15818,7 +15818,7 @@ msgstr ""
 |  | ||||||
|  #: docs/guestfs-faq.pod:1297 |  | ||||||
|  msgid "" |  | ||||||
|  "Large new features that you intend to contribute should be discussed on the " |  | ||||||
| -"mailing list first (L<https://www.redhat.com/mailman/listinfo/libguestfs>).  "
 |  | ||||||
| +"mailing list first (L<https://lists.libguestfs.org>).  "
 |  | ||||||
|  "This avoids disappointment and wasted work if we don't think the feature " |  | ||||||
|  "would fit into the libguestfs project." |  | ||||||
|  msgstr "" |  | ||||||
| @@ -17762,7 +17762,7 @@ msgstr ""
 |  | ||||||
|  #: docs/guestfs-hacking.pod:840 |  | ||||||
|  msgid "" |  | ||||||
|  "Submit patches to the mailing list: " |  | ||||||
| -"L<http://www.redhat.com/mailman/listinfo/libguestfs> and CC to "
 |  | ||||||
| +"L<https://lists.libguestfs.org> and CC to "
 |  | ||||||
|  "L<rjones@redhat.com>." |  | ||||||
|  msgstr "" |  | ||||||
|   |  | ||||||
| @@ -37939,7 +37939,7 @@ msgstr ""
 |  | ||||||
|  msgid "" |  | ||||||
|  "If the security problem is not so serious, you can simply file a bug (see " |  | ||||||
|  "L</BUGS> below), or send an email to our mailing list " |  | ||||||
| -"(L<https://www.redhat.com/mailman/listinfo/libguestfs>).  You do not need to "
 |  | ||||||
| +"(L<https://lists.libguestfs.org>).  You do not need to "
 |  | ||||||
|  "subscribe to the mailing list to send email, but there will be a delay while " |  | ||||||
|  "the message is moderated." |  | ||||||
|  msgstr "" |  | ||||||
| @@ -38542,7 +38542,7 @@ msgstr ""
 |  | ||||||
|   |  | ||||||
|  #. type: textblock |  | ||||||
|  #: docs/guestfs-testing.pod:24 |  | ||||||
| -msgid "L<https://www.redhat.com/mailman/listinfo/libguestfs>"
 |  | ||||||
| +msgid "L<https://lists.libguestfs.org>"
 |  | ||||||
|  msgstr "" |  | ||||||
|   |  | ||||||
|  #. type: =head1 |  | ||||||
| diff --git a/po-docs/nl.po b/po-docs/nl.po
 |  | ||||||
| index 0cf147ee..1f8ac7d0 100644
 |  | ||||||
| --- a/po-docs/nl.po
 |  | ||||||
| +++ b/po-docs/nl.po
 |  | ||||||
| @@ -15951,7 +15951,7 @@ msgstr ""
 |  | ||||||
|  #: ../docs/guestfs-faq.pod:1297 |  | ||||||
|  msgid "" |  | ||||||
|  "Large new features that you intend to contribute should be discussed on the " |  | ||||||
| -"mailing list first (L<https://www.redhat.com/mailman/listinfo/libguestfs>).  "
 |  | ||||||
| +"mailing list first (L<https://lists.libguestfs.org>).  "
 |  | ||||||
|  "This avoids disappointment and wasted work if we don't think the feature " |  | ||||||
|  "would fit into the libguestfs project." |  | ||||||
|  msgstr "" |  | ||||||
| @@ -38651,7 +38651,7 @@ msgstr ""
 |  | ||||||
|   |  | ||||||
|  #. type: textblock |  | ||||||
|  #: ../docs/guestfs-testing.pod:24 |  | ||||||
| -msgid "L<https://www.redhat.com/mailman/listinfo/libguestfs>"
 |  | ||||||
| +msgid "L<https://lists.libguestfs.org>"
 |  | ||||||
|  msgstr "" |  | ||||||
|   |  | ||||||
|  #. type: =head1 |  | ||||||
| diff --git a/po-docs/pt_BR.po b/po-docs/pt_BR.po
 |  | ||||||
| index 229f49c3..d69895cf 100644
 |  | ||||||
| --- a/po-docs/pt_BR.po
 |  | ||||||
| +++ b/po-docs/pt_BR.po
 |  | ||||||
| @@ -15947,7 +15947,7 @@ msgstr ""
 |  | ||||||
|  #: ../docs/guestfs-faq.pod:1297 |  | ||||||
|  msgid "" |  | ||||||
|  "Large new features that you intend to contribute should be discussed on the " |  | ||||||
| -"mailing list first (L<https://www.redhat.com/mailman/listinfo/libguestfs>).  "
 |  | ||||||
| +"mailing list first (L<https://lists.libguestfs.org>).  "
 |  | ||||||
|  "This avoids disappointment and wasted work if we don't think the feature " |  | ||||||
|  "would fit into the libguestfs project." |  | ||||||
|  msgstr "" |  | ||||||
| @@ -38647,7 +38647,7 @@ msgstr ""
 |  | ||||||
|   |  | ||||||
|  #. type: textblock |  | ||||||
|  #: ../docs/guestfs-testing.pod:24 |  | ||||||
| -msgid "L<https://www.redhat.com/mailman/listinfo/libguestfs>"
 |  | ||||||
| +msgid "L<https://lists.libguestfs.org>"
 |  | ||||||
|  msgstr "" |  | ||||||
|   |  | ||||||
|  #. type: =head1 |  | ||||||
| diff --git a/po-docs/si.po b/po-docs/si.po
 |  | ||||||
| index aa7f5f97..de16c4ac 100644
 |  | ||||||
| --- a/po-docs/si.po
 |  | ||||||
| +++ b/po-docs/si.po
 |  | ||||||
| @@ -13455,7 +13455,7 @@ msgstr ""
 |  | ||||||
|  msgid "" |  | ||||||
|  "There is a mailing list, mainly for development, but users are also welcome " |  | ||||||
|  "to ask questions about libguestfs and the virt tools: " |  | ||||||
| -"L<https://www.redhat.com/mailman/listinfo/libguestfs>"
 |  | ||||||
| +"L<https://lists.libguestfs.org>"
 |  | ||||||
|  msgstr "" |  | ||||||
|   |  | ||||||
|  #. type: textblock |  | ||||||
| @@ -15797,7 +15797,7 @@ msgstr ""
 |  | ||||||
|  #: docs/guestfs-faq.pod:1285 |  | ||||||
|  msgid "" |  | ||||||
|  "Please send patches to the libguestfs mailing list " |  | ||||||
| -"L<https://www.redhat.com/mailman/listinfo/libguestfs>.  You don't have to be "
 |  | ||||||
| +"L<https://lists.libguestfs.org>.  You don't have to be "
 |  | ||||||
|  "subscribed, but there will be a delay until your posting is manually " |  | ||||||
|  "approved." |  | ||||||
|  msgstr "" |  | ||||||
| @@ -15820,7 +15820,7 @@ msgstr ""
 |  | ||||||
|  #: docs/guestfs-faq.pod:1297 |  | ||||||
|  msgid "" |  | ||||||
|  "Large new features that you intend to contribute should be discussed on the " |  | ||||||
| -"mailing list first (L<https://www.redhat.com/mailman/listinfo/libguestfs>).  "
 |  | ||||||
| +"mailing list first (L<https://lists.libguestfs.org>).  "
 |  | ||||||
|  "This avoids disappointment and wasted work if we don't think the feature " |  | ||||||
|  "would fit into the libguestfs project." |  | ||||||
|  msgstr "" |  | ||||||
| @@ -17764,7 +17764,7 @@ msgstr ""
 |  | ||||||
|  #: docs/guestfs-hacking.pod:840 |  | ||||||
|  msgid "" |  | ||||||
|  "Submit patches to the mailing list: " |  | ||||||
| -"L<http://www.redhat.com/mailman/listinfo/libguestfs> and CC to "
 |  | ||||||
| +"L<https://lists.libguestfs.org> and CC to "
 |  | ||||||
|  "L<rjones@redhat.com>." |  | ||||||
|  msgstr "" |  | ||||||
|   |  | ||||||
| @@ -37941,7 +37941,7 @@ msgstr ""
 |  | ||||||
|  msgid "" |  | ||||||
|  "If the security problem is not so serious, you can simply file a bug (see " |  | ||||||
|  "L</BUGS> below), or send an email to our mailing list " |  | ||||||
| -"(L<https://www.redhat.com/mailman/listinfo/libguestfs>).  You do not need to "
 |  | ||||||
| +"(L<https://lists.libguestfs.org>).  You do not need to "
 |  | ||||||
|  "subscribe to the mailing list to send email, but there will be a delay while " |  | ||||||
|  "the message is moderated." |  | ||||||
|  msgstr "" |  | ||||||
| @@ -38544,7 +38544,7 @@ msgstr ""
 |  | ||||||
|   |  | ||||||
|  #. type: textblock |  | ||||||
|  #: docs/guestfs-testing.pod:24 |  | ||||||
| -msgid "L<https://www.redhat.com/mailman/listinfo/libguestfs>"
 |  | ||||||
| +msgid "L<https://lists.libguestfs.org>"
 |  | ||||||
|  msgstr "" |  | ||||||
|   |  | ||||||
|  #. type: =head1 |  | ||||||
| diff --git a/po-docs/tg.po b/po-docs/tg.po
 |  | ||||||
| index 9e6fa072..80db7183 100644
 |  | ||||||
| --- a/po-docs/tg.po
 |  | ||||||
| +++ b/po-docs/tg.po
 |  | ||||||
| @@ -15952,7 +15952,7 @@ msgstr ""
 |  | ||||||
|  #: ../docs/guestfs-faq.pod:1297 |  | ||||||
|  msgid "" |  | ||||||
|  "Large new features that you intend to contribute should be discussed on the " |  | ||||||
| -"mailing list first (L<https://www.redhat.com/mailman/listinfo/libguestfs>).  "
 |  | ||||||
| +"mailing list first (L<https://lists.libguestfs.org>).  "
 |  | ||||||
|  "This avoids disappointment and wasted work if we don't think the feature " |  | ||||||
|  "would fit into the libguestfs project." |  | ||||||
|  msgstr "" |  | ||||||
| @@ -38652,7 +38652,7 @@ msgstr ""
 |  | ||||||
|   |  | ||||||
|  #. type: textblock |  | ||||||
|  #: ../docs/guestfs-testing.pod:24 |  | ||||||
| -msgid "L<https://www.redhat.com/mailman/listinfo/libguestfs>"
 |  | ||||||
| +msgid "L<https://lists.libguestfs.org>"
 |  | ||||||
|  msgstr "" |  | ||||||
|   |  | ||||||
|  #. type: =head1 |  | ||||||
| diff --git a/po-docs/uk.po b/po-docs/uk.po
 |  | ||||||
| index 960ea8f8..40c96852 100644
 |  | ||||||
| --- a/po-docs/uk.po
 |  | ||||||
| +++ b/po-docs/uk.po
 |  | ||||||
| @@ -19726,7 +19726,7 @@ msgstr "Як запропонувати нову можливість?"
 |  | ||||||
|  #: ../docs/guestfs-faq.pod:1297 |  | ||||||
|  msgid "" |  | ||||||
|  "Large new features that you intend to contribute should be discussed on the " |  | ||||||
| -"mailing list first (L<https://www.redhat.com/mailman/listinfo/libguestfs>).  "
 |  | ||||||
| +"mailing list first (L<https://lists.libguestfs.org>).  "
 |  | ||||||
|  "This avoids disappointment and wasted work if we don't think the feature " |  | ||||||
|  "would fit into the libguestfs project." |  | ||||||
|  msgstr "" |  | ||||||
| @@ -47713,8 +47713,8 @@ msgstr ""
 |  | ||||||
|   |  | ||||||
|  #. type: textblock |  | ||||||
|  #: ../docs/guestfs-testing.pod:24 |  | ||||||
| -msgid "L<https://www.redhat.com/mailman/listinfo/libguestfs>"
 |  | ||||||
| -msgstr "L<https://www.redhat.com/mailman/listinfo/libguestfs>"
 |  | ||||||
| +msgid "L<https://lists.libguestfs.org>"
 |  | ||||||
| +msgstr "L<https://lists.libguestfs.org>"
 |  | ||||||
|   |  | ||||||
|  #. type: =head1 |  | ||||||
|  #: ../docs/guestfs-testing.pod:26 |  | ||||||
| diff --git a/po-docs/zh_CN.po b/po-docs/zh_CN.po
 |  | ||||||
| index 0c15c1c1..1ad0e1cd 100644
 |  | ||||||
| --- a/po-docs/zh_CN.po
 |  | ||||||
| +++ b/po-docs/zh_CN.po
 |  | ||||||
| @@ -15954,7 +15954,7 @@ msgstr ""
 |  | ||||||
|  #: ../docs/guestfs-faq.pod:1297 |  | ||||||
|  msgid "" |  | ||||||
|  "Large new features that you intend to contribute should be discussed on the " |  | ||||||
| -"mailing list first (L<https://www.redhat.com/mailman/listinfo/libguestfs>).  "
 |  | ||||||
| +"mailing list first (L<https://lists.libguestfs.org>).  "
 |  | ||||||
|  "This avoids disappointment and wasted work if we don't think the feature " |  | ||||||
|  "would fit into the libguestfs project." |  | ||||||
|  msgstr "" |  | ||||||
| @@ -38654,7 +38654,7 @@ msgstr ""
 |  | ||||||
|   |  | ||||||
|  #. type: textblock |  | ||||||
|  #: ../docs/guestfs-testing.pod:24 |  | ||||||
| -msgid "L<https://www.redhat.com/mailman/listinfo/libguestfs>"
 |  | ||||||
| +msgid "L<https://lists.libguestfs.org>"
 |  | ||||||
|  msgstr "" |  | ||||||
|   |  | ||||||
|  #. type: =head1 |  | ||||||
| diff --git a/website/index.html.in b/website/index.html.in
 |  | ||||||
| index 91088b59..e7a03d6d 100644
 |  | ||||||
| --- a/website/index.html.in
 |  | ||||||
| +++ b/website/index.html.in
 |  | ||||||
| @@ -54,7 +54,7 @@ guestfish --ro -i -a disk.img
 |  | ||||||
|   |  | ||||||
|  <p> |  | ||||||
|  Join us on |  | ||||||
| -the <a href="http://www.redhat.com/mailman/listinfo/libguestfs">libguestfs
 |  | ||||||
| +the <a href="https://lists.libguestfs.org">libguestfs
 |  | ||||||
|  mailing list</a>, or on IRC channel <code>#guestfs</code> |  | ||||||
|  on <a href="https://libera.chat/">Libera Chat</a>. |  | ||||||
|  </p> |  | ||||||
| @ -1,4 +1,4 @@ | |||||||
| From 0349d30afcf1d345c1b4f9090447a561c944c8e5 Mon Sep 17 00:00:00 2001 | From e9a7378d730477d6a548c18244ba0bde9c7dc93d Mon Sep 17 00:00:00 2001 | ||||||
| From: "Richard W.M. Jones" <rjones@redhat.com> | From: "Richard W.M. Jones" <rjones@redhat.com> | ||||||
| Date: Fri, 25 Apr 2025 15:24:43 +0100 | Date: Fri, 25 Apr 2025 15:24:43 +0100 | ||||||
| Subject: [PATCH] daemon/fstrim.c: Issue sync_disks after fstrim | Subject: [PATCH] daemon/fstrim.c: Issue sync_disks after fstrim | ||||||
| @ -10,10 +10,10 @@ Thanks: Eric Sandeen | |||||||
|  1 file changed, 8 insertions(+) |  1 file changed, 8 insertions(+) | ||||||
| 
 | 
 | ||||||
| diff --git a/daemon/fstrim.c b/daemon/fstrim.c
 | diff --git a/daemon/fstrim.c b/daemon/fstrim.c
 | ||||||
| index f6869042..3928f8bb 100644
 | index 06707a7f..474ef72d 100644
 | ||||||
| --- a/daemon/fstrim.c
 | --- a/daemon/fstrim.c
 | ||||||
| +++ b/daemon/fstrim.c
 | +++ b/daemon/fstrim.c
 | ||||||
| @@ -116,5 +116,13 @@ do_fstrim (const char *path,
 | @@ -127,5 +127,13 @@ do_fstrim (const char *path,
 | ||||||
|    if (verbose) |    if (verbose) | ||||||
|      fprintf (stderr, "%s\n", out); |      fprintf (stderr, "%s\n", out); | ||||||
|   |   | ||||||
| @ -0,0 +1,127 @@ | |||||||
|  | From 682765a63ec7c3140e6332f15d9833072eea05e1 Mon Sep 17 00:00:00 2001 | ||||||
|  | From: "Richard W.M. Jones" <rjones@redhat.com> | ||||||
|  | Date: Thu, 8 May 2025 09:10:38 +0100 | ||||||
|  | Subject: [PATCH] daemon: inspect: Remove duplicate root mountpoints in | ||||||
|  |  /etc/fstab | ||||||
|  | 
 | ||||||
|  | A customer case was found where /etc/fstab contained multiple root | ||||||
|  | mountpoints, something like: | ||||||
|  | 
 | ||||||
|  |   LABEL=System / xfs ... | ||||||
|  |   LABEL=Boot /boot ext2 ... | ||||||
|  |   LABEL=System / xfs ... | ||||||
|  | 
 | ||||||
|  | This causes libguestfs and virt-v2v to fail.  Either (on RHEL 9) we | ||||||
|  | try to mount the second instance of / which gives an error.  Or (on | ||||||
|  | upstream kernels) we are able to mount the second instance but then | ||||||
|  | libguestfs gets confused when trying to unmount them. | ||||||
|  | 
 | ||||||
|  | In this case as the mounted devices are the same we can just delete | ||||||
|  | the duplicate.  It's also possible that there could be multiple | ||||||
|  | non-identical root mountpoints, in which case we have to pick one, and | ||||||
|  | this code arbitrarily picks the first[*] (but emits a warning). | ||||||
|  | 
 | ||||||
|  | We don't do anything for non-root mountpoints. | ||||||
|  | 
 | ||||||
|  | Update common submodule to add 'List.same' function from mlstdutils. | ||||||
|  | 
 | ||||||
|  | [*] Which one is "the first" depends on what version of ocaml-augeas | ||||||
|  | we are using.  ocaml-augeas version 0.6 Augeas.matches function | ||||||
|  | returns entries in reverse order (compared to augeas itself).  This is | ||||||
|  | fixed in version 0.7: | ||||||
|  | http://git.annexia.org/?p=ocaml-augeas.git;a=commitdiff;h=b703b92e3d26690aa6f7b822132049ce5435983e | ||||||
|  | 
 | ||||||
|  | Fixes: https://issues.redhat.com/browse/RHEL-90168 | ||||||
|  | (cherry picked from commit 5441d3dd0c8843897f65c8d40c82e0d204748b4e) | ||||||
|  | ---
 | ||||||
|  |  common                          |  2 +- | ||||||
|  |  daemon/inspect_fs_unix_fstab.ml | 31 +++++++++++++++++++++++++++++-- | ||||||
|  |  2 files changed, 30 insertions(+), 3 deletions(-) | ||||||
|  | 
 | ||||||
|  | Submodule common 8aed7b6a..9053edae: | ||||||
|  | diff --git a/common/mlstdutils/std_utils.ml b/common/mlstdutils/std_utils.ml
 | ||||||
|  | index 1177ff69..a0745d38 100644
 | ||||||
|  | --- a/common/mlstdutils/std_utils.ml
 | ||||||
|  | +++ b/common/mlstdutils/std_utils.ml
 | ||||||
|  | @@ -396,6 +396,18 @@ module List = struct
 | ||||||
|  |   | ||||||
|  |      let push_back_list xsp xs = xsp := !xsp @ xs | ||||||
|  |      let push_front_list xs xsp = xsp := xs @ !xsp | ||||||
|  | +
 | ||||||
|  | +    let make n x =
 | ||||||
|  | +      let rec loop acc = function
 | ||||||
|  | +        | 0 -> acc
 | ||||||
|  | +        | i when i > 0 -> loop (x :: acc) (i-1)
 | ||||||
|  | +        | _ -> invalid_arg "make"
 | ||||||
|  | +      in
 | ||||||
|  | +      loop [] n
 | ||||||
|  | +
 | ||||||
|  | +    let same = function
 | ||||||
|  | +      | [] -> true
 | ||||||
|  | +      | x :: xs -> List.for_all ((=) x) xs
 | ||||||
|  |  end | ||||||
|  |   | ||||||
|  |  module Option = struct | ||||||
|  | diff --git a/common/mlstdutils/std_utils.mli b/common/mlstdutils/std_utils.mli
 | ||||||
|  | index 6811b4bc..f5ff3470 100644
 | ||||||
|  | --- a/common/mlstdutils/std_utils.mli
 | ||||||
|  | +++ b/common/mlstdutils/std_utils.mli
 | ||||||
|  | @@ -289,6 +289,12 @@ module List : sig
 | ||||||
|  |   | ||||||
|  |          [push_front_list] is like {!push_front} above, except it prepends | ||||||
|  |          a list to the list reference. *) | ||||||
|  | +
 | ||||||
|  | +    val make : int -> 'a -> 'a list
 | ||||||
|  | +    (** [make n x] returns a list with [x] repeated [n] times. *)
 | ||||||
|  | +    val same : 'a list -> bool
 | ||||||
|  | +    (** [same xs] returns true iff the list contains only identical elements,
 | ||||||
|  | +        or is the empty list. *)
 | ||||||
|  |  end | ||||||
|  |  (** Override the List module from stdlib. *) | ||||||
|  |   | ||||||
|  | diff --git a/daemon/inspect_fs_unix_fstab.ml b/daemon/inspect_fs_unix_fstab.ml
 | ||||||
|  | index dcbdab3c..b0de55e4 100644
 | ||||||
|  | --- a/daemon/inspect_fs_unix_fstab.ml
 | ||||||
|  | +++ b/daemon/inspect_fs_unix_fstab.ml
 | ||||||
|  | @@ -53,8 +53,10 @@ and check_fstab_aug mdadm_conf root_mountable os_type aug =
 | ||||||
|  |    let md_map = if mdadm_conf then map_md_devices aug else StringMap.empty in | ||||||
|  |   | ||||||
|  |    let path = "/files/etc/fstab/*[label() != '#comment']" in | ||||||
|  | -  let entries = aug_matches_noerrors aug path in
 | ||||||
|  | -  List.filter_map (check_fstab_entry md_map root_mountable os_type aug) entries
 | ||||||
|  | +  path |>
 | ||||||
|  | +    aug_matches_noerrors aug |>
 | ||||||
|  | +    List.filter_map (check_fstab_entry md_map root_mountable os_type aug) |>
 | ||||||
|  | +    remove_duplicate_root_mountpoints
 | ||||||
|  |   | ||||||
|  |  and check_fstab_entry md_map root_mountable os_type aug entry = | ||||||
|  |    with_return (fun {return} -> | ||||||
|  | @@ -604,3 +606,28 @@ and resolve_diskbyid part default =
 | ||||||
|  |      if is_partition dev then Mountable.of_device dev | ||||||
|  |      else default | ||||||
|  |    ) | ||||||
|  | +
 | ||||||
|  | +(* Remove duplicate root mountpoints if they are identical.  If
 | ||||||
|  | + * there are multiple non-identical roots we pick the first and
 | ||||||
|  | + * emit a warning (RHEL-90168).
 | ||||||
|  | + *)
 | ||||||
|  | +and remove_duplicate_root_mountpoints (entries : fstab_entry list) =
 | ||||||
|  | +  let root_entries, non_root_entries =
 | ||||||
|  | +    List.partition (function (_, "/") -> true | _ -> false) entries in
 | ||||||
|  | +  (* If there is one root entry (the normal case) return the list unmodified. *)
 | ||||||
|  | +  if List.length root_entries <= 1 then entries
 | ||||||
|  | +  else (
 | ||||||
|  | +    (* If they are not the same, issue a warning. *)
 | ||||||
|  | +    if not (List.same root_entries) then
 | ||||||
|  | +      eprintf "check_fstab: multiple, non-identical root mountpoints found \
 | ||||||
|  | +               in the /etc/fstab of this guest, picking the first.  The \
 | ||||||
|  | +               root entries were: [%s]\n"
 | ||||||
|  | +        (String.concat "; "
 | ||||||
|  | +           (List.map (fun (mountable, mp) ->
 | ||||||
|  | +                sprintf "%s -> %s" (Mountable.to_string mountable) mp)
 | ||||||
|  | +              root_entries)
 | ||||||
|  | +        );
 | ||||||
|  | +
 | ||||||
|  | +    (* Choose the first root entry and return it. *)
 | ||||||
|  | +    List.hd root_entries :: non_root_entries
 | ||||||
|  | +  )
 | ||||||
| @ -1,25 +0,0 @@ | |||||||
| From f6f2f56535a54a90a5c02974eba09bb7a8f0709c 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> |  | ||||||
|   |  | ||||||
| @ -1,132 +0,0 @@ | |||||||
| From 836b63ce6d6a47f0d8179ccd3c96ce152396ba77 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); |  | ||||||
|  } |  | ||||||
| @ -1,39 +0,0 @@ | |||||||
| From a534de4f269ea3c2671b99172063e872204fb978 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); |  | ||||||
| @ -1,162 +0,0 @@ | |||||||
| From 7073e06b2e45ad1544e715d308662a00a6aa20ae 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; |  | ||||||
|   |  | ||||||
| @ -1,35 +0,0 @@ | |||||||
| From 5de9915acd31ffe430adc0df497173032560311c 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
 |  | ||||||
| @ -1,44 +0,0 @@ | |||||||
| From 118b93a189be2d39d2dc20ef059c9b38c60fe8be Mon Sep 17 00:00:00 2001 |  | ||||||
| From: "Richard W.M. Jones" <rjones@redhat.com> |  | ||||||
| Date: Fri, 19 Jan 2024 13:18:00 +0000 |  | ||||||
| Subject: [PATCH] generator/customize.ml: Split --chown parameter on ':' |  | ||||||
|  character |  | ||||||
| 
 |  | ||||||
| The previous code split it on ',' which was completely wrong. |  | ||||||
| (It reveals the lack of testing however). |  | ||||||
| 
 |  | ||||||
| Fixes: commit c08032ebe2763f5e9ce5b14e003721475219d390 |  | ||||||
| Reported-by: Yongkui Guo |  | ||||||
| (cherry picked from commit e9a728bb22dfa1de5328fbbe7d6d7acad2dbed64) |  | ||||||
| ---
 |  | ||||||
|  common                 | 2 +- |  | ||||||
|  generator/customize.ml | 2 +- |  | ||||||
|  2 files changed, 2 insertions(+), 2 deletions(-) |  | ||||||
| 
 |  | ||||||
| Submodule common 0dba002c..54869c98: |  | ||||||
| diff --git a/common/mlcustomize/customize_cmdline.ml b/common/mlcustomize/customize_cmdline.ml
 |  | ||||||
| index 245d9960..48ee3344 100644
 |  | ||||||
| --- a/common/mlcustomize/customize_cmdline.ml
 |  | ||||||
| +++ b/common/mlcustomize/customize_cmdline.ml
 |  | ||||||
| @@ -157,7 +157,7 @@ let rec argspec () =
 |  | ||||||
|      let len = String.length arg in |  | ||||||
|      String.sub arg 0 i, String.sub arg (i+1) (len-(i+1)) |  | ||||||
|    and split_string_triplet option_name arg = |  | ||||||
| -    match String.nsplit ~max:3 "," arg with
 |  | ||||||
| +    match String.nsplit ~max:3 ":" arg with
 |  | ||||||
|      | [a; b; c] -> a, b, c |  | ||||||
|      | _ -> |  | ||||||
|          error (f_"invalid format for '--%s' parameter, see the man page") |  | ||||||
| diff --git a/generator/customize.ml b/generator/customize.ml
 |  | ||||||
| index e64b45c0..e2c4b605 100644
 |  | ||||||
| --- a/generator/customize.ml
 |  | ||||||
| +++ b/generator/customize.ml
 |  | ||||||
| @@ -775,7 +775,7 @@ let rec argspec () =
 |  | ||||||
|      let len = String.length arg in |  | ||||||
|      String.sub arg 0 i, String.sub arg (i+1) (len-(i+1)) |  | ||||||
|    and split_string_triplet option_name arg = |  | ||||||
| -    match String.nsplit ~max:3 \",\" arg with
 |  | ||||||
| +    match String.nsplit ~max:3 \":\" arg with
 |  | ||||||
|      | [a; b; c] -> a, b, c |  | ||||||
|      | _ -> |  | ||||||
|          error (f_\"invalid format for '--%%s' parameter, see the man page\") |  | ||||||
| @ -1,65 +0,0 @@ | |||||||
| From f1ced749d4b714e98c82a971ac60148f95312812 Mon Sep 17 00:00:00 2001 |  | ||||||
| From: "Richard W.M. Jones" <rjones@redhat.com> |  | ||||||
| Date: Wed, 24 Apr 2024 12:23:34 +0100 |  | ||||||
| Subject: [PATCH] Update common submodule |  | ||||||
| 
 |  | ||||||
| In particular pick this: |  | ||||||
| 
 |  | ||||||
|   commit 93a7f3af5c23ece6a8e092827ed5928a8973fd3c |  | ||||||
|   Author: Richard W.M. Jones <rjones@redhat.com> |  | ||||||
|   Date:   Wed Apr 24 12:08:01 2024 +0100 |  | ||||||
| 
 |  | ||||||
|     options: Allow nbd+unix:// URIs |  | ||||||
| 
 |  | ||||||
| (cherry picked from commit 7968de46f17eed7f18c200c6528ebdfec5c3f279) |  | ||||||
| ---
 |  | ||||||
|  common | 2 +- |  | ||||||
|  1 file changed, 1 insertion(+), 1 deletion(-) |  | ||||||
| 
 |  | ||||||
| Submodule common 54869c98..93a7f3af: |  | ||||||
| diff --git a/common/options/uri.c b/common/options/uri.c
 |  | ||||||
| index 84d393c1..9180d6a2 100644
 |  | ||||||
| --- a/common/options/uri.c
 |  | ||||||
| +++ b/common/options/uri.c
 |  | ||||||
| @@ -99,7 +99,7 @@ is_uri (const char *arg)
 |  | ||||||
|      return 0; |  | ||||||
|   |  | ||||||
|    for (p--; p >= arg; p--) { |  | ||||||
| -    if (!c_islower (*p))
 |  | ||||||
| +    if (! (c_islower (*p) || *p == '+'))
 |  | ||||||
|        return 0; |  | ||||||
|    } |  | ||||||
|   |  | ||||||
| @@ -148,7 +148,10 @@ parse (const char *arg, char **path_ret, char **protocol_ret,
 |  | ||||||
|    } |  | ||||||
|    */ |  | ||||||
|   |  | ||||||
| -  *protocol_ret = strdup (uri->scheme);
 |  | ||||||
| +  if (STREQ (uri->scheme, "nbd+unix"))
 |  | ||||||
| +    *protocol_ret = strdup ("nbd");
 |  | ||||||
| +  else
 |  | ||||||
| +    *protocol_ret = strdup (uri->scheme);
 |  | ||||||
|    if (*protocol_ret == NULL) { |  | ||||||
|      perror ("strdup: protocol"); |  | ||||||
|      return -1; |  | ||||||
| @@ -194,7 +197,7 @@ parse (const char *arg, char **path_ret, char **protocol_ret,
 |  | ||||||
|    if (path && path[0] == '/' && |  | ||||||
|        (STREQ (uri->scheme, "gluster") || |  | ||||||
|         STREQ (uri->scheme, "iscsi") || |  | ||||||
| -       STREQ (uri->scheme, "nbd") ||
 |  | ||||||
| +       STRPREFIX (uri->scheme, "nbd") ||
 |  | ||||||
|         STREQ (uri->scheme, "rbd") || |  | ||||||
|         STREQ (uri->scheme, "sheepdog"))) |  | ||||||
|      path++; |  | ||||||
| diff --git a/common/progress/progress.c b/common/progress/progress.c
 |  | ||||||
| index e4b30663..5848abd7 100644
 |  | ||||||
| --- a/common/progress/progress.c
 |  | ||||||
| +++ b/common/progress/progress.c
 |  | ||||||
| @@ -123,6 +123,7 @@ progress_bar_init (unsigned flags)
 |  | ||||||
|      bar->machine_readable = 1; |  | ||||||
|      bar->utf8_mode = 0; |  | ||||||
|      bar->have_terminfo = 0; |  | ||||||
| +    bar->fp = NULL;
 |  | ||||||
|    } else { |  | ||||||
|      bar->machine_readable = 0; |  | ||||||
|   |  | ||||||
| @ -1,86 +0,0 @@ | |||||||
| From 04a45af93d21880e54a386386313100a04b91ca7 Mon Sep 17 00:00:00 2001 |  | ||||||
| From: "Richard W.M. Jones" <rjones@redhat.com> |  | ||||||
| Date: Mon, 8 Jul 2024 14:37:22 +0100 |  | ||||||
| Subject: [PATCH] New APIs: findfs_partuuid and findfs_partlabel |  | ||||||
| 
 |  | ||||||
| These search for partitions by UUID or label (name).  They only work |  | ||||||
| for GPT. |  | ||||||
| 
 |  | ||||||
| (cherry picked from commit 1816651f3c138600ad2e5ba0d6437b4753333818) |  | ||||||
| ---
 |  | ||||||
|  daemon/findfs.ml          |  4 ++++ |  | ||||||
|  generator/actions_core.ml | 24 ++++++++++++++++++++++++ |  | ||||||
|  generator/proc_nr.ml      |  2 ++ |  | ||||||
|  lib/MAX_PROC_NR           |  2 +- |  | ||||||
|  4 files changed, 31 insertions(+), 1 deletion(-) |  | ||||||
| 
 |  | ||||||
| diff --git a/daemon/findfs.ml b/daemon/findfs.ml
 |  | ||||||
| index cf2ba4a8..a94e0ce7 100644
 |  | ||||||
| --- a/daemon/findfs.ml
 |  | ||||||
| +++ b/daemon/findfs.ml
 |  | ||||||
| @@ -27,6 +27,10 @@ let rec findfs_uuid uuid =
 |  | ||||||
|    findfs "UUID" uuid |  | ||||||
|  and findfs_label label = |  | ||||||
|    findfs "LABEL" label |  | ||||||
| +and findfs_partuuid uuid =
 |  | ||||||
| +  findfs "PARTUUID" uuid
 |  | ||||||
| +and findfs_partlabel label =
 |  | ||||||
| +  findfs "PARTLABEL" label
 |  | ||||||
|   |  | ||||||
|  and findfs tag str = |  | ||||||
|    (* Kill the cache file, forcing blkid to reread values from the |  | ||||||
| diff --git a/generator/actions_core.ml b/generator/actions_core.ml
 |  | ||||||
| index 314bb0ae..c3afe810 100644
 |  | ||||||
| --- a/generator/actions_core.ml
 |  | ||||||
| +++ b/generator/actions_core.ml
 |  | ||||||
| @@ -5688,6 +5688,30 @@ filesystem can be found.
 |  | ||||||
|   |  | ||||||
|  To find the label of a filesystem, use C<guestfs_vfs_label>." }; |  | ||||||
|   |  | ||||||
| +  { defaults with
 |  | ||||||
| +    name = "findfs_partuuid"; added = (1, 5, 3);
 |  | ||||||
| +    style = RString (RDevice, "device"), [String (PlainString, "uuid")], [];
 |  | ||||||
| +    impl = OCaml "Findfs.findfs_partuuid";
 |  | ||||||
| +    shortdesc = "find a partition by UUID";
 |  | ||||||
| +    longdesc = "\
 |  | ||||||
| +This command searches the partitions and returns the one
 |  | ||||||
| +which has the given partition UUID.  An error is returned if no such
 |  | ||||||
| +partition can be found.
 |  | ||||||
| +
 |  | ||||||
| +To find the UUID of a partition, use C<guestfs_blkid> (C<PART_ENTRY_UUID>)." };
 |  | ||||||
| +
 |  | ||||||
| +  { defaults with
 |  | ||||||
| +    name = "findfs_partlabel"; added = (1, 5, 3);
 |  | ||||||
| +    style = RString (RDevice, "device"), [String (PlainString, "label")], [];
 |  | ||||||
| +    impl = OCaml "Findfs.findfs_partlabel";
 |  | ||||||
| +    shortdesc = "find a partition by label";
 |  | ||||||
| +    longdesc = "\
 |  | ||||||
| +This command searches the partitions and returns the one
 |  | ||||||
| +which has the given label.  An error is returned if no such
 |  | ||||||
| +partition can be found.
 |  | ||||||
| +
 |  | ||||||
| +To find the label of a partition, use C<guestfs_blkid> (C<PART_ENTRY_NAME>)." };
 |  | ||||||
| +
 |  | ||||||
|    { defaults with |  | ||||||
|      name = "is_chardev"; added = (1, 5, 10); |  | ||||||
|      style = RBool "flag", [String (Pathname, "path")], [OBool "followsymlinks"]; |  | ||||||
| diff --git a/generator/proc_nr.ml b/generator/proc_nr.ml
 |  | ||||||
| index f71a849c..56cd97a9 100644
 |  | ||||||
| --- a/generator/proc_nr.ml
 |  | ||||||
| +++ b/generator/proc_nr.ml
 |  | ||||||
| @@ -516,6 +516,8 @@ let proc_nr = [
 |  | ||||||
|  511, "internal_readdir"; |  | ||||||
|  512, "clevis_luks_unlock"; |  | ||||||
|  513, "inspect_get_build_id"; |  | ||||||
| +514, "findfs_partuuid";
 |  | ||||||
| +515, "findfs_partlabel";
 |  | ||||||
|  ] |  | ||||||
|   |  | ||||||
|  (* End of list.  If adding a new entry, add it at the end of the list |  | ||||||
| diff --git a/lib/MAX_PROC_NR b/lib/MAX_PROC_NR
 |  | ||||||
| index 31cf34b8..3cda32fc 100644
 |  | ||||||
| --- a/lib/MAX_PROC_NR
 |  | ||||||
| +++ b/lib/MAX_PROC_NR
 |  | ||||||
| @@ -1 +1 @@
 |  | ||||||
| -513
 |  | ||||||
| +515
 |  | ||||||
| @ -1,41 +0,0 @@ | |||||||
| From ebce03824a3ce75823037003ca2311d7b8d61565 Mon Sep 17 00:00:00 2001 |  | ||||||
| From: "Richard W.M. Jones" <rjones@redhat.com> |  | ||||||
| Date: Mon, 8 Jul 2024 14:39:16 +0100 |  | ||||||
| Subject: [PATCH] inspection: Resolve PARTUUID= and PARTLABEL= in /etc/fstab |  | ||||||
| 
 |  | ||||||
| Fixes: https://issues.redhat.com/browse/RHEL-46596 |  | ||||||
| (cherry picked from commit e616c8f286ddacf401d7c356724ae874ed883262) |  | ||||||
| ---
 |  | ||||||
|  daemon/inspect_fs_unix_fstab.ml | 19 +++++++++++++++++++ |  | ||||||
|  1 file changed, 19 insertions(+) |  | ||||||
| 
 |  | ||||||
| diff --git a/daemon/inspect_fs_unix_fstab.ml b/daemon/inspect_fs_unix_fstab.ml
 |  | ||||||
| index 837c8c62..f5817a31 100644
 |  | ||||||
| --- a/daemon/inspect_fs_unix_fstab.ml
 |  | ||||||
| +++ b/daemon/inspect_fs_unix_fstab.ml
 |  | ||||||
| @@ -131,6 +131,25 @@ and check_fstab_entry md_map root_mountable os_type aug entry =
 |  | ||||||
|          with |  | ||||||
|            Failure _ -> return None |  | ||||||
|        ) |  | ||||||
| +      (* EFI partition UUIDs and labels. *)
 |  | ||||||
| +      else if String.is_prefix spec "PARTUUID=" then (
 |  | ||||||
| +        let uuid = String.sub spec 9 (String.length spec - 9) in
 |  | ||||||
| +        let uuid = shell_unquote uuid in
 |  | ||||||
| +        (* Just ignore the device if the UUID cannot be resolved. *)
 |  | ||||||
| +        try
 |  | ||||||
| +          Mountable.of_device (Findfs.findfs_partuuid uuid)
 |  | ||||||
| +        with
 |  | ||||||
| +          Failure _ -> return None
 |  | ||||||
| +      )
 |  | ||||||
| +      else if String.is_prefix spec "PARTLABEL=" then (
 |  | ||||||
| +        let label = String.sub spec 10 (String.length spec - 10) in
 |  | ||||||
| +        let label = shell_unquote label in
 |  | ||||||
| +        (* Just ignore the device if the label cannot be resolved. *)
 |  | ||||||
| +        try
 |  | ||||||
| +          Mountable.of_device (Findfs.findfs_partlabel label)
 |  | ||||||
| +        with
 |  | ||||||
| +          Failure _ -> return None
 |  | ||||||
| +      )
 |  | ||||||
|        (* Resolve /dev/root to the current device. |  | ||||||
|         * Do the same for the / partition of the *BSD |  | ||||||
|         * systems, since the BSD -> Linux device |  | ||||||
| @ -7,7 +7,7 @@ set -e | |||||||
| #   ./copy-patches.sh | #   ./copy-patches.sh | ||||||
| 
 | 
 | ||||||
| project=libguestfs | project=libguestfs | ||||||
| rhel_version=9.5 | rhel_version=9.6 | ||||||
| 
 | 
 | ||||||
| # Check we're in the right directory. | # Check we're in the right directory. | ||||||
| if [ ! -f $project.spec ]; then | if [ ! -f $project.spec ]; then | ||||||
|  | |||||||
| @ -1,17 +0,0 @@ | |||||||
| -----BEGIN PGP SIGNATURE----- |  | ||||||
| 
 |  | ||||||
| iQJFBAABCAAvFiEE93dPsa0HSn6Mh2fqkXOPc+G3aKAFAmaNN5wRHHJpY2hAYW5u |  | ||||||
| ZXhpYS5vcmcACgkQkXOPc+G3aKDZwQ/9ExtAdQIYiR1HtRiHlNDoQw5ADVeHaucD |  | ||||||
| Gy8KLJHyzCZaPVsim50/Rx9Thipn/jvVCNRoww02D8l5xm7elcqO7//N5OWNeyzO |  | ||||||
| /SUq/DEspWdfpDJVEQvID3Rtg8ZPJ/7VW9dtMe2nuUNpEyBSeqqQvXoJXzDkhcao |  | ||||||
| IT604JY7zZqeFzXaZGYyXeZUtnxpv7M/yIDGVjQ2m0WxAkpk3OYIW57bjRRTAI3d |  | ||||||
| zSnCW1qIITpMb3VtTRKw9FIhr/eZsyeLqA1QlKGKh0HEyrVDwYD+ENH4McKyOUH1 |  | ||||||
| M3pPMxOL5/WpBMpVhQsmospK25+AQRWuzm0w/h6YgP6gPbQLCe7BTkNeWz3n3f8r |  | ||||||
| W1P+eS0bj1NVs3vZYM0WC8pMx6UaqP6u5T1vH9v+VQ3/ZEqBnU60Jhso5wdQRSgG |  | ||||||
| GsarBFf2BETZkuMFiUaaKAbDgYYMVW3nsxgurW0pk5kIfeXX1+6xcqoULG/cV879 |  | ||||||
| xhUD11XBrJdCvWnpZ+xTZD3SPP4hlfAlCkHPhFw0+WdTHUEASVRnX+dZzYcAE49d |  | ||||||
| 2S7XsrAphY+l2BCISdJB4OdGSnpWO8M76Y0FbPFO6bx9YJRmIAQPLWbq4RrjtAZ4 |  | ||||||
| CUObvLe54y4OHY7f22qZVg+hWusaTexphfOAMi/rInLgWbzERFlQ0iL8mVd3dQqA |  | ||||||
| oCoiARM5lzI= |  | ||||||
| =UhhX |  | ||||||
| -----END PGP SIGNATURE----- |  | ||||||
							
								
								
									
										17
									
								
								SOURCES/libguestfs-1.54.0.tar.gz.sig
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								SOURCES/libguestfs-1.54.0.tar.gz.sig
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,17 @@ | |||||||
|  | -----BEGIN PGP SIGNATURE----- | ||||||
|  | 
 | ||||||
|  | iQJFBAABCAAvFiEE93dPsa0HSn6Mh2fqkXOPc+G3aKAFAmcFNYwRHHJpY2hAYW5u | ||||||
|  | ZXhpYS5vcmcACgkQkXOPc+G3aKAn2xAArWoo5hKyREZW+WqEv40ZDD9jRG2WNUyl | ||||||
|  | BJcEvLEtcAySv71nftVQOhxoZhcfRbanSFKCTD0O/rzf5MjDhPIi9jbeGkFDg22c | ||||||
|  | zyuSJ4vGnkUCa1dDg5hJZdhCfe/gSb5RHR8GF+QRZDVXqCZg/PO+KEFh0112htUW | ||||||
|  | 1y6rc9oe2f5aSNO9wgsVCYLXGcZ80wT/JyXe/NhqJoZOvps4SlEFHcpoYdV0wzOG | ||||||
|  | 1UkuPy1UteDOTLHGx5JyMqR/+mzy3O59FaIU1eAXwrtlksBfzgmMyEt7ntizk3/M | ||||||
|  | qGgaE4KK3GURZUoDNc6WS856EMaoeMy6Dd6np8rMKeDn3d0PCNcrn2+7kSiNyRP0 | ||||||
|  | guM+7gwcZUnI9UOi6/vwbmmDCAgRkSPP130fKagBtK2BqQ1FyTow4mOLXkVpHrlZ | ||||||
|  | zF2lDIBs/rDC1fdDXtcsZ/N4nc2OkZwvZ+jxjhsY4xnSLaZSK+C3Le7Yqj04vOzh | ||||||
|  | KfqgqorqaEw1MnqRY6czGc5VntXsK/5f+zBeS4KGn7znJN/jVXzjFDn3o0X6R1MW | ||||||
|  | IMv2ZHk0NInGFaVHyBD7ob3vh2+hWX0QIVTouqmPRVPIbVs4hAIVHGeOkkUCO8y9 | ||||||
|  | MerGQuJSPlaegndGfRmp4R6q882QxTXRiY4tAnhdoDj5bLzss89kSKqxUHBDknZA | ||||||
|  | Fe+4R67G9zg= | ||||||
|  | =RmmC | ||||||
|  | -----END PGP SIGNATURE----- | ||||||
| @ -24,16 +24,8 @@ | |||||||
| # Verify tarball signature with GPGv2. | # Verify tarball signature with GPGv2. | ||||||
| %global verify_tarball_signature 1 | %global verify_tarball_signature 1 | ||||||
| 
 | 
 | ||||||
| # If there are patches which touch autotools files, set this to 1. |  | ||||||
| %if !0%{?rhel} |  | ||||||
| %global patches_touch_autotools %{nil} |  | ||||||
| %else |  | ||||||
| # On RHEL the downstream patches always touch autotools files. |  | ||||||
| %global patches_touch_autotools 1 |  | ||||||
| %endif |  | ||||||
| 
 |  | ||||||
| # The source directory. | # The source directory. | ||||||
| %global source_directory 1.50-stable | %global source_directory 1.54-stable | ||||||
| 
 | 
 | ||||||
| # Filter perl provides. | # Filter perl provides. | ||||||
| %{?perl_default_filter} | %{?perl_default_filter} | ||||||
| @ -44,9 +36,9 @@ | |||||||
| Summary:       Access and modify virtual machine disk images | Summary:       Access and modify virtual machine disk images | ||||||
| Name:          libguestfs | Name:          libguestfs | ||||||
| Epoch:         1 | Epoch:         1 | ||||||
| Version:       1.50.2 | Version:       1.54.0 | ||||||
| Release:       4%{?dist} | Release:       8%{?dist} | ||||||
| License:       LGPLv2+ | License:       LGPL-2.1-or-later | ||||||
| 
 | 
 | ||||||
| # Build only for architectures that have a kernel | # Build only for architectures that have a kernel | ||||||
| ExclusiveArch: %{kernel_arches} | ExclusiveArch: %{kernel_arches} | ||||||
| @ -79,72 +71,42 @@ Source7:       libguestfs.keyring | |||||||
| # Maintainer script which helps with handling patches. | # Maintainer script which helps with handling patches. | ||||||
| Source8:       copy-patches.sh | Source8:       copy-patches.sh | ||||||
| 
 | 
 | ||||||
| # This is a copy of the common/ submodule from libguestfs @v1.50.2. |  | ||||||
| # We need it because the libguestfs tarball does not include common/ |  | ||||||
| # directories that are not used by libguestfs (eg. common/mlcustomize). |  | ||||||
| # However the patches (below) patch files in those directories and so |  | ||||||
| # do not apply properly to the libguestfs tarball.  Therefore before |  | ||||||
| # applying the patches we unpack this in the common/ subdirectory. |  | ||||||
| Source9:       libguestfs-common-1.50.2.tar.gz |  | ||||||
| 
 |  | ||||||
| # Patches are maintained in the following repository: | # Patches are maintained in the following repository: | ||||||
| # https://github.com/libguestfs/libguestfs/commits/rhel-9.5 | # https://github.com/libguestfs/libguestfs/commits/rhel-9.6 | ||||||
| 
 | 
 | ||||||
| # Patches. | # Patches. | ||||||
| Patch0001:     0001-daemon-selinux-relabel-don-t-exclude-selinux-if-it-s.patch | Patch0001:     0001-website-Add-links-for-1.54-and-1.55-download-locatio.patch | ||||||
| Patch0002:     0002-daemon-selinux-relabel-search-for-invalid-option-in-.patch | Patch0002:     0002-tests-gdisk-test-expand-gpt.pl-Implement-SKIP-rule-f.patch | ||||||
| Patch0003:     0003-daemon-selinux-relabel-run-setfiles-with-T-0-if-supp.patch | Patch0003:     0003-lib-inspect-osinfo.c-Add-Windows-Server-2025-osinfo.patch | ||||||
| Patch0004:     0004-RHEL-Disable-unsupported-remote-drive-protocols-RHBZ.patch | Patch0004:     0004-build-Assume-__attribute__-cleanup-always-works.patch | ||||||
| Patch0005:     0005-RHEL-Reject-use-of-libguestfs-winsupport-features-ex.patch | Patch0005:     0005-appliance-Use-stable-owner-group-and-mtime-in-applia.patch | ||||||
| Patch0006:     0006-Remove-virt-dib.patch | Patch0006:     0006-appliance-Refactor-the-TAR_COMMAND-macro.patch | ||||||
| Patch0007:     0007-lib-Choose-q35-machine-type-for-x86-64.patch | Patch0007:     0007-build-Add-new-dependency-on-json-c.patch | ||||||
| Patch0008:     0008-LUKS-on-LVM-inspection-test-rename-VGs-and-LVs.patch | Patch0008:     0008-daemon-ldm.c-Replace-jansson-with-json-c.patch | ||||||
| Patch0009:     0009-LUKS-on-LVM-inspection-test-test-dev-mapper-VG-LV-tr.patch | #Patch0009:     0009-common-Update-common-submodule.patch | ||||||
| Patch0010:     0010-fuse-Don-t-call-fclose-NULL-on-error-paths.patch | Patch0010:     0010-lib-info.c-Replace-jansson-with-json-c.patch | ||||||
| Patch0011:     0011-ocaml-implicit_close-test-collect-all-currently-unre.patch | Patch0011:     0011-lib-direct-Remove-test-for-qemu-mandatory-locking.patch | ||||||
| Patch0012:     0012-ocaml-Replace-old-enter-leave_blocking_section-calls.patch | Patch0012:     0012-lib-qemu.c-Replace-jansson-with-json-c.patch | ||||||
| Patch0013:     0013-ocaml-Release-runtime-lock-around-guestfs_close.patch | Patch0013:     0013-build-Remove-Jansson-dependency.patch | ||||||
| Patch0014:     0014-ocaml-Conditionally-acquire-the-lock-in-callbacks.patch | Patch0014:     0014-website-Fix-link-to-latest-development-version.patch | ||||||
| Patch0015:     0015-ocaml-Fix-guestfs_065_implicit_close.ml-for-OCaml-5.patch | Patch0015:     0015-RHEL-Disable-unsupported-remote-drive-protocols-RHBZ.patch | ||||||
| Patch0016:     0016-ocaml-Use-Caml_state_opt-in-preference-to-caml_state.patch | Patch0016:     0016-RHEL-Reject-use-of-libguestfs-winsupport-features-ex.patch | ||||||
| Patch0017:     0017-generator-Add-chown-option-for-virt-customize.patch | Patch0017:     0017-daemon-New-command_out-and-sh_out-APIs.patch | ||||||
| Patch0018:     0018-lib-remove-guestfs_int_cmd_clear_close_files.patch | Patch0018:     0018-lib-Print-kernel-utsname-in-debug-output.patch | ||||||
| Patch0019:     0019-docs-fix-broken-link-in-the-guestfs-manual.patch | Patch0019:     0019-daemon-Fix-loongarch64-detection-on-RHEL-9.patch | ||||||
| Patch0020:     0020-docs-clarify-sockdir-s-separation.patch | Patch0020:     0020-daemon-inspect-Add-some-debugging-of-usr-merging.patch | ||||||
| Patch0021:     0021-lib-move-guestfs_int_create_socketname-from-launch.c.patch | Patch0021:     0021-generator-Implement-struct-FDevice-type.patch | ||||||
| Patch0022:     0022-generator-customize-Add-new-StringTriplet-for-use-by.patch | Patch0022:     0022-generator-Use-new-FDevice-type-for-the-pvs-full-pv_n.patch | ||||||
| Patch0023:     0023-daemon-lvm-Do-reverse-device-name-translation-on-pvs.patch | Patch0023:     0023-daemon-inspect-Resolve-Ubuntu-22-dev-disk-by-uuid-in.patch | ||||||
| Patch0024:     0024-ruby-Replace-MiniTest-with-Minitest.patch | Patch0024:     0024-generator-Fix-implementation-of-FUUID-for-OCaml-func.patch | ||||||
| Patch0025:     0025-ruby-Get-rid-of-old-Test-Unit-compatibility.patch | Patch0025:     0025-Update-common-submodule.patch | ||||||
| Patch0026:     0026-generator-Sort-virt-customize-options-into-alphabeti.patch | Patch0026:     0026-daemon-Rewrite-pvs-vgs-lvs-full-APIs-in-OCaml.patch | ||||||
| Patch0027:     0027-generator-Add-new-virt-customize-tar-in-operation.patch | Patch0027:     0027-daemon-inspect-Resolve-Ubuntu-22-dev-disk-by-id-dm-u.patch | ||||||
| Patch0028:     0028-New-mailing-list-email-address.patch | Patch0028:     0028-RHEL-9-daemon-fstrim.c-Run-the-fstrim-command-twice.patch | ||||||
| Patch0029:     0029-New-mailing-list-archives.patch | Patch0029:     0029-daemon-fstrim.c-Issue-sync_disks-after-fstrim.patch | ||||||
| Patch0030:     0030-lib-Include-libxml-parser.h-for-xmlReadMemory.patch | Patch0030:     0030-daemon-inspect-Remove-duplicate-root-mountpoints-in-.patch | ||||||
| Patch0031:     0031-ocaml-Use-Gc.finalise-instead-of-a-C-finalizer.patch |  | ||||||
| Patch0032:     0032-ocaml-Nullify-custom-block-before-releasing-runtime-.patch |  | ||||||
| Patch0033:     0033-Update-common-submodule.patch |  | ||||||
| Patch0034:     0034-tests-Test-guestfish-key-all-.-selector.patch |  | ||||||
| Patch0035:     0035-generator-customize.ml-Split-chown-parameter-on-char.patch |  | ||||||
| Patch0036:     0036-Update-common-submodule.patch |  | ||||||
| Patch0037:     0037-New-APIs-findfs_partuuid-and-findfs_partlabel.patch |  | ||||||
| Patch0038:     0038-inspection-Resolve-PARTUUID-and-PARTLABEL-in-etc-fst.patch |  | ||||||
| Patch0039:     0039-daemon-New-command_out-and-sh_out-APIs.patch |  | ||||||
| Patch0040:     0040-lib-Print-kernel-utsname-in-debug-output.patch |  | ||||||
| Patch0041:     0041-daemon-inspect-Add-some-debugging-of-usr-merging.patch |  | ||||||
| Patch0042:     0042-generator-Implement-struct-FDevice-type.patch |  | ||||||
| Patch0043:     0043-generator-Use-new-FDevice-type-for-the-pvs-full-pv_n.patch |  | ||||||
| Patch0044:     0044-daemon-inspect-Resolve-Ubuntu-22-dev-disk-by-uuid-in.patch |  | ||||||
| Patch0045:     0045-generator-Fix-implementation-of-FUUID-for-OCaml-func.patch |  | ||||||
| Patch0046:     0046-Update-common-submodule.patch |  | ||||||
| Patch0047:     0047-daemon-Rewrite-pvs-vgs-lvs-full-APIs-in-OCaml.patch |  | ||||||
| Patch0048:     0048-daemon-inspect-Resolve-Ubuntu-22-dev-disk-by-id-dm-u.patch |  | ||||||
| Patch0049:     0049-daemon-fstrim.c-Issue-sync_disks-after-fstrim.patch |  | ||||||
| Patch0050:     0050-daemon-fstrim.c-Run-the-fstrim-command-twice.patch |  | ||||||
| 
 | 
 | ||||||
| %if 0%{patches_touch_autotools} |  | ||||||
| BuildRequires: autoconf, automake, libtool, gettext-devel | BuildRequires: autoconf, automake, libtool, gettext-devel | ||||||
| %endif |  | ||||||
| 
 | 
 | ||||||
| # Basic build requirements. | # Basic build requirements. | ||||||
| BuildRequires: gcc, gcc-c++ | BuildRequires: gcc, gcc-c++ | ||||||
| @ -194,13 +156,14 @@ BuildRequires: libcap-devel | |||||||
| %if !0%{?rhel} | %if !0%{?rhel} | ||||||
| BuildRequires: libldm-devel | BuildRequires: libldm-devel | ||||||
| %endif | %endif | ||||||
| BuildRequires: jansson-devel | BuildRequires: json-c-devel | ||||||
| BuildRequires: systemd-devel | BuildRequires: systemd-devel | ||||||
| BuildRequires: bash-completion | BuildRequires: bash-completion | ||||||
| BuildRequires: /usr/bin/ping | BuildRequires: /usr/bin/ping | ||||||
| BuildRequires: /usr/bin/wget | BuildRequires: curl | ||||||
| BuildRequires: xz | BuildRequires: xz | ||||||
| BuildRequires: zstd | BuildRequires: zstd | ||||||
|  | BuildRequires: libzstd-devel | ||||||
| BuildRequires: /usr/bin/qemu-img | BuildRequires: /usr/bin/qemu-img | ||||||
| 
 | 
 | ||||||
| %if 0%{verify_tarball_signature} | %if 0%{verify_tarball_signature} | ||||||
| @ -328,7 +291,6 @@ BuildRequires: util-linux | |||||||
| BuildRequires: vim-minimal | BuildRequires: vim-minimal | ||||||
| BuildRequires: xfsprogs | BuildRequires: xfsprogs | ||||||
| BuildRequires: xz | BuildRequires: xz | ||||||
| BuildRequires: yajl |  | ||||||
| %if !0%{?rhel} | %if !0%{?rhel} | ||||||
| BuildRequires: zerofree | BuildRequires: zerofree | ||||||
| %endif | %endif | ||||||
| @ -351,6 +313,7 @@ Requires:      (%{name}-appliance = %{epoch}:%{version}-%{release} or %{name}-no | |||||||
| # The daemon dependencies are not included automatically, because it | # The daemon dependencies are not included automatically, because it | ||||||
| # is buried inside the appliance, so list them here. | # is buried inside the appliance, so list them here. | ||||||
| Requires:      augeas-libs%{?_isa} >= 1.7.0 | Requires:      augeas-libs%{?_isa} >= 1.7.0 | ||||||
|  | Requires:      json-c%{?_isa} | ||||||
| Requires:      libacl%{?_isa} | Requires:      libacl%{?_isa} | ||||||
| Requires:      libcap%{?_isa} | Requires:      libcap%{?_isa} | ||||||
| Requires:      libselinux%{?_isa} | Requires:      libselinux%{?_isa} | ||||||
| @ -358,7 +321,6 @@ Requires:      hivex-libs%{?_isa} >= 1.3.10 | |||||||
| Requires:      pcre2%{?_isa} | Requires:      pcre2%{?_isa} | ||||||
| Requires:      rpm-libs%{?_isa} >= 4.16.1.3 | Requires:      rpm-libs%{?_isa} >= 4.16.1.3 | ||||||
| Requires:      systemd-libs%{?_isa} | Requires:      systemd-libs%{?_isa} | ||||||
| Requires:      yajl%{?_isa} |  | ||||||
| 
 | 
 | ||||||
| # For core mount-local (FUSE) API. | # For core mount-local (FUSE) API. | ||||||
| Requires:      fuse | Requires:      fuse | ||||||
| @ -376,7 +338,6 @@ Requires:      xz | |||||||
| Requires:      qemu-kvm-core | Requires:      qemu-kvm-core | ||||||
| %if !0%{?rhel} | %if !0%{?rhel} | ||||||
| Suggests:      qemu-block-curl | Suggests:      qemu-block-curl | ||||||
| Suggests:      qemu-block-gluster |  | ||||||
| Suggests:      qemu-block-iscsi | Suggests:      qemu-block-iscsi | ||||||
| %endif | %endif | ||||||
| Suggests:      qemu-block-rbd | Suggests:      qemu-block-rbd | ||||||
| @ -388,6 +349,7 @@ Requires:      libvirt-daemon-driver-qemu >= 7.1.0 | |||||||
| Requires:      libvirt-daemon-driver-secret | Requires:      libvirt-daemon-driver-secret | ||||||
| Requires:      libvirt-daemon-driver-storage-core | Requires:      libvirt-daemon-driver-storage-core | ||||||
| Requires:      selinux-policy >= 3.11.1-63 | Requires:      selinux-policy >= 3.11.1-63 | ||||||
|  | Recommends:    passt | ||||||
| 
 | 
 | ||||||
| %ifarch aarch64 | %ifarch aarch64 | ||||||
| Requires:      edk2-aarch64 | Requires:      edk2-aarch64 | ||||||
| @ -459,6 +421,7 @@ Language bindings: | |||||||
| 
 | 
 | ||||||
| %package appliance | %package appliance | ||||||
| Summary:       Appliance for %{name} | Summary:       Appliance for %{name} | ||||||
|  | License:       GPL-2.0-or-later AND LGPL-2.1-or-later | ||||||
| Requires:      supermin >= 5.1.18 | Requires:      supermin >= 5.1.18 | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| @ -480,7 +443,7 @@ for %{name}. | |||||||
| %if !0%{?rhel} | %if !0%{?rhel} | ||||||
| %package forensics | %package forensics | ||||||
| Summary:       Filesystem forensics support for %{name} | Summary:       Filesystem forensics support for %{name} | ||||||
| License:       LGPLv2+ | License:       GPL-2.0-or-later | ||||||
| Requires:      %{name}%{?_isa} = %{epoch}:%{version}-%{release} | Requires:      %{name}%{?_isa} = %{epoch}:%{version}-%{release} | ||||||
| 
 | 
 | ||||||
| %description forensics | %description forensics | ||||||
| @ -492,7 +455,7 @@ want to forensically analyze disk images using The Sleuth Kit. | |||||||
| %if !0%{?rhel} | %if !0%{?rhel} | ||||||
| %package gfs2 | %package gfs2 | ||||||
| Summary:       GFS2 support for %{name} | Summary:       GFS2 support for %{name} | ||||||
| License:       LGPLv2+ | License:       GPL-2.0-or-later | ||||||
| Requires:      %{name}%{?_isa} = %{epoch}:%{version}-%{release} | Requires:      %{name}%{?_isa} = %{epoch}:%{version}-%{release} | ||||||
| 
 | 
 | ||||||
| %description gfs2 | %description gfs2 | ||||||
| @ -505,7 +468,7 @@ disk images containing GFS2. | |||||||
| %ifnarch ppc | %ifnarch ppc | ||||||
| %package hfsplus | %package hfsplus | ||||||
| Summary:       HFS+ support for %{name} | Summary:       HFS+ support for %{name} | ||||||
| License:       LGPLv2+ | License:       GPL-2.0-or-later | ||||||
| Requires:      %{name}%{?_isa} = %{epoch}:%{version}-%{release} | Requires:      %{name}%{?_isa} = %{epoch}:%{version}-%{release} | ||||||
| 
 | 
 | ||||||
| %description hfsplus | %description hfsplus | ||||||
| @ -517,7 +480,7 @@ disk images containing HFS+ / Mac OS Extended filesystems. | |||||||
| 
 | 
 | ||||||
| %package rescue | %package rescue | ||||||
| Summary:       virt-rescue shell | Summary:       virt-rescue shell | ||||||
| License:       LGPLv2+ | License:       GPL-2.0-or-later | ||||||
| Requires:      %{name}%{?_isa} = %{epoch}:%{version}-%{release} | Requires:      %{name}%{?_isa} = %{epoch}:%{version}-%{release} | ||||||
| 
 | 
 | ||||||
| %description rescue | %description rescue | ||||||
| @ -528,7 +491,7 @@ network utilities, editors and debugging utilities. | |||||||
| 
 | 
 | ||||||
| %package rsync | %package rsync | ||||||
| Summary:       rsync support for %{name} | Summary:       rsync support for %{name} | ||||||
| License:       LGPLv2+ | License:       GPL-2.0-or-later | ||||||
| Requires:      %{name}%{?_isa} = %{epoch}:%{version}-%{release} | Requires:      %{name}%{?_isa} = %{epoch}:%{version}-%{release} | ||||||
| 
 | 
 | ||||||
| %description rsync | %description rsync | ||||||
| @ -539,7 +502,7 @@ rsync to upload or download files into disk images. | |||||||
| %if !0%{?rhel} | %if !0%{?rhel} | ||||||
| %package ufs | %package ufs | ||||||
| Summary:       UFS (BSD) support for %{name} | Summary:       UFS (BSD) support for %{name} | ||||||
| License:       LGPLv2+ | License:       GPL-2.0-or-later | ||||||
| Requires:      %{name}%{?_isa} = %{epoch}:%{version}-%{release} | Requires:      %{name}%{?_isa} = %{epoch}:%{version}-%{release} | ||||||
| 
 | 
 | ||||||
| %description ufs | %description ufs | ||||||
| @ -550,7 +513,7 @@ disk images containing UFS (BSD filesystems). | |||||||
| 
 | 
 | ||||||
| %package xfs | %package xfs | ||||||
| Summary:       XFS support for %{name} | Summary:       XFS support for %{name} | ||||||
| License:       LGPLv2+ | License:       GPL-2.0-or-later | ||||||
| Requires:      %{name}%{?_isa} = %{epoch}:%{version}-%{release} | Requires:      %{name}%{?_isa} = %{epoch}:%{version}-%{release} | ||||||
| 
 | 
 | ||||||
| %description xfs | %description xfs | ||||||
| @ -562,7 +525,7 @@ disk images containing XFS. | |||||||
| %ifnarch %{arm} aarch64 s390 s390x riscv64 | %ifnarch %{arm} aarch64 s390 s390x riscv64 | ||||||
| %package zfs | %package zfs | ||||||
| Summary:       ZFS support for %{name} | Summary:       ZFS support for %{name} | ||||||
| License:       LGPLv2+ | License:       GPL-2.0-or-later | ||||||
| Requires:      %{name}%{?_isa} = %{epoch}:%{version}-%{release} | Requires:      %{name}%{?_isa} = %{epoch}:%{version}-%{release} | ||||||
| 
 | 
 | ||||||
| %description zfs | %description zfs | ||||||
| @ -574,7 +537,7 @@ disk images containing ZFS. | |||||||
| 
 | 
 | ||||||
| %package inspect-icons | %package inspect-icons | ||||||
| Summary:       Additional dependencies for inspecting guest icons | Summary:       Additional dependencies for inspecting guest icons | ||||||
| License:       LGPLv2+ | License:       LGPL-2.1-or-later | ||||||
| BuildArch:     noarch | BuildArch:     noarch | ||||||
| Requires:      %{name} = %{epoch}:%{version}-%{release} | Requires:      %{name} = %{epoch}:%{version}-%{release} | ||||||
| 
 | 
 | ||||||
| @ -594,6 +557,7 @@ having to depend on Perl.  See https://bugzilla.redhat.com/1194158 | |||||||
| 
 | 
 | ||||||
| %package bash-completion | %package bash-completion | ||||||
| Summary:       Bash tab-completion scripts for %{name} tools | Summary:       Bash tab-completion scripts for %{name} tools | ||||||
|  | License:       GPL-2.0-or-later | ||||||
| BuildArch:     noarch | BuildArch:     noarch | ||||||
| Requires:      bash-completion >= 2.0 | Requires:      bash-completion >= 2.0 | ||||||
| 
 | 
 | ||||||
| @ -725,6 +689,7 @@ golang-%{name} contains Go language bindings for %{name}. | |||||||
| 
 | 
 | ||||||
| %package man-pages-ja | %package man-pages-ja | ||||||
| Summary:       Japanese (ja) man pages for %{name} | Summary:       Japanese (ja) man pages for %{name} | ||||||
|  | License:       GPL-2.0-or-later | ||||||
| BuildArch:     noarch | BuildArch:     noarch | ||||||
| Requires:      %{name} = %{epoch}:%{version}-%{release} | Requires:      %{name} = %{epoch}:%{version}-%{release} | ||||||
| 
 | 
 | ||||||
| @ -735,6 +700,7 @@ for %{name}. | |||||||
| 
 | 
 | ||||||
| %package man-pages-uk | %package man-pages-uk | ||||||
| Summary:       Ukrainian (uk) man pages for %{name} | Summary:       Ukrainian (uk) man pages for %{name} | ||||||
|  | License:       GPL-2.0-or-later | ||||||
| BuildArch:     noarch | BuildArch:     noarch | ||||||
| Requires:      %{name} = %{epoch}:%{version}-%{release} | Requires:      %{name} = %{epoch}:%{version}-%{release} | ||||||
| 
 | 
 | ||||||
| @ -748,14 +714,9 @@ for %{name}. | |||||||
| %{gpgverify} --keyring='%{SOURCE7}' --signature='%{SOURCE1}' --data='%{SOURCE0}' | %{gpgverify} --keyring='%{SOURCE7}' --signature='%{SOURCE1}' --data='%{SOURCE0}' | ||||||
| %endif | %endif | ||||||
| %setup -q | %setup -q | ||||||
| %if 0%{?rhel} |  | ||||||
| tar zxf %{SOURCE9} |  | ||||||
| %endif |  | ||||||
| %autopatch -p1 | %autopatch -p1 | ||||||
| 
 | 
 | ||||||
| %if 0%{patches_touch_autotools} | autoreconf -fiv | ||||||
| autoreconf -i |  | ||||||
| %endif |  | ||||||
| 
 | 
 | ||||||
| # For sVirt to work, the local temporary directory we use in the tests | # For sVirt to work, the local temporary directory we use in the tests | ||||||
| # must be labelled the same way as /tmp.  This doesn't work if either | # must be labelled the same way as /tmp.  This doesn't work if either | ||||||
| @ -776,7 +737,7 @@ sed 's/@VERSION@/%{version}/g' < %{SOURCE4} > README | |||||||
| # Test if network is available. | # Test if network is available. | ||||||
| ip addr list ||: | ip addr list ||: | ||||||
| ip route list ||: | ip route list ||: | ||||||
| if ping -c 3 -w 20 8.8.8.8 && wget http://libguestfs.org -O /dev/null; then | if ping -c 3 -w 20 8.8.8.8 && curl http://libguestfs.org -o /dev/null; then | ||||||
|   extra= |   extra= | ||||||
| else | else | ||||||
|   mkdir cachedir repo |   mkdir cachedir repo | ||||||
| @ -812,11 +773,7 @@ fi | |||||||
| 
 | 
 | ||||||
| # 'INSTALLDIRS' ensures that Perl and Ruby libs are installed in the | # 'INSTALLDIRS' ensures that Perl and Ruby libs are installed in the | ||||||
| # vendor dir not the site dir. | # vendor dir not the site dir. | ||||||
| # | %make_build INSTALLDIRS=vendor | ||||||
| # In RHEL 9.5-z, %%{?_smp_mflags} causes a race condition in the |  | ||||||
| # build.  I believe this file is generated in parallel: |  | ||||||
| # podwrapper.pl: blocksize-option.pod: cannot find input file on path at /builddir/build/BUILD/libguestfs-1.50.2/podwrapper.pl line 672. |  | ||||||
| make V=1 INSTALLDIRS=vendor |  | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| %check | %check | ||||||
| @ -842,7 +799,7 @@ fi | |||||||
| %install | %install | ||||||
| # 'INSTALLDIRS' ensures that Perl and Ruby libs are installed in the | # 'INSTALLDIRS' ensures that Perl and Ruby libs are installed in the | ||||||
| # vendor dir not the site dir. | # vendor dir not the site dir. | ||||||
| make DESTDIR=$RPM_BUILD_ROOT INSTALLDIRS=vendor install | %make_install INSTALLDIRS=vendor | ||||||
| 
 | 
 | ||||||
| # Delete static libraries. | # Delete static libraries. | ||||||
| rm $( find $RPM_BUILD_ROOT -name '*.a' | grep -v /ocaml/ ) | rm $( find $RPM_BUILD_ROOT -name '*.a' | grep -v /ocaml/ ) | ||||||
| @ -1157,17 +1114,33 @@ rm ocaml/html/.gitignore | |||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| %changelog | %changelog | ||||||
| * Wed Apr 30 2025 Richard W.M. Jones <rjones@redhat.com> - 1:1.50.2-4 | * Thu May 08 2025 Richard W.M. Jones <rjones@redhat.com> - 1:1.54.0-8 | ||||||
| - Run the fstrim command twice to workaround RHEL 9.5 kernel trimming bug | - Remove duplicate root mountpoints in /etc/fstab | ||||||
|   resolves: RHEL-89045 |   resolves: RHEL-90168 | ||||||
| 
 | 
 | ||||||
| * Tue Apr 29 2025 Richard W.M. Jones <rjones@redhat.com> - 1:1.50.2-3 | * Fri Apr 25 2025 Richard W.M. Jones <rjones@redhat.com> - 1:1.54.0-7 | ||||||
|  | - Run the fstrim command twice | ||||||
|  |   resolves: RHEL-88508 | ||||||
|  | 
 | ||||||
|  | * Wed Apr 16 2025 Richard W.M. Jones <rjones@redhat.com> - 1:1.54.0-6 | ||||||
| - Fix virt-v2v conversion of split /usr Ubuntu 22+ | - Fix virt-v2v conversion of split /usr Ubuntu 22+ | ||||||
|   resolves: RHEL-88803 |   resolves: RHEL-87493 | ||||||
| 
 | 
 | ||||||
| * Thu Feb 27 2025 Richard W.M. Jones <rjones@redhat.com> - 1:1.50.2-2 | * Tue Mar 11 2025 Richard W.M. Jones <rjones@redhat.com> - 1:1.54.0-5 | ||||||
|  | - Include host kernel information in libguestfs debugging output | ||||||
|  |   resolves: RHEL-83025 | ||||||
|  | 
 | ||||||
|  | * Mon Feb 24 2025 Richard W.M. Jones <rjones@redhat.com> - 1:1.54.0-4 | ||||||
| - Add new APIs to allow command output > 4MB | - Add new APIs to allow command output > 4MB | ||||||
|   resolves: RHEL-81095 |   resolves: RHEL-80159 | ||||||
|  | 
 | ||||||
|  | * Wed Oct 30 2024 Richard W.M. Jones <rjones@redhat.com> - 1:1.54.0-3 | ||||||
|  | - Rebase to libguestfs 1.54.0 | ||||||
|  |   resolves: RHEL-56809 | ||||||
|  | - Fix osinfo for Windows Server 2025 | ||||||
|  |   resolves: RHEL-62935 | ||||||
|  | - Replace Jansson with json-c | ||||||
|  |   resolves: RHEL-65292 | ||||||
| 
 | 
 | ||||||
| * Tue Jul 09 2024 Richard W.M. Jones <rjones@redhat.com> - 1:1.50.2-1 | * Tue Jul 09 2024 Richard W.M. Jones <rjones@redhat.com> - 1:1.50.2-1 | ||||||
| - Update to libguestfs 1.50.2 | - Update to libguestfs 1.50.2 | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user