diff --git a/0002-RHEL-Disable-unsupported-remote-drive-protocols-RHBZ.patch b/0001-RHEL-Disable-unsupported-remote-drive-protocols-RHBZ.patch similarity index 99% rename from 0002-RHEL-Disable-unsupported-remote-drive-protocols-RHBZ.patch rename to 0001-RHEL-Disable-unsupported-remote-drive-protocols-RHBZ.patch index 5308aac..d014993 100644 --- a/0002-RHEL-Disable-unsupported-remote-drive-protocols-RHBZ.patch +++ b/0001-RHEL-Disable-unsupported-remote-drive-protocols-RHBZ.patch @@ -1,4 +1,4 @@ -From d9e9cc39c92288b713320b4d7f6f66d1b1e4ff42 Mon Sep 17 00:00:00 2001 +From b0aecd2b8c6a1ea12a30c534641126e0f2a0b176 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Mon, 29 Jul 2013 14:47:56 +0100 Subject: [PATCH] RHEL: Disable unsupported remote drive protocols @@ -180,7 +180,7 @@ index e4e1021db..8419ce78a 100755 rm test-add-uri.out rm test-add-uri.img diff --git a/generator/actions_core.ml b/generator/actions_core.ml -index b4ec6db87..9c23da008 100644 +index 3889e0215..c198b8206 100644 --- a/generator/actions_core.ml +++ b/generator/actions_core.ml @@ -343,22 +343,6 @@ F is interpreted as a local file or device. @@ -249,7 +249,7 @@ index b4ec6db87..9c23da008 100644 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. If in doubt, diff --git a/lib/drives.c b/lib/drives.c -index 6a62623d5..8c334c6c7 100644 +index edb1e060f..c3fb90ae8 100644 --- a/lib/drives.c +++ b/lib/drives.c @@ -166,34 +166,6 @@ create_drive_non_file (guestfs_h *g, diff --git a/0001-generator-daemon.ml-Avoid-not-available-macro-for-OC.patch b/0001-generator-daemon.ml-Avoid-not-available-macro-for-OC.patch deleted file mode 100644 index 4091d0b..0000000 --- a/0001-generator-daemon.ml-Avoid-not-available-macro-for-OC.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 07ea5915766d829b62255fb2a94239a28f433159 Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Mon, 19 Jan 2026 21:36:08 +0000 -Subject: [PATCH] generator/daemon.ml: Avoid not available macro for OCaml - functions - -Reported-by: Toolybird -Fixes: https://github.com/libguestfs/libguestfs/issues/290 -(cherry picked from commit 1b79e22be443b48dc2bdb518cfea14342b3d8136) ---- - generator/daemon.ml | 8 +++++++- - 1 file changed, 7 insertions(+), 1 deletion(-) - -diff --git a/generator/daemon.ml b/generator/daemon.ml -index 65844309e..f1f954087 100644 ---- a/generator/daemon.ml -+++ b/generator/daemon.ml -@@ -1054,7 +1054,8 @@ let generate_daemon_optgroups_h () = - pr "#define OPTGROUP_%s_NOT_AVAILABLE \\\n" - (String.uppercase_ascii group); - List.iter ( -- fun { name; style = ret, args, optargs } -> -+ function -+ | { name; style = ret, args, optargs; impl = C } -> - let style = ret, args @ args_of_optargs optargs, [] in - pr " "; - generate_prototype -@@ -1065,6 +1066,11 @@ let generate_daemon_optgroups_h () = - ~semicolon:false - name style; - pr " { abort (); } \\\n" -+ | { impl = OCaml _ } -> -+ (* Don't need to generate anything for OCaml functions since -+ * the caml-stubs do_* function will still exist. -+ *) -+ () - ) fns; - pr " int optgroup_%s_available (void) { return 0; }\n" group; - pr "\n" --- -2.47.3 - diff --git a/0003-RHEL-Reject-use-of-libguestfs-winsupport-features-ex.patch b/0002-RHEL-Reject-use-of-libguestfs-winsupport-features-ex.patch similarity index 97% rename from 0003-RHEL-Reject-use-of-libguestfs-winsupport-features-ex.patch rename to 0002-RHEL-Reject-use-of-libguestfs-winsupport-features-ex.patch index 70a1b8f..3f1d920 100644 --- a/0003-RHEL-Reject-use-of-libguestfs-winsupport-features-ex.patch +++ b/0002-RHEL-Reject-use-of-libguestfs-winsupport-features-ex.patch @@ -1,4 +1,4 @@ -From 3319a68b51de8ded8a76dcd72f8fce804dd581a4 Mon Sep 17 00:00:00 2001 +From 34256ecfaabca8abe8e886f0f72e0991dec66e3e Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 7 Jul 2015 09:28:03 -0400 Subject: [PATCH] RHEL: Reject use of libguestfs-winsupport features except for diff --git a/0004-RHEL-appliance-init-Run-depmod-a-to-rebuild-kernel-m.patch b/0003-RHEL-appliance-init-Run-depmod-a-to-rebuild-kernel-m.patch similarity index 77% rename from 0004-RHEL-appliance-init-Run-depmod-a-to-rebuild-kernel-m.patch rename to 0003-RHEL-appliance-init-Run-depmod-a-to-rebuild-kernel-m.patch index 72dfae0..156c90d 100644 --- a/0004-RHEL-appliance-init-Run-depmod-a-to-rebuild-kernel-m.patch +++ b/0003-RHEL-appliance-init-Run-depmod-a-to-rebuild-kernel-m.patch @@ -1,4 +1,4 @@ -From 4641910dc6aff98c3451041919dcca62b96e4cb7 Mon Sep 17 00:00:00 2001 +From a775d13e9390814f22c3ae6097096885b8236d4e Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 13 May 2025 17:28:25 +0100 Subject: [PATCH] RHEL: appliance/init: Run depmod -a to rebuild kernel module @@ -9,12 +9,12 @@ Subject: [PATCH] RHEL: appliance/init: Run depmod -a to rebuild kernel module 1 file changed, 3 insertions(+) diff --git a/appliance/init b/appliance/init -index 62526ac77..c94f50079 100755 +index 67955b024..e8d8f616c 100755 --- a/appliance/init +++ b/appliance/init -@@ -116,6 +116,9 @@ $UDEVD --daemon #--debug - udevadm trigger +@@ -120,6 +120,9 @@ udevadm trigger udevadm settle --timeout=600 + #udevadm monitor -p & +# Recreate module dependencies (RHEL only) +depmod -a diff --git a/0004-RHEL-Use-alternate-location-for-qemu-kvm-in-direct-b.patch b/0004-RHEL-Use-alternate-location-for-qemu-kvm-in-direct-b.patch new file mode 100644 index 0000000..7c895bc --- /dev/null +++ b/0004-RHEL-Use-alternate-location-for-qemu-kvm-in-direct-b.patch @@ -0,0 +1,30 @@ +From 991ad10b965e4975903bce781ab23be4c5645d8e Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Tue, 17 Mar 2026 20:14:16 +0000 +Subject: [PATCH] RHEL: Use alternate location for qemu-kvm in direct backend + +We don't have to change the libvirt backend since libvirt knows where +to find qemu on RHEL. +--- + lib/launch-direct.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/lib/launch-direct.c b/lib/launch-direct.c +index b2021ee2c..12f969c7e 100644 +--- a/lib/launch-direct.c ++++ b/lib/launch-direct.c +@@ -446,6 +446,11 @@ free_pid_path: + static const char * + get_default_hv_direct (guestfs_h *g, void *datav) + { ++ /* RHEL puts qemu in a strange place. */ ++ static const char rhel_qemu[] = "/usr/libexec/qemu-kvm"; ++ if (access (rhel_qemu, X_OK) == 0) ++ return rhel_qemu; ++ + if (host_cpu[0] == 'i' && strchr ("3456", host_cpu[1]) && + host_cpu[2] == '8' && host_cpu[3] == '6' && host_cpu[4] == '\0') + return "qemu-system-i386"; +-- +2.47.3 + diff --git a/0005-lib-qemu.c-Use-machine-type-none-when-inspecting-QMP.patch b/0005-lib-qemu.c-Use-machine-type-none-when-inspecting-QMP.patch deleted file mode 100644 index a77013f..0000000 --- a/0005-lib-qemu.c-Use-machine-type-none-when-inspecting-QMP.patch +++ /dev/null @@ -1,47 +0,0 @@ -From d448d69171b5c1ee14a4eca5dc4964840ba99507 Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Mon, 26 Jan 2026 14:30:46 +0000 -Subject: [PATCH] lib/qemu.c: Use machine type none when inspecting QMP - properties -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Dan mentioned that there is a special machine type ("none") we can use -when querying for KVM. It has no CPU, memory, etc and does not run, -but you can still enable KVM for it. - -Note we have to remove the -cpu parameter, otherwise qemu prints this -error: - - qemu-kvm: apic-id property was not initialized properly - -Updates: commit 5da8102f5f59b9781075440dc68c8d08f9c8691e -Suggested-by: Daniel P. Berrangé -(cherry picked from commit f7a24b2ea81f3c5c2754fcf43e0347c7c5378b4a) ---- - lib/qemu.c | 8 +------- - 1 file changed, 1 insertion(+), 7 deletions(-) - -diff --git a/lib/qemu.c b/lib/qemu.c -index 19b5aa336..9edbe8208 100644 ---- a/lib/qemu.c -+++ b/lib/qemu.c -@@ -81,13 +81,7 @@ generic_qmp_test (guestfs_h *g, const char *qmp_command, char **outp) - guestfs_int_cmd_add_string_unquoted (cmd, "QEMU_AUDIO_DRV=none "); - guestfs_int_cmd_add_string_quoted (cmd, g->hv); - guestfs_int_cmd_add_string_unquoted (cmd, " -display none"); -- guestfs_int_cmd_add_string_unquoted (cmd, " -cpu max"); -- guestfs_int_cmd_add_string_unquoted (cmd, " -machine "); -- guestfs_int_cmd_add_string_quoted (cmd, --#ifdef MACHINE_TYPE -- MACHINE_TYPE "," --#endif -- "accel=kvm:hvf:tcg"); -+ guestfs_int_cmd_add_string_unquoted (cmd, " -machine none,accel=kvm:hvf:tcg"); - guestfs_int_cmd_add_string_unquoted (cmd, " -qmp stdio"); - guestfs_int_cmd_add_string_unquoted (cmd, " -S"); - guestfs_int_cmd_clear_capture_errors (cmd); --- -2.47.3 - diff --git a/0006-generator-Fix-description-of-xfs_growfs.patch b/0006-generator-Fix-description-of-xfs_growfs.patch deleted file mode 100644 index 3e5d6fd..0000000 --- a/0006-generator-Fix-description-of-xfs_growfs.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 43d8a4970bbd908ed4b583335f1f4f42a3f6f354 Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Fri, 23 Jan 2026 08:47:42 +0000 -Subject: [PATCH] generator: Fix description of xfs_growfs - -This function does not return "geometry information". Remove -the bogus description. - -(cherry picked from commit 6166304be685b2fafb8cc968a4558a906bb0609b) ---- - generator/actions_core.ml | 6 +----- - 1 file changed, 1 insertion(+), 5 deletions(-) - -diff --git a/generator/actions_core.ml b/generator/actions_core.ml -index 9c23da008..de95bdaf0 100644 ---- a/generator/actions_core.ml -+++ b/generator/actions_core.ml -@@ -7332,11 +7332,7 @@ in the returned structure is defined by the API." }; - ["xfs_info"; "/"]], "ret->xfs_blocksize == 4096"), []; - ]; - shortdesc = "expand an existing XFS filesystem"; -- longdesc = {|Grow the XFS filesystem mounted at C. -- --The returned struct contains geometry information. Missing --fields are returned as C<-1> (for numeric fields) or empty --string.|} }; -+ longdesc = {|Grow the XFS filesystem mounted at C.|} }; - - { defaults with - name = "rsync"; added = (1, 19, 29); --- -2.47.3 - diff --git a/0007-generator-Fix-description-of-xfs_info.patch b/0007-generator-Fix-description-of-xfs_info.patch deleted file mode 100644 index 36a8105..0000000 --- a/0007-generator-Fix-description-of-xfs_info.patch +++ /dev/null @@ -1,36 +0,0 @@ -From d5daad98cfe254c14f4f4f12348f1589838c36a8 Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Fri, 23 Jan 2026 08:49:14 +0000 -Subject: [PATCH] generator: Fix description of xfs_info - -The returned struct contains filesystem metadata, not "geometry -information" (whatever that means). - -(cherry picked from commit 1c9c03bcd40ede11e7f4ece44dab908dcd36a657) ---- - generator/actions_core.ml | 7 ++++--- - 1 file changed, 4 insertions(+), 3 deletions(-) - -diff --git a/generator/actions_core.ml b/generator/actions_core.ml -index de95bdaf0..b57cf56b0 100644 ---- a/generator/actions_core.ml -+++ b/generator/actions_core.ml -@@ -7236,11 +7236,12 @@ call C.|} }; - ["mount"; "/dev/sda1"; "/"]; - ["xfs_info"; "/"]], "ret->xfs_blocksize == 4096"), [] - ]; -- shortdesc = "get geometry of XFS filesystem"; -+ shortdesc = "get information about the XFS filesystem"; - longdesc = {|C is a mounted XFS filesystem or a device containing --an XFS filesystem. This command returns the geometry of the filesystem. -+an XFS filesystem. This command returns miscellaneous -+metadata about the XFS filesystem. - --The returned struct contains geometry information. Missing -+The returned struct contains miscellaneous metadata. Missing - fields are returned as C<-1> (for numeric fields) or empty - string.|} }; - --- -2.47.3 - diff --git a/0008-New-API-xfs_info2.patch b/0008-New-API-xfs_info2.patch deleted file mode 100644 index 4bce713..0000000 --- a/0008-New-API-xfs_info2.patch +++ /dev/null @@ -1,351 +0,0 @@ -From aac2ec68202f2913ae6000aa117a8ed5dffbd6bb Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Fri, 23 Jan 2026 08:58:07 +0000 -Subject: [PATCH] New API: xfs_info2 - -Reimplement xfs_info by returning a hash table of values (rather than -a limited struct), and by writing it in OCaml with PCRE which makes -string parsing a lot simpler. This will now flexibly return all the -fields from the underlying xfs_info command, even (hopefully) future -fields. - -Note the field values are returned as strings, because the actual -fields in xfs_info output are fairly random and free-form. There is a -trade off here between returning as much information as we can, and -requiring the user to do a bit of (simple) field parsing. - -Fixes: https://issues.redhat.com/browse/RHEL-143673 -(cherry picked from commit dfd2700616dee92d75e91936fb56b5de0450f992) ---- - .gitignore | 1 + - common | 2 +- - daemon/Makefile.am | 7 ++- - daemon/xfs.ml | 128 ++++++++++++++++++++++++++++++++++++++ - generator/actions_core.ml | 35 +++++++++++ - generator/proc_nr.ml | 1 + - lib/MAX_PROC_NR | 2 +- - 7 files changed, 172 insertions(+), 4 deletions(-) - create mode 100644 daemon/xfs.ml - -diff --git a/.gitignore b/.gitignore -index 02160caff..c8a8312fa 100644 ---- a/.gitignore -+++ b/.gitignore -@@ -119,6 +119,7 @@ Makefile.in - /daemon/stubs-?.c - /daemon/stubs.h - /daemon/types.ml -+/daemon/xfs.mli - /depcomp - /docs/guestfs-building.1 - /docs/guestfs-faq.1 -Submodule common b54ba2031..3ac5d1841: -diff --git a/common/mlpcre/PCRE.ml b/common/mlpcre/PCRE.ml -index 077290e..33074af 100644 ---- a/common/mlpcre/PCRE.ml -+++ b/common/mlpcre/PCRE.ml -@@ -22,7 +22,7 @@ exception Error of string * int - - type regexp - --external compile : ?caseless:bool -> ?dotall:bool -> ?extended:bool -> ?multiline:bool -> string -> regexp = "guestfs_int_pcre_compile" -+external compile : ?anchored:bool -> ?caseless:bool -> ?dotall:bool -> ?extended:bool -> ?multiline:bool -> string -> regexp = "guestfs_int_pcre_compile_byte" "guestfs_int_pcre_compile" - external matches : ?offset:int -> regexp -> string -> bool = "guestfs_int_pcre_matches" - external sub : int -> string = "guestfs_int_pcre_sub" - external subi : int -> int * int = "guestfs_int_pcre_subi" -diff --git a/common/mlpcre/PCRE.mli b/common/mlpcre/PCRE.mli -index b69a56b..0fdc2bd 100644 ---- a/common/mlpcre/PCRE.mli -+++ b/common/mlpcre/PCRE.mli -@@ -52,11 +52,12 @@ exception Error of string * int - type regexp - (** The type of a compiled regular expression. *) - --val compile : ?caseless:bool -> ?dotall:bool -> ?extended:bool -> ?multiline:bool -> string -> regexp -+val compile : ?anchored:bool -> ?caseless:bool -> ?dotall:bool -> -+ ?extended:bool -> ?multiline:bool -> string -> regexp - (** Compile a regular expression. This can raise {!Error}. - -- The flags [?caseless], [?dotall], [?extended], [?multiline] -- correspond to the [pcre_compile] flags [PCRE_CASELESS] etc. -+ The flags [?anchored], [?caseless], [?dotall], [?extended], [?multiline] -+ correspond to the [pcre_compile] flags [PCRE_ANCHORED] etc. - See pcre2api(3) for details of what they do. - All flags default to false. *) - -diff --git a/common/mlpcre/pcre-c.c b/common/mlpcre/pcre-c.c -index 3959fd5..11be157 100644 ---- a/common/mlpcre/pcre-c.c -+++ b/common/mlpcre/pcre-c.c -@@ -154,11 +154,12 @@ Optint_val (value intv, int defval) - } - - value --guestfs_int_pcre_compile (value caselessv, value dotallv, -- value extendedv, value multilinev, -+guestfs_int_pcre_compile (value anchoredv, value caselessv, -+ value dotallv, value extendedv, -+ value multilinev, - value pattv) - { -- CAMLparam4 (caselessv, dotallv, extendedv, multilinev); -+ CAMLparam5 (anchoredv, caselessv, dotallv, extendedv, multilinev); - CAMLxparam1 (pattv); - const char *patt; - int options = 0; -@@ -167,6 +168,8 @@ guestfs_int_pcre_compile (value caselessv, value dotallv, - PCRE2_SIZE errnum; - - /* Flag parameters are all ‘bool option’, defaulting to false. */ -+ if (is_Some_true (anchoredv)) -+ options |= PCRE2_ANCHORED; - if (is_Some_true (caselessv)) - options |= PCRE2_CASELESS; - if (is_Some_true (dotallv)) -@@ -186,6 +189,14 @@ guestfs_int_pcre_compile (value caselessv, value dotallv, - CAMLreturn (Val_regexp (re)); - } - -+value -+guestfs_int_pcre_compile_byte (value *argv, int argn) -+{ -+ assert (argn == 6); -+ return guestfs_int_pcre_compile (argv[0], argv[1], argv[2], -+ argv[3], argv[4], argv[5]); -+} -+ - value - guestfs_int_pcre_matches (value offsetv, value rev, value strv) - { -diff --git a/daemon/Makefile.am b/daemon/Makefile.am -index c644d9881..d4a805046 100644 ---- a/daemon/Makefile.am -+++ b/daemon/Makefile.am -@@ -63,7 +63,8 @@ generator_built = \ - sfdisk.mli \ - statvfs.mli \ - structs.ml \ -- structs.mli -+ structs.mli \ -+ xfs.mli - - CONFIGURE_GENERATED_ML = \ - daemon_config.ml -@@ -312,7 +313,8 @@ SOURCES_MLI = \ - statvfs.mli \ - structs.mli \ - sysroot.mli \ -- utils.mli -+ utils.mli \ -+ xfs.mli - - SOURCES_ML = \ - $(CONFIGURE_GENERATED_ML) \ -@@ -347,6 +349,7 @@ SOURCES_ML = \ - realpath.ml \ - statvfs.ml \ - selinux.ml \ -+ xfs.ml \ - inspect_types.ml \ - inspect_utils.ml \ - inspect_fs_unix_fstab.ml \ -diff --git a/daemon/xfs.ml b/daemon/xfs.ml -new file mode 100644 -index 000000000..142b26775 ---- /dev/null -+++ b/daemon/xfs.ml -@@ -0,0 +1,128 @@ -+(* guestfs-inspection -+ * Copyright (C) 2009-2025 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. -+ *) -+ -+open Printf -+ -+open Std_utils -+ -+open Utils -+ -+(* The output is horrific ... -+ -+meta-data=/dev/sda1 isize=512 agcount=4, agsize=122094659 blks -+ = sectsz=4096 attr=2, projid32bit=1 -+ = crc=1 finobt=1, sparse=1, rmapbt=0 -+ = reflink=1 bigtime=1 inobtcount=1 nrext64=0 -+ = exchange=0 metadir=0 -+data = bsize=4096 blocks=488378636, imaxpct=5 -+ = sunit=0 swidth=0 blks -+naming =version 2 bsize=4096 ascii-ci=0, ftype=1, parent=0 -+log =internal log bsize=4096 blocks=238466, version=2 -+ = sectsz=4096 sunit=1 blks, lazy-count=1 -+realtime =none extsz=4096 blocks=0, rtextents=0 -+ = rgcount=0 rgsize=0 extents -+ = zoned=0 start=0 reserved=0 -+ -+^heading ^"stuff" ^ data fields vaguely related to heading -+ -+Note also the inconsistent use of commas. -+*) -+ -+(* Split into groups using a positive lookahead assertion. *) -+let re1 = PCRE.compile ~extended:true {| \n (?=[a-z]) |} -+ -+(* Separate group heading and the rest. *) -+let re2 = PCRE.compile ~extended:true {| = |} -+ -+(* Match the first field in a group (if present). *) -+let re3 = PCRE.compile ~anchored:true ~extended:true {| -+ (version\s\d+|\S+\slog|\S+).* -+|} -+ -+(* Match next field=value in group. *) -+let re4 = PCRE.compile ~extended:true {| -+ ([-\w]+)=(\d+(\s(blks|extents))?) -+|} -+ -+let xfs_info2 dev = -+ (* Uncomment the first line to enable extra debugging. *) -+ (*let extra_debug = verbose () in*) -+ let extra_debug = false in -+ -+ let is_dev = is_device_parameter dev in -+ let arg = if is_dev then dev else Sysroot.sysroot_path dev in -+ let out = command "xfs_info" [arg] in -+ -+ (* Split the output by heading. *) -+ let groups = PCRE.nsplit re1 out in -+ let groups = List.map (PCRE.split re2) groups in -+ let groups = List.map (fun (name, rest) -> String.trim name, rest) groups in -+ -+ if extra_debug then ( -+ List.iteri ( -+ fun i (name, rest) -> -+ eprintf "xfs_info2: group %d: %S: %S\n%!" i name rest -+ ) groups -+ ); -+ -+ (* Parse each group into the final list of values. *) -+ let values = ref [] in -+ List.iter ( -+ fun (group_name, rest) -> -+ let len = String.length rest in -+ -+ (* If there is some string at the beginning of the -+ * group then we create a (group_name, string) value, -+ * eg. ("meta-data", "/dev/sda1") -+ *) -+ let start = -+ if PCRE.matches re3 rest then ( -+ let value = PCRE.sub 1 in -+ List.push_front (group_name, value) values; -+ (* Start parsing after this. *) -+ String.length value -+ ) -+ else 0 in -+ -+ let rec loop i = -+ if extra_debug then -+ eprintf "xfs_info2: parsing group %S from %d\n%!" group_name i; -+ if i <= len && PCRE.matches ~offset:i re4 rest then ( -+ let field_name = PCRE.sub 1 in -+ if extra_debug then eprintf "xfs_info2: sub1=%S\n%!" field_name; -+ let value = PCRE.sub 2 in -+ if extra_debug then eprintf "xfs_info2: sub2=%S\n%!" value; -+ let name = sprintf "%s.%s" group_name field_name in -+ List.push_front (name, value) values; -+ -+ (* Next time round the loop, start parsing after the -+ * current matched subexpression. -+ *) -+ loop (snd (PCRE.subi 2) + 1) -+ ) -+ in -+ (try -+ loop start -+ with -+ Not_found -> -+ failwithf "xfs_info2: internal error: unexpected Not_found exception. Enable debug and send the full output in a bug report." -+ ); -+ -+ ) groups; -+ -+ List.rev !values -diff --git a/generator/actions_core.ml b/generator/actions_core.ml -index b57cf56b0..b7e4dae45 100644 ---- a/generator/actions_core.ml -+++ b/generator/actions_core.ml -@@ -9575,4 +9575,39 @@ The optional C boolean controls whether the context - is reset for customizable files, and also whether the - user, role and range parts of the file context is changed.|} }; - -+ { defaults with -+ name = "xfs_info2"; added = (1, 59, 2); -+ style = RHashtable (RPlainString, RPlainString, "info"), [String (Dev_or_Path, "pathordevice")], []; -+ impl = OCaml "Xfs.xfs_info2"; -+ optional = Some "xfs"; -+ tests = [ -+ InitEmpty, Always, TestResult ( -+ [["part_disk"; "/dev/sda"; "mbr"]; -+ ["mkfs"; "xfs"; "/dev/sda1"; ""; "NOARG"; ""; ""; "NOARG"]; -+ ["mount"; "/dev/sda1"; "/"]; -+ ["xfs_info2"; "/"]], -+ "check_hash (ret, \"data.bsize\", \"4096\") == 0"), [] -+ ]; -+ shortdesc = "get information about the XFS filesystem"; -+ longdesc = {|C is a mounted XFS filesystem or -+a device containing an XFS filesystem. This command returns -+miscellaneous metadata about the XFS filesystem. -+ -+The output is a hash derived from the output of L, -+and generally looks like: -+ -+ meta-data: /dev/sda1 -+ meta-data.isize: 512 -+ meta-data.agcount: 4 -+ meta-data.agsize: 65528 blks -+ meta-data.sectsz: 512 -+ meta-data.attr: 2 -+ meta-data.projid32bit: 1 -+ meta-data.crc: 1 -+ [...] -+ data.bsize: 4096 -+ data.blocks: 262112 -+ [...] -+ -+More information can be found by reading L.|} }; - ] -diff --git a/generator/proc_nr.ml b/generator/proc_nr.ml -index 11e7b9d1b..b22d88b58 100644 ---- a/generator/proc_nr.ml -+++ b/generator/proc_nr.ml -@@ -524,6 +524,7 @@ let proc_nr = [ - 519, "setfiles"; - 520, "ntfs_chmod"; - 521, "inspect_get_windows_group_policy"; -+522, "xfs_info2"; - ] - - (* 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 5a232f264..ec0e415d0 100644 ---- a/lib/MAX_PROC_NR -+++ b/lib/MAX_PROC_NR -@@ -1 +1 @@ --521 -+522 --- -2.47.3 - diff --git a/0009-daemon-Reimplement-xfs_info-using-xfs_info2.patch b/0009-daemon-Reimplement-xfs_info-using-xfs_info2.patch deleted file mode 100644 index 811f5b2..0000000 --- a/0009-daemon-Reimplement-xfs_info-using-xfs_info2.patch +++ /dev/null @@ -1,411 +0,0 @@ -From fb77334e1c40ac64535f2e36ee6edbdf54a5a6ac Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Fri, 23 Jan 2026 12:27:39 +0000 -Subject: [PATCH] daemon: Reimplement xfs_info using xfs_info2 - -Remove all the complicated old C parsing code and reimplement xfs_info -using xfs_info2. Note that this function will be deprecated. - -(cherry picked from commit e1deb358ce19685e4d078a64edfdbe1da7ddf63c) ---- - daemon/xfs.c | 310 -------------------------------------- - daemon/xfs.ml | 45 ++++++ - generator/actions_core.ml | 1 + - 3 files changed, 46 insertions(+), 310 deletions(-) - -diff --git a/daemon/xfs.c b/daemon/xfs.c -index aa056ddff..06e5fc072 100644 ---- a/daemon/xfs.c -+++ b/daemon/xfs.c -@@ -38,316 +38,6 @@ optgroup_xfs_available (void) - return prog_exists ("mkfs.xfs"); - } - --/* Return everything up to the first comma, equals or space in the input -- * string, strdup'ing the return value. -- */ --static char * --split_strdup (char *string) --{ -- size_t len; -- char *ret; -- -- len = strcspn (string, " ,="); -- ret = strndup (string, len); -- if (!ret) { -- reply_with_perror ("malloc"); -- return NULL; -- } -- return ret; --} -- --static int --parse_uint32 (uint32_t *ret, const char *str) --{ -- uint32_t r; -- -- if (sscanf (str, "%" SCNu32, &r) != 1) { -- reply_with_error ("cannot parse numeric field from xfs_info: %s", str); -- return -1; -- } -- -- *ret = r; -- return 0; --} -- --static int --parse_uint64 (uint64_t *ret, const char *str) --{ -- uint64_t r; -- -- if (sscanf (str, "%" SCNu64, &r) != 1) { -- reply_with_error ("cannot parse numeric field from xfs_info: %s", str); -- return -1; -- } -- -- *ret = r; -- return 0; --} -- --/* Typical crazy output from the xfs_info command: -- * -- * meta-data=/dev/sda1 isize=256 agcount=4, agsize=6392 blks -- * = sectsz=512 attr=2 -- *[ = crc=0 ] -- * data = bsize=4096 blocks=25568, imaxpct=25 -- * = sunit=0 swidth=0 blks -- * naming =version 2 bsize=4096 ascii-ci=0 -- * log =internal bsize=4096 blocks=1200, version=2 -- * = sectsz=512 sunit=0 blks, lazy-count=1 -- * realtime =none extsz=4096 blocks=0, rtextents=0 -- * -- * [...] line only appears in Fedora >= 21 -- * -- * We may need to revisit this parsing code if the output changes -- * in future. -- */ --static guestfs_int_xfsinfo * --parse_xfs_info (char **lines) --{ -- guestfs_int_xfsinfo *ret; -- CLEANUP_FREE char *section = NULL; /* first column, eg "meta-data", "data" */ -- char *p; -- size_t i; -- -- ret = malloc (sizeof *ret); -- if (ret == NULL) { -- reply_with_error ("malloc"); -- return NULL; -- } -- -- /* Initialize fields to NULL or -1 so the caller can tell which fields -- * were updated in the code below. -- */ -- ret->xfs_mntpoint = NULL; -- ret->xfs_inodesize = -1; -- ret->xfs_agcount = -1; -- ret->xfs_agsize = -1; -- ret->xfs_sectsize = -1; -- ret->xfs_attr = -1; -- ret->xfs_blocksize = -1; -- ret->xfs_datablocks = -1; -- ret->xfs_imaxpct = -1; -- ret->xfs_sunit = -1; -- ret->xfs_swidth = -1; -- ret->xfs_dirversion = -1; -- ret->xfs_dirblocksize = -1; -- ret->xfs_cimode = -1; -- ret->xfs_logname = NULL; -- ret->xfs_logblocksize = -1; -- ret->xfs_logblocks = -1; -- ret->xfs_logversion = -1; -- ret->xfs_logsectsize = -1; -- ret->xfs_logsunit = -1; -- ret->xfs_lazycount = -1; -- ret->xfs_rtname = NULL; -- ret->xfs_rtextsize = -1; -- ret->xfs_rtblocks = -1; -- ret->xfs_rtextents = -1; -- -- for (i = 0; lines[i] != NULL; ++i) { -- if (verbose) -- fprintf (stderr, "xfs_info: lines[%zu] = \'%s\'\n", i, lines[i]); -- -- if (c_isalpha (lines[i][0])) { -- free (section); -- section = split_strdup (lines[i]); -- if (!section) goto error; -- -- if (verbose) -- fprintf (stderr, "xfs_info: new section %s\n", section); -- } -- -- if ((p = strstr (lines[i], "meta-data="))) { -- ret->xfs_mntpoint = split_strdup (p + 10); -- if (ret->xfs_mntpoint == NULL) goto error; -- } -- if ((p = strstr (lines[i], "isize="))) { -- CLEANUP_FREE char *buf = split_strdup (p + 6); -- if (buf == NULL) goto error; -- if (parse_uint32 (&ret->xfs_inodesize, buf) == -1) -- goto error; -- } -- if ((p = strstr (lines[i], "agcount="))) { -- CLEANUP_FREE char *buf = split_strdup (p + 8); -- if (buf == NULL) goto error; -- if (parse_uint32 (&ret->xfs_agcount, buf) == -1) -- goto error; -- } -- if ((p = strstr (lines[i], "agsize="))) { -- CLEANUP_FREE char *buf = split_strdup (p + 7); -- if (buf == NULL) goto error; -- if (parse_uint32 (&ret->xfs_agsize, buf) == -1) -- goto error; -- } -- if ((p = strstr (lines[i], "sectsz="))) { -- if (section) { -- CLEANUP_FREE char *buf = split_strdup (p + 7); -- if (buf == NULL) goto error; -- if (STREQ (section, "meta-data")) { -- if (parse_uint32 (&ret->xfs_sectsize, buf) == -1) -- goto error; -- } else if (STREQ (section, "log")) { -- if (parse_uint32 (&ret->xfs_logsectsize, buf) == -1) -- goto error; -- } -- } -- } -- if ((p = strstr (lines[i], "attr="))) { -- CLEANUP_FREE char *buf = split_strdup (p + 5); -- if (buf == NULL) goto error; -- if (parse_uint32 (&ret->xfs_attr, buf) == -1) -- goto error; -- } -- if ((p = strstr (lines[i], "bsize="))) { -- if (section) { -- CLEANUP_FREE char *buf = split_strdup (p + 6); -- if (buf == NULL) goto error; -- if (STREQ (section, "data")) { -- if (parse_uint32 (&ret->xfs_blocksize, buf) == -1) -- goto error; -- } else if (STREQ (section, "naming")) { -- if (parse_uint32 (&ret->xfs_dirblocksize, buf) == -1) -- goto error; -- } else if (STREQ (section, "log")) { -- if (parse_uint32 (&ret->xfs_logblocksize, buf) == -1) -- goto error; -- } -- } -- } -- if ((p = strstr (lines[i], "blocks="))) { -- if (section) { -- CLEANUP_FREE char *buf = split_strdup (p + 7); -- if (buf == NULL) goto error; -- if (STREQ (section, "data")) { -- if (parse_uint64 (&ret->xfs_datablocks, buf) == -1) -- goto error; -- } else if (STREQ (section, "log")) { -- if (parse_uint32 (&ret->xfs_logblocks, buf) == -1) -- goto error; -- } else if (STREQ (section, "realtime")) { -- if (parse_uint64 (&ret->xfs_rtblocks, buf) == -1) -- goto error; -- } -- } -- } -- if ((p = strstr (lines[i], "imaxpct="))) { -- CLEANUP_FREE char *buf = split_strdup (p + 8); -- if (buf == NULL) goto error; -- if (parse_uint32 (&ret->xfs_imaxpct, buf) == -1) -- goto error; -- } -- if ((p = strstr (lines[i], "sunit="))) { -- if (section) { -- CLEANUP_FREE char *buf = split_strdup (p + 6); -- if (buf == NULL) goto error; -- if (STREQ (section, "data")) { -- if (parse_uint32 (&ret->xfs_sunit, buf) == -1) -- goto error; -- } else if (STREQ (section, "log")) { -- if (parse_uint32 (&ret->xfs_logsunit, buf) == -1) -- goto error; -- } -- } -- } -- if ((p = strstr (lines[i], "swidth="))) { -- CLEANUP_FREE char *buf = split_strdup (p + 7); -- if (buf == NULL) goto error; -- if (parse_uint32 (&ret->xfs_swidth, buf) == -1) -- goto error; -- } -- if ((p = strstr (lines[i], "naming =version "))) { -- CLEANUP_FREE char *buf = split_strdup (p + 18); -- if (buf == NULL) goto error; -- if (parse_uint32 (&ret->xfs_dirversion, buf) == -1) -- goto error; -- } -- if ((p = strstr (lines[i], "ascii-ci="))) { -- CLEANUP_FREE char *buf = split_strdup (p + 9); -- if (buf == NULL) goto error; -- if (parse_uint32 (&ret->xfs_cimode, buf) == -1) -- goto error; -- } -- if ((p = strstr (lines[i], "log ="))) { -- ret->xfs_logname = split_strdup (p + 10); -- if (ret->xfs_logname == NULL) goto error; -- } -- if ((p = strstr (lines[i], "version="))) { -- CLEANUP_FREE char *buf = split_strdup (p + 8); -- if (buf == NULL) goto error; -- if (parse_uint32 (&ret->xfs_logversion, buf) == -1) -- goto error; -- } -- if ((p = strstr (lines[i], "lazy-count="))) { -- CLEANUP_FREE char *buf = split_strdup (p + 11); -- if (buf == NULL) goto error; -- if (parse_uint32 (&ret->xfs_lazycount, buf) == -1) -- goto error; -- } -- if ((p = strstr (lines[i], "realtime ="))) { -- ret->xfs_rtname = split_strdup (p + 10); -- if (ret->xfs_rtname == NULL) goto error; -- } -- if ((p = strstr (lines[i], "rtextents="))) { -- CLEANUP_FREE char *buf = split_strdup (p + 10); -- if (buf == NULL) goto error; -- if (parse_uint64 (&ret->xfs_rtextents, buf) == -1) -- goto error; -- } -- } -- -- if (ret->xfs_mntpoint == NULL) { -- ret->xfs_mntpoint = strdup (""); -- if (ret->xfs_mntpoint == NULL) goto error; -- } -- if (ret->xfs_logname == NULL) { -- ret->xfs_logname = strdup (""); -- if (ret->xfs_logname == NULL) goto error; -- } -- if (ret->xfs_rtname == NULL) { -- ret->xfs_rtname = strdup (""); -- if (ret->xfs_rtname == NULL) goto error; -- } -- -- return ret; -- -- error: -- free (ret->xfs_mntpoint); -- free (ret->xfs_logname); -- free (ret->xfs_rtname); -- free (ret); -- return NULL; --} -- --guestfs_int_xfsinfo * --do_xfs_info (const char *pathordevice) --{ -- int r; -- CLEANUP_FREE char *buf = NULL; -- CLEANUP_FREE char *out = NULL, *err = NULL; -- CLEANUP_FREE_STRING_LIST char **lines = NULL; -- int is_dev; -- -- is_dev = is_device_parameter (pathordevice); -- buf = is_dev ? strdup (pathordevice) -- : sysroot_path (pathordevice); -- if (buf == NULL) { -- reply_with_perror ("malloc"); -- return NULL; -- } -- -- r = command (&out, &err, "xfs_info", buf, NULL); -- if (r == -1) { -- reply_with_error ("%s", err); -- return NULL; -- } -- -- lines = split_lines (out); -- if (lines == NULL) -- return NULL; -- -- return parse_xfs_info (lines); --} -- - int - do_xfs_growfs (const char *path, - int datasec, int logsec, int rtsec, -diff --git a/daemon/xfs.ml b/daemon/xfs.ml -index 142b26775..157a84058 100644 ---- a/daemon/xfs.ml -+++ b/daemon/xfs.ml -@@ -17,6 +17,7 @@ - *) - - open Printf -+open Scanf - - open Std_utils - -@@ -126,3 +127,47 @@ let xfs_info2 dev = - ) groups; - - List.rev !values -+ -+(* Deprecated xfs_info. *) -+let xfs_info dev = -+ let h = xfs_info2 dev in -+ -+ let find field parsefn = -+ try List.assoc field h |> parsefn -+ with -+ | Not_found -> -+ failwithf "xfs_info: unexpected missing field: %s" field -+ | exn -> -+ failwithf "xfs_info: failure finding field: %s: %s" -+ field (Printexc.to_string exn) -+ in -+ -+ let parse_blks s = sscanf s "%ld blks" Fun.id in -+ let parse_version s = sscanf s "version %ld" Fun.id in -+ -+ { Structs.xfs_mntpoint = find "meta-data" Fun.id; -+ xfs_inodesize = find "meta-data.isize" Int32.of_string; -+ xfs_agcount = find "meta-data.agcount" Int32.of_string; -+ xfs_agsize = find "meta-data.agsize" parse_blks; -+ xfs_sectsize = find "meta-data.sectsz" Int32.of_string; -+ xfs_attr = find "meta-data.attr" Int32.of_string; -+ xfs_blocksize = find "data.bsize" Int32.of_string; -+ xfs_datablocks = find "data.blocks" Int64.of_string; -+ xfs_imaxpct = find "data.imaxpct" Int32.of_string; -+ xfs_sunit = find "data.sunit" Int32.of_string; -+ xfs_swidth = find "data.swidth" parse_blks; -+ xfs_dirversion = find "naming" parse_version; -+ xfs_dirblocksize = find "naming.bsize" Int32.of_string; -+ xfs_cimode = find "naming.ascii-ci" Int32.of_string; -+ xfs_logname = find "log" Fun.id; -+ xfs_logblocksize = find "log.bsize" Int32.of_string; -+ xfs_logblocks = find "log.blocks" Int32.of_string; -+ xfs_logversion = find "log.version" Int32.of_string; -+ xfs_logsectsize = find "log.sectsz" Int32.of_string; -+ xfs_logsunit = find "log.sunit" parse_blks; -+ xfs_lazycount = find "log.lazy-count" Int32.of_string; -+ xfs_rtname = find "realtime" Fun.id; -+ xfs_rtextsize = find "realtime.extsz" Int32.of_string; -+ xfs_rtblocks = find "realtime.blocks" Int64.of_string; -+ xfs_rtextents = find "realtime.rtextents" Int64.of_string; -+ } -diff --git a/generator/actions_core.ml b/generator/actions_core.ml -index b7e4dae45..f2cf83440 100644 ---- a/generator/actions_core.ml -+++ b/generator/actions_core.ml -@@ -7228,6 +7228,7 @@ call C.|} }; - { defaults with - name = "xfs_info"; added = (1, 19, 21); - style = RStruct ("info", "xfsinfo"), [String (Dev_or_Path, "pathordevice")], []; -+ impl = OCaml "Xfs.xfs_info"; - optional = Some "xfs"; - tests = [ - InitEmpty, Always, TestResult ( --- -2.47.3 - diff --git a/0010-generator-Deprecate-xfs_info-replaced-by-xfs_info2.patch b/0010-generator-Deprecate-xfs_info-replaced-by-xfs_info2.patch deleted file mode 100644 index 82e2b45..0000000 --- a/0010-generator-Deprecate-xfs_info-replaced-by-xfs_info2.patch +++ /dev/null @@ -1,80 +0,0 @@ -From 5b3de10b018e891ef7cc7fae0e8b1b32445eb392 Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Fri, 23 Jan 2026 08:51:11 +0000 -Subject: [PATCH] generator: Deprecate xfs_info (replaced by xfs_info2) - -Deprecate this function, and suggest using xfs_info2 as its -replacement. - -(cherry picked from commit 7833461af76d1feaf2dd1e779f7f04bcca91a6bc) ---- - generator/actions_core.ml | 21 --------------------- - generator/actions_core_deprecated.ml | 22 ++++++++++++++++++++++ - 2 files changed, 22 insertions(+), 21 deletions(-) - -diff --git a/generator/actions_core.ml b/generator/actions_core.ml -index f2cf83440..26d77c667 100644 ---- a/generator/actions_core.ml -+++ b/generator/actions_core.ml -@@ -7225,27 +7225,6 @@ be returned if you called C. - To find out the maximum number of devices that could be added, - call C.|} }; - -- { defaults with -- name = "xfs_info"; added = (1, 19, 21); -- style = RStruct ("info", "xfsinfo"), [String (Dev_or_Path, "pathordevice")], []; -- impl = OCaml "Xfs.xfs_info"; -- optional = Some "xfs"; -- tests = [ -- InitEmpty, Always, TestResult ( -- [["part_disk"; "/dev/sda"; "mbr"]; -- ["mkfs"; "xfs"; "/dev/sda1"; ""; "NOARG"; ""; ""; "NOARG"]; -- ["mount"; "/dev/sda1"; "/"]; -- ["xfs_info"; "/"]], "ret->xfs_blocksize == 4096"), [] -- ]; -- shortdesc = "get information about the XFS filesystem"; -- longdesc = {|C is a mounted XFS filesystem or a device containing --an XFS filesystem. This command returns miscellaneous --metadata about the XFS filesystem. -- --The returned struct contains miscellaneous metadata. Missing --fields are returned as C<-1> (for numeric fields) or empty --string.|} }; -- - { defaults with - name = "pvchange_uuid"; added = (1, 19, 26); - style = RErr, [String (Device, "device")], []; -diff --git a/generator/actions_core_deprecated.ml b/generator/actions_core_deprecated.ml -index aa98bd5fe..308495c45 100644 ---- a/generator/actions_core_deprecated.ml -+++ b/generator/actions_core_deprecated.ml -@@ -945,4 +945,26 @@ The optional C boolean controls whether the context - is reset for customizable files, and also whether the - user, role and range parts of the file context is changed.|} }; - -+ { defaults with -+ name = "xfs_info"; added = (1, 19, 21); -+ style = RStruct ("info", "xfsinfo"), [String (Dev_or_Path, "pathordevice")], []; -+ impl = OCaml "Xfs.xfs_info"; -+ optional = Some "xfs"; -+ deprecated_by = Replaced_by "xfs_info2"; -+ tests = [ -+ InitEmpty, Always, TestResult ( -+ [["part_disk"; "/dev/sda"; "mbr"]; -+ ["mkfs"; "xfs"; "/dev/sda1"; ""; "NOARG"; ""; ""; "NOARG"]; -+ ["mount"; "/dev/sda1"; "/"]; -+ ["xfs_info"; "/"]], "ret->xfs_blocksize == 4096"), [] -+ ]; -+ shortdesc = "get information about the XFS filesystem"; -+ longdesc = {|C is a mounted XFS filesystem or a device containing -+an XFS filesystem. This command returns miscellaneous -+metadata about the XFS filesystem. -+ -+The returned struct contains miscellaneous metadata. Missing -+fields are returned as C<-1> (for numeric fields) or empty -+string.|} }; -+ - ] --- -2.47.3 - diff --git a/0011-tests-disks-debug-qemu.sh-Fix-test-for-update-QMP-te.patch b/0011-tests-disks-debug-qemu.sh-Fix-test-for-update-QMP-te.patch deleted file mode 100644 index 670aa32..0000000 --- a/0011-tests-disks-debug-qemu.sh-Fix-test-for-update-QMP-te.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 4a5ee2fbcbef5f10b8faf8f8659ba5f82145f42d Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Mon, 26 Jan 2026 14:59:13 +0000 -Subject: [PATCH] tests/disks/debug-qemu.sh: Fix test for update QMP test - -Commit f7a24b2ea8 ("lib/qemu.c: Use machine type none when inspecting -QMP properties") changed the number of command line parameters used -before the '-qmp stdio' option when libguestfs queries qemu features. -This broke some tests which rely on the exact order of parameters. - -Fixes: commit f7a24b2ea81f3c5c2754fcf43e0347c7c5378b4a -Updates: commit 5da8102f5f59b9781075440dc68c8d08f9c8691e -(cherry picked from commit 45d0e66d02adf1a42c8eca979fa38d2f91d9f3c2) ---- - tests/disks/debug-qemu.sh | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/tests/disks/debug-qemu.sh b/tests/disks/debug-qemu.sh -index 96c90553b..e6e80abe3 100755 ---- a/tests/disks/debug-qemu.sh -+++ b/tests/disks/debug-qemu.sh -@@ -25,7 +25,7 @@ fi - - # The direct backend runs qemu ... -qmp stdio to query for KVM. For - # the test to pass we have to provide an answer here. --if [ "x$7" = "x-qmp" ]; then -+if [ "x$5" = "x-qmp" ]; then - # Consume stdin first. - cat >/dev/null - # Write some fake output. --- -2.47.3 - diff --git a/copy-patches.sh b/copy-patches.sh index 8b91c5f..6720efa 100755 --- a/copy-patches.sh +++ b/copy-patches.sh @@ -7,7 +7,7 @@ set -e # it like this: # ./copy-patches.sh -rhel_version=10.2 +rhel_version=10.3 # Check we're in the right directory. if [ ! -f libguestfs.spec ]; then diff --git a/libguestfs.spec b/libguestfs.spec index b2b2764..41510c3 100644 --- a/libguestfs.spec +++ b/libguestfs.spec @@ -23,7 +23,7 @@ ExcludeArch: %{ix86} %global verify_tarball_signature 1 # The source directory. -%global source_directory 1.58-stable +%global source_directory 1.59-development # Filter perl provides. %{?perl_default_filter} @@ -34,8 +34,8 @@ ExcludeArch: %{ix86} Summary: Access and modify virtual machine disk images Name: libguestfs Epoch: 1 -Version: 1.58.1 -Release: 3%{?dist}.alma.1 +Version: 1.59.5 +Release: 1%{?dist}.alma.1 License: LGPL-2.1-or-later # Build only for architectures that have a kernel @@ -72,20 +72,13 @@ Source7: libguestfs.keyring Source8: copy-patches.sh # Patches are maintained in the following repository: -# https://github.com/libguestfs/libguestfs/commits/rhel-10.2 +# https://github.com/libguestfs/libguestfs/commits/rhel-10.3 # Patches. -Patch0001: 0001-generator-daemon.ml-Avoid-not-available-macro-for-OC.patch -Patch0002: 0002-RHEL-Disable-unsupported-remote-drive-protocols-RHBZ.patch -Patch0003: 0003-RHEL-Reject-use-of-libguestfs-winsupport-features-ex.patch -Patch0004: 0004-RHEL-appliance-init-Run-depmod-a-to-rebuild-kernel-m.patch -Patch0005: 0005-lib-qemu.c-Use-machine-type-none-when-inspecting-QMP.patch -Patch0006: 0006-generator-Fix-description-of-xfs_growfs.patch -Patch0007: 0007-generator-Fix-description-of-xfs_info.patch -Patch0008: 0008-New-API-xfs_info2.patch -Patch0009: 0009-daemon-Reimplement-xfs_info-using-xfs_info2.patch -Patch0010: 0010-generator-Deprecate-xfs_info-replaced-by-xfs_info2.patch -Patch0011: 0011-tests-disks-debug-qemu.sh-Fix-test-for-update-QMP-te.patch +Patch0001: 0001-RHEL-Disable-unsupported-remote-drive-protocols-RHBZ.patch +Patch0002: 0002-RHEL-Reject-use-of-libguestfs-winsupport-features-ex.patch +Patch0003: 0003-RHEL-appliance-init-Run-depmod-a-to-rebuild-kernel-m.patch +Patch0004: 0004-RHEL-Use-alternate-location-for-qemu-kvm-in-direct-b.patch BuildRequires: autoconf, automake, libtool, gettext-devel @@ -176,11 +169,8 @@ BuildRequires: rubygem-rake BuildRequires: rubygem(json) BuildRequires: rubygem(rdoc) BuildRequires: rubygem(test-unit) -BuildRequires: ruby-irb +BuildRequires: rubygem(irb) BuildRequires: php-devel -BuildRequires: gobject-introspection-devel -BuildRequires: gjs -BuildRequires: vala %endif %ifarch %{golang_arches} BuildRequires: golang @@ -376,9 +366,6 @@ For developers: Language bindings: -%if !0%{?rhel} -libguestfs-gobject-devel GObject bindings and GObject Introspection -%endif %ifarch %{golang_arches} golang-guestfs Go language bindings %endif @@ -393,7 +380,6 @@ libguestfs-gobject-devel GObject bindings and GObject Introspection python3-libguestfs Python 3 bindings %if !0%{?rhel} ruby-libguestfs Ruby bindings - libguestfs-vala Vala language bindings %endif @@ -601,38 +587,6 @@ Requires: lua %description -n lua-guestfs lua-guestfs contains Lua bindings for %{name}. - - -%package gobject -Summary: GObject bindings for %{name} -Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release} - -%description gobject -%{name}-gobject contains GObject bindings for %{name}. - -To develop software against these bindings, you need to install -%{name}-gobject-devel. - - -%package gobject-devel -Summary: GObject bindings for %{name} -Requires: %{name}-gobject = %{epoch}:%{version}-%{release} - -%description gobject-devel -%{name}-gobject contains GObject bindings for %{name}. - -This package is needed if you want to write software using the -GObject bindings. It also contains GObject Introspection information. - - -%package vala -Summary: Vala for %{name} -Requires: %{name}-devel%{?_isa} = %{epoch}:%{version}-%{release} -Requires: vala - - -%description vala -%{name}-vala contains GObject bindings for %{name}. %endif @@ -739,7 +693,6 @@ fi --without-java \ --disable-erlang \ %if 0%{?rhel} - --disable-gobject \ --disable-lua \ --disable-php \ --disable-ruby \ @@ -1052,26 +1005,6 @@ rm ocaml/html/.gitignore %doc lua/examples/LICENSE %{_libdir}/lua/*/guestfs.so %{_mandir}/man3/guestfs-lua.3* - - -%files gobject -%{_libdir}/libguestfs-gobject-1.0.so.0* -%{_libdir}/girepository-1.0/Guestfs-1.0.typelib - - -%files gobject-devel -%{_libdir}/libguestfs-gobject-1.0.so -%{_includedir}/guestfs-gobject.h -%dir %{_includedir}/guestfs-gobject -%{_includedir}/guestfs-gobject/*.h -%{_datadir}/gir-1.0/Guestfs-1.0.gir -%{_libdir}/pkgconfig/libguestfs-gobject-1.0.pc -%{_mandir}/man3/guestfs-gobject.3* - - -%files vala -%{_datadir}/vala/vapi/libguestfs-gobject-1.0.deps -%{_datadir}/vala/vapi/libguestfs-gobject-1.0.vapi %endif @@ -1097,9 +1030,16 @@ rm ocaml/html/.gitignore %changelog -* Tue Mar 10 2026 Eduard Abdullin - 1:1.58.1-3.alma.1 +* Fri Apr 03 2026 Eduard Abdullin - 1:1.59.5-1.alma.1 - Enable building for ppc64le +* Thu Apr 02 2026 Richard W.M. Jones - 1:1.59.5-1 +- Rebase to libguestfs 1.59.5 + Synchronize spec file with Fedora + resolves: RHEL-153358 +- Detect Windows Defender antivirus + resolves: RHEL-129145 + * Mon Jan 26 2026 Richard W.M. Jones - 1:1.58.1-2 - Rebase to libguestfs 1.58.1 resolves: RHEL-111240 diff --git a/sources b/sources index 84556cd..d4d0772 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (libguestfs-1.58.1.tar.gz) = 56e8f21592b4c63a14cfaa3255180c3d83bea7d3cc1a404befb121513b7287dd09ae96477b80b3f8794b2cde49febb1909b9716c3b896a313e4445f7f2a5072a -SHA512 (libguestfs-1.58.1.tar.gz.sig) = 9d8bca8928bfa360d0d307373676ea587af9e5154ddfd954c70283f3125b397df9294c1504e188bea5a5cfbb4bae9f27cdbacf92bc9a3e8cb05b7c900c0bfac5 +SHA512 (libguestfs-1.59.5.tar.gz) = 3b87978716cfecbf029ffe8f8945b6af85cb47968c9a6f92908dfb00875bf1b52d12894da1085a81f8fbc7fbd51f368b2ae811c1519a6b4855644eb34b5d15b1 +SHA512 (libguestfs-1.59.5.tar.gz.sig) = a5b11927a3cd8ec22443d5d38136c079fd558964b21f9532abd2fbd4e27cbf56707520e57395683e12d1b13bbb2740e6a1fffde854259e7c1fa71ac39e7efbfa