diff --git a/.gitignore b/.gitignore index cd08666..59eecae 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ -SOURCES/libguestfs-1.46.0.tar.gz +SOURCES/libguestfs-1.46.1.tar.gz SOURCES/libguestfs.keyring diff --git a/.libguestfs.metadata b/.libguestfs.metadata index 79c82fe..10b4851 100644 --- a/.libguestfs.metadata +++ b/.libguestfs.metadata @@ -1,2 +1,2 @@ -7f8f969a579861efc457bdacf3c39a4931de7ec2 SOURCES/libguestfs-1.46.0.tar.gz +156b8a427d03ddfa956fedb69ec00221e891e4c2 SOURCES/libguestfs-1.46.1.tar.gz 1bbc40f501a7fef9eef2a39b701a71aee2fea7c4 SOURCES/libguestfs.keyring diff --git a/SOURCES/0001-Go-bindings-fix-C-array-of-strings-char-allocation.patch b/SOURCES/0001-Go-bindings-fix-C-array-of-strings-char-allocation.patch deleted file mode 100644 index f70a54e..0000000 --- a/SOURCES/0001-Go-bindings-fix-C-array-of-strings-char-allocation.patch +++ /dev/null @@ -1,153 +0,0 @@ -From e2f8db27d0af5217eb5d0487e0713309559d4489 Mon Sep 17 00:00:00 2001 -From: Laszlo Ersek -Date: Tue, 21 Sep 2021 21:29:39 +0200 -Subject: [PATCH] Go bindings: fix "C array of strings" -- char** -- allocation -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -The current "arg_string_list" and "free_string_list" implementations go -back to commit b6f01f32606d ("Add Go (language) bindings.", 2013-07-03). -There are two problems with them: - -- "free_string_list" doesn't actually free anything, - -- at the *first* such g.Internal_test() call site that passes an - Ostringlist member inside the Optargs argument, namely: - -> g.Internal_test ("abc", -> string_addr ("def"), -> []string{}, -> false, -> 0, -> 0, -> "123", -> "456", -> []byte{'a', 'b', 'c', '\000', 'a', 'b', 'c'}, -> &guestfs.OptargsInternal_test{Ostringlist_is_set: true, -> Ostringlist: []string{} -> } -> ) - - the "golang/run-bindtests" case crashes: - -> panic: runtime error: cgo argument has Go pointer to Go pointer -> -> goroutine 1 [running]: -> libguestfs.org/guestfs.(*Guestfs).Internal_test.func7(0xc000018180, -> 0xadfb60, 0xadfb80, 0xc000010048, 0x0, 0x0, 0x0, 0xae3e10, 0xae3e30, -> 0xade3a0, ...) -> golang/src/libguestfs.org/guestfs/guestfs.go:6729 +0xa9 -> libguestfs.org/guestfs.(*Guestfs).Internal_test(0xc000018180, 0x4ee3a5, -> 0x3, 0xc000061be8, 0xc000061af8, 0x0, 0x0, 0xc000061a00, 0x0, 0x0, ...) -> golang/src/libguestfs.org/guestfs/guestfs.go:6729 +0x3c9 -> main.main() -> golang/bindtests/bindtests.go:77 +0x151e -> exit status 2 -> FAIL run-bindtests (exit status: 1) - -In Daniel P. Berrangé's words [1], - -> You're allowed to pass a Go pointer to C via CGo, but the memory that -> points to is not allowed to contained further Go pointers. So the struct -> fields must strictly use a C pointer. - -One pattern to solve the problem has been shown on stackoverflow [2]. -Thus, rewrite the "arg_string_list" and "free_string_list" functions -almost entirely in C, following that example. - -While this approach is not the most idiomatic Go, as a solution exists -without C helper functions [3], it should still be acceptable, at least as -an incremental improvement, for letting "golang/run-bindtests" pass. - -[1] https://listman.redhat.com/archives/libguestfs/2021-September/msg00118.html -[2] https://stackoverflow.com/questions/35924545/golang-cgo-panic-runtime-error-cgo-argument-has-go-pointer-to-go-pointer -[3] https://listman.redhat.com/archives/libguestfs/2021-September/msg00106.html - -Cc: "Daniel P. Berrangé" -Cc: "Richard W.M. Jones" -Signed-off-by: Laszlo Ersek -Message-Id: <20210921192939.32468-1-lersek@redhat.com> -Tested-by: "Richard W.M. Jones" -Acked-by: "Richard W.M. Jones" ---- - generator/golang.ml | 47 ++++++++++++++++++++++++++++++++++++--------- - 1 file changed, 38 insertions(+), 9 deletions(-) - -diff --git a/generator/golang.ml b/generator/golang.ml -index d328abe4e..0d6a92367 100644 ---- a/generator/golang.ml -+++ b/generator/golang.ml -@@ -52,6 +52,40 @@ _go_guestfs_create_flags (unsigned flags) - { - return guestfs_create_flags (flags); - } -+ -+// Passing a Go pointer to C via CGo is allowed, but the memory that points to -+// is not allowed to contain further Go pointers. The helper functions below -+// are one way to implement this, although the same can be achieved purely in -+// Go as well. See the discussion here: -+// . -+typedef char *pChar; -+ -+pChar *allocStringArray (size_t nmemb) -+{ -+ pChar *array; -+ -+ array = malloc (sizeof (pChar) * (nmemb + 1)); -+ array[nmemb] = NULL; -+ return array; -+} -+ -+void storeString (pChar *array, size_t idx, pChar string) -+{ -+ array[idx] = string; -+} -+ -+void freeStringArray (pChar *array) -+{ -+ pChar *position; -+ pChar string; -+ -+ position = array; -+ while ((string = *position) != NULL) { -+ free (string); -+ position++; -+ } -+ free (array); -+} - */ - import \"C\" - -@@ -148,12 +182,11 @@ func (g *Guestfs) Close () *GuestfsError { - * C strings and golang []string. - */ - func arg_string_list (xs []string) **C.char { -- r := make ([]*C.char, 1 + len (xs)) -+ r := C.allocStringArray (C.size_t (len (xs))) - for i, x := range xs { -- r[i] = C.CString (x) -+ C.storeString (r, C.size_t (i), C.CString (x)); - } -- r[len (xs)] = nil -- return &r[0] -+ return (**C.char) (r) - } - - func count_string_list (argv **C.char) int { -@@ -167,11 +200,7 @@ func count_string_list (argv **C.char) int { - } - - func free_string_list (argv **C.char) { -- for *argv != nil { -- //C.free (*argv) -- argv = (**C.char) (unsafe.Pointer (uintptr (unsafe.Pointer (argv)) + -- unsafe.Sizeof (*argv))) -- } -+ C.freeStringArray ((*C.pChar) (argv)) - } - - func return_string_list (argv **C.char) []string { --- -2.31.1 - diff --git a/SOURCES/0001-daemon-inspect_fs_unix-recognize-modern-Pardus-GNU-Linux-releases.patch b/SOURCES/0001-daemon-inspect_fs_unix-recognize-modern-Pardus-GNU-Linux-releases.patch new file mode 100644 index 0000000..bce4ddb --- /dev/null +++ b/SOURCES/0001-daemon-inspect_fs_unix-recognize-modern-Pardus-GNU-Linux-releases.patch @@ -0,0 +1,39 @@ +From 336ecfab3bb1e14deea9ade891fb772e0698f8d8 Mon Sep 17 00:00:00 2001 +From: Laszlo Ersek +Date: Fri, 1 Oct 2021 14:53:38 +0200 +Subject: [PATCH] daemon/inspect_fs_unix: recognize modern Pardus GNU/Linux + releases + +Recent Pardus releases seem to have abandoned the original +"/etc/pardus-release" file, which the current Pardus detection, from +commit 233530d3541d ("inspect: Add detection of Pardus.", 2010-10-29), is +based upon. + +Instead, Pardus apparently adopted the "/etc/os-release" specification +, with +"ID=pardus". Extend the "distro_of_os_release_id" function accordingly. +Keep the original method for recognizing earlier releases. + +Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1993842 +Signed-off-by: Laszlo Ersek +Message-Id: <20211001125338.8956-1-lersek@redhat.com> +Acked-by: Richard W.M. Jones +--- + daemon/inspect_fs_unix.ml | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/daemon/inspect_fs_unix.ml b/daemon/inspect_fs_unix.ml +index 557f32833..652bacc0f 100644 +--- a/daemon/inspect_fs_unix.ml ++++ b/daemon/inspect_fs_unix.ml +@@ -151,6 +151,7 @@ and distro_of_os_release_id = function + | "openmandriva" -> Some DISTRO_OPENMANDRIVA + | "opensuse" -> Some DISTRO_OPENSUSE + | s when String.is_prefix s "opensuse-" -> Some DISTRO_OPENSUSE ++ | "pardus" -> Some DISTRO_PARDUS + | "pld" -> Some DISTRO_PLD_LINUX + | "rhel" -> Some DISTRO_RHEL + | "sles" | "sled" -> Some DISTRO_SLES +-- +2.19.1.3.g30247aa5d201 + diff --git a/SOURCES/0002-daemon-inspect_fs_unix-recognize-modern-Pardus-GNU-L.patch b/SOURCES/0002-daemon-inspect_fs_unix-recognize-modern-Pardus-GNU-L.patch deleted file mode 100644 index 34d2d81..0000000 --- a/SOURCES/0002-daemon-inspect_fs_unix-recognize-modern-Pardus-GNU-L.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 3f6f2fb8f6997e5e993d0e493470323476f33243 Mon Sep 17 00:00:00 2001 -From: Laszlo Ersek -Date: Fri, 1 Oct 2021 14:53:38 +0200 -Subject: [PATCH] daemon/inspect_fs_unix: recognize modern Pardus GNU/Linux - releases - -Recent Pardus releases seem to have abandoned the original -"/etc/pardus-release" file, which the current Pardus detection, from -commit 233530d3541d ("inspect: Add detection of Pardus.", 2010-10-29), is -based upon. - -Instead, Pardus apparently adopted the "/etc/os-release" specification -, with -"ID=pardus". Extend the "distro_of_os_release_id" function accordingly. -Keep the original method for recognizing earlier releases. - -Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1993842 -Signed-off-by: Laszlo Ersek -Message-Id: <20211001125338.8956-1-lersek@redhat.com> -Acked-by: Richard W.M. Jones ---- - daemon/inspect_fs_unix.ml | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/daemon/inspect_fs_unix.ml b/daemon/inspect_fs_unix.ml -index 557f32833..652bacc0f 100644 ---- a/daemon/inspect_fs_unix.ml -+++ b/daemon/inspect_fs_unix.ml -@@ -151,6 +151,7 @@ and distro_of_os_release_id = function - | "openmandriva" -> Some DISTRO_OPENMANDRIVA - | "opensuse" -> Some DISTRO_OPENSUSE - | s when String.is_prefix s "opensuse-" -> Some DISTRO_OPENSUSE -+ | "pardus" -> Some DISTRO_PARDUS - | "pld" -> Some DISTRO_PLD_LINUX - | "rhel" -> Some DISTRO_RHEL - | "sles" | "sled" -> Some DISTRO_SLES --- -2.31.1 - diff --git a/SOURCES/0002-daemon-inspection-Add-support-for-Kylin-RHBZ-1995391.patch b/SOURCES/0002-daemon-inspection-Add-support-for-Kylin-RHBZ-1995391.patch new file mode 100644 index 0000000..1c38b40 --- /dev/null +++ b/SOURCES/0002-daemon-inspection-Add-support-for-Kylin-RHBZ-1995391.patch @@ -0,0 +1,100 @@ +From 3db4dd1804b72575789a67f22a86d6085a141310 Mon Sep 17 00:00:00 2001 +From: Laszlo Ersek +Date: Wed, 13 Oct 2021 18:30:23 +0200 +Subject: [PATCH] daemon: inspection: Add support for Kylin (RHBZ#1995391). + +Similar-to: cd08039d2427b584237265237c713d8cf46536a0 +Signed-off-by: Laszlo Ersek +Message-Id: <20211013163023.21786-1-lersek@redhat.com> +Acked-by: Richard W.M. Jones +(cherry picked from commit 305b02e7e74afc3777b2291783cd7634fb76ecaf) +--- + daemon/inspect_fs.ml | 2 ++ + daemon/inspect_fs_unix.ml | 1 + + daemon/inspect_types.ml | 2 ++ + daemon/inspect_types.mli | 1 + + generator/actions_inspection.ml | 4 ++++ + 5 files changed, 10 insertions(+) + +diff --git a/daemon/inspect_fs.ml b/daemon/inspect_fs.ml +index 02b5a0470..77f0f6aea 100644 +--- a/daemon/inspect_fs.ml ++++ b/daemon/inspect_fs.ml +@@ -275,6 +275,7 @@ and check_package_format { distro } = + Some PACKAGE_FORMAT_RPM + | Some DISTRO_DEBIAN + | Some DISTRO_KALI_LINUX ++ | Some DISTRO_KYLIN (* supposedly another Ubuntu derivative *) + | Some DISTRO_LINUX_MINT + | Some DISTRO_UBUNTU -> + Some PACKAGE_FORMAT_DEB +@@ -345,6 +346,7 @@ and check_package_management { distro; version } = + | Some DISTRO_ALTLINUX + | Some DISTRO_DEBIAN + | Some DISTRO_KALI_LINUX ++ | Some DISTRO_KYLIN (* supposedly another Ubuntu derivative *) + | Some DISTRO_LINUX_MINT + | Some DISTRO_UBUNTU -> + Some PACKAGE_MANAGEMENT_APT +diff --git a/daemon/inspect_fs_unix.ml b/daemon/inspect_fs_unix.ml +index 652bacc0f..7f6eb92e9 100644 +--- a/daemon/inspect_fs_unix.ml ++++ b/daemon/inspect_fs_unix.ml +@@ -146,6 +146,7 @@ and distro_of_os_release_id = function + | "frugalware" -> Some DISTRO_FRUGALWARE + | "gentoo" -> Some DISTRO_GENTOO + | "kali" -> Some DISTRO_KALI_LINUX ++ | "kylin" -> Some DISTRO_KYLIN + | "mageia" -> Some DISTRO_MAGEIA + | "neokylin" -> Some DISTRO_NEOKYLIN + | "openmandriva" -> Some DISTRO_OPENMANDRIVA +diff --git a/daemon/inspect_types.ml b/daemon/inspect_types.ml +index 18e410ce0..e2bc7165c 100644 +--- a/daemon/inspect_types.ml ++++ b/daemon/inspect_types.ml +@@ -79,6 +79,7 @@ and distro = + | DISTRO_FRUGALWARE + | DISTRO_GENTOO + | DISTRO_KALI_LINUX ++ | DISTRO_KYLIN + | DISTRO_LINUX_MINT + | DISTRO_MAGEIA + | DISTRO_MANDRIVA +@@ -211,6 +212,7 @@ and string_of_distro = function + | DISTRO_FRUGALWARE -> "frugalware" + | DISTRO_GENTOO -> "gentoo" + | DISTRO_KALI_LINUX -> "kalilinux" ++ | DISTRO_KYLIN -> "kylin" + | DISTRO_LINUX_MINT -> "linuxmint" + | DISTRO_MAGEIA -> "mageia" + | DISTRO_MANDRIVA -> "mandriva" +diff --git a/daemon/inspect_types.mli b/daemon/inspect_types.mli +index d12f7a61a..43c79818f 100644 +--- a/daemon/inspect_types.mli ++++ b/daemon/inspect_types.mli +@@ -86,6 +86,7 @@ and distro = + | DISTRO_FRUGALWARE + | DISTRO_GENTOO + | DISTRO_KALI_LINUX ++ | DISTRO_KYLIN + | DISTRO_LINUX_MINT + | DISTRO_MAGEIA + | DISTRO_MANDRIVA +diff --git a/generator/actions_inspection.ml b/generator/actions_inspection.ml +index 690afd460..0c6d39b43 100644 +--- a/generator/actions_inspection.ml ++++ b/generator/actions_inspection.ml +@@ -214,6 +214,10 @@ Gentoo. + + Kali Linux. + ++=item \"kylin\" ++ ++Kylin. ++ + =item \"linuxmint\" + + Linux Mint. +-- +2.19.1.3.g30247aa5d201 + diff --git a/SOURCES/0003-Add-detection-support-for-Rocky-Linux-CentOS-RHEL-like.patch b/SOURCES/0003-Add-detection-support-for-Rocky-Linux-CentOS-RHEL-like.patch new file mode 100644 index 0000000..1915b38 --- /dev/null +++ b/SOURCES/0003-Add-detection-support-for-Rocky-Linux-CentOS-RHEL-like.patch @@ -0,0 +1,209 @@ +From a98532ac7d6c79889703603d9f4ab008f0febd53 Mon Sep 17 00:00:00 2001 +From: Neil Hanlon +Date: Fri, 10 Dec 2021 08:50:48 +0000 +Subject: [PATCH] Add detection support for Rocky Linux (CentOS/RHEL-like) + +Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2030709 +Thanks: label@rockylinux.org + +--- + +RWMJ notes: I fixed the original patch so it compiled. This patch +sets osinfo to "rocky8", which doesn't exist in the osinfo db yet. +Arguably we might want to set this to "centos8", but we can see what +libosinfo decides to do. Here is partial virt-inspector output on a +Rocky Linux disk image: + +$ ./run virt-inspector -a disk.img + + + + /dev/rl/root + linux + x86_64 + rocky + Rocky Linux 8.5 (Green Obsidian) + 8 + 5 + rpm + dnf + localhost.localdomain + rocky8 + + / + /boot + + + + xfs + fed8331f-9f25-40cd-883e-090cd640559d + + + swap + 6da2c121-ea7d-49ce-98a3-14a37fceaadd + + + xfs + 4efafe61-2d20-4d93-8055-537e09bfd033 + + +(cherry picked from commit 631962c0e88a321646846be91d0fbea1ba14e263) +--- + daemon/inspect_fs.ml | 2 ++ + daemon/inspect_fs_unix.ml | 13 ++++++++++++- + daemon/inspect_types.ml | 2 ++ + daemon/inspect_types.mli | 1 + + generator/actions_inspection.ml | 4 ++++ + lib/inspect-icon.c | 1 + + lib/inspect-osinfo.c | 4 ++++ + 7 files changed, 26 insertions(+), 1 deletion(-) + +diff --git a/daemon/inspect_fs.ml b/daemon/inspect_fs.ml +index 77f0f6aea..9c73d97ef 100644 +--- a/daemon/inspect_fs.ml ++++ b/daemon/inspect_fs.ml +@@ -259,6 +259,7 @@ and check_package_format { distro } = + | None -> None + | Some DISTRO_ALTLINUX + | Some DISTRO_CENTOS ++ | Some DISTRO_ROCKY + | Some DISTRO_FEDORA + | Some DISTRO_MAGEIA + | Some DISTRO_MANDRIVA +@@ -329,6 +330,7 @@ and check_package_management { distro; version } = + Some PACKAGE_MANAGEMENT_DNF + + | Some DISTRO_CENTOS ++ | Some DISTRO_ROCKY + | Some DISTRO_ORACLE_LINUX + | Some DISTRO_REDHAT_BASED + | Some DISTRO_RHEL +diff --git a/daemon/inspect_fs_unix.ml b/daemon/inspect_fs_unix.ml +index 7f6eb92e9..63cb279d0 100644 +--- a/daemon/inspect_fs_unix.ml ++++ b/daemon/inspect_fs_unix.ml +@@ -32,6 +32,8 @@ let re_rhel_no_minor = PCRE.compile "Red Hat.*release (\\d+)" + let re_centos_old = PCRE.compile "CentOS.*release (\\d+).*Update (\\d+)" + let re_centos = PCRE.compile "CentOS.*release (\\d+)\\.(\\d+)" + let re_centos_no_minor = PCRE.compile "CentOS.*release (\\d+)" ++let re_rocky = PCRE.compile "Rocky Linux.*release (\\d+)\\.(\\d+)" ++let re_rocky_no_minor = PCRE.compile "Rocky Linux.*release (\\d+)" + let re_scientific_linux_old = + PCRE.compile "Scientific Linux.*release (\\d+).*Update (\\d+)" + let re_scientific_linux = +@@ -106,7 +108,7 @@ let rec parse_os_release release_file data = + * we detect that situation then bail out and use the release + * files instead. + *) +- | { distro = Some (DISTRO_DEBIAN|DISTRO_CENTOS); ++ | { distro = Some (DISTRO_DEBIAN|DISTRO_CENTOS|DISTRO_ROCKY); + version = Some (_, 0) } -> + false + +@@ -155,6 +157,7 @@ and distro_of_os_release_id = function + | "pardus" -> Some DISTRO_PARDUS + | "pld" -> Some DISTRO_PLD_LINUX + | "rhel" -> Some DISTRO_RHEL ++ | "rocky" -> Some DISTRO_ROCKY + | "sles" | "sled" -> Some DISTRO_SLES + | "ubuntu" -> Some DISTRO_UBUNTU + | "void" -> Some DISTRO_VOID_LINUX +@@ -405,6 +408,10 @@ let linux_root_tests : tests = [ + DISTRO_CENTOS; + "/etc/centos-release", parse_generic ~rex:re_centos_no_minor + DISTRO_CENTOS; ++ "/etc/rocky-release", parse_generic ~rex:re_rocky ++ DISTRO_ROCKY; ++ "/etc/rocky-release", parse_generic ~rex:re_rocky_no_minor ++ DISTRO_ROCKY; + "/etc/altlinux-release", parse_generic DISTRO_ALTLINUX; + "/etc/redhat-release", parse_generic ~rex:re_fedora + DISTRO_FEDORA; +@@ -420,6 +427,10 @@ let linux_root_tests : tests = [ + DISTRO_CENTOS; + "/etc/redhat-release", parse_generic ~rex:re_centos_no_minor + DISTRO_CENTOS; ++ "/etc/redhat-release", parse_generic ~rex:re_rocky ++ DISTRO_ROCKY; ++ "/etc/redhat-release", parse_generic ~rex:re_rocky_no_minor ++ DISTRO_ROCKY; + "/etc/redhat-release", parse_generic ~rex:re_scientific_linux_old + DISTRO_SCIENTIFIC_LINUX; + "/etc/redhat-release", parse_generic ~rex:re_scientific_linux +diff --git a/daemon/inspect_types.ml b/daemon/inspect_types.ml +index e2bc7165c..9395c51f9 100644 +--- a/daemon/inspect_types.ml ++++ b/daemon/inspect_types.ml +@@ -95,6 +95,7 @@ and distro = + | DISTRO_PLD_LINUX + | DISTRO_REDHAT_BASED + | DISTRO_RHEL ++ | DISTRO_ROCKY + | DISTRO_SCIENTIFIC_LINUX + | DISTRO_SLACKWARE + | DISTRO_SLES +@@ -228,6 +229,7 @@ and string_of_distro = function + | DISTRO_PLD_LINUX -> "pldlinux" + | DISTRO_REDHAT_BASED -> "redhat-based" + | DISTRO_RHEL -> "rhel" ++ | DISTRO_ROCKY -> "rocky" + | DISTRO_SCIENTIFIC_LINUX -> "scientificlinux" + | DISTRO_SLACKWARE -> "slackware" + | DISTRO_SLES -> "sles" +diff --git a/daemon/inspect_types.mli b/daemon/inspect_types.mli +index 43c79818f..29c76e8ab 100644 +--- a/daemon/inspect_types.mli ++++ b/daemon/inspect_types.mli +@@ -102,6 +102,7 @@ and distro = + | DISTRO_PLD_LINUX + | DISTRO_REDHAT_BASED + | DISTRO_RHEL ++ | DISTRO_ROCKY + | DISTRO_SCIENTIFIC_LINUX + | DISTRO_SLACKWARE + | DISTRO_SLES +diff --git a/generator/actions_inspection.ml b/generator/actions_inspection.ml +index 0c6d39b43..f8b744993 100644 +--- a/generator/actions_inspection.ml ++++ b/generator/actions_inspection.ml +@@ -278,6 +278,10 @@ Some Red Hat-derived distro. + + Red Hat Enterprise Linux. + ++=item \"rocky\" ++ ++Rocky Linux. ++ + =item \"scientificlinux\" + + Scientific Linux. +diff --git a/lib/inspect-icon.c b/lib/inspect-icon.c +index 725af574b..3bffa4f80 100644 +--- a/lib/inspect-icon.c ++++ b/lib/inspect-icon.c +@@ -138,6 +138,7 @@ guestfs_impl_inspect_get_icon (guestfs_h *g, const char *root, size_t *size_r, + else if (STREQ (distro, "rhel") || + STREQ (distro, "redhat-based") || + STREQ (distro, "centos") || ++ STREQ (distro, "rocky") || + STREQ (distro, "scientificlinux") || + STREQ (distro, "oraclelinux")) { + r = icon_rhel (g, guestfs_inspect_get_major_version (g, root), &size); +diff --git a/lib/inspect-osinfo.c b/lib/inspect-osinfo.c +index db38d87f7..90e57e6df 100644 +--- a/lib/inspect-osinfo.c ++++ b/lib/inspect-osinfo.c +@@ -47,6 +47,10 @@ guestfs_impl_inspect_get_osinfo (guestfs_h *g, const char *root) + else if (major == 6) + return safe_asprintf (g, "%s%d.%d", distro, major, minor); + } ++ else if (STREQ (distro, "rocky")) { ++ if (major >= 8) ++ return safe_asprintf (g, "%s%d", distro, major); ++ } + else if (STREQ (distro, "debian")) { + if (major >= 4) + return safe_asprintf (g, "%s%d", distro, major); +-- +2.19.1.3.g30247aa5d201 + diff --git a/SOURCES/0003-m4-guestfs-ocaml.m4-Fix-deprecated-warning-format.patch b/SOURCES/0003-m4-guestfs-ocaml.m4-Fix-deprecated-warning-format.patch deleted file mode 100644 index d8631a7..0000000 --- a/SOURCES/0003-m4-guestfs-ocaml.m4-Fix-deprecated-warning-format.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 63c9cd933af75ca759fa2f2bbdbb07a699df5b30 Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Tue, 5 Oct 2021 20:51:19 +0100 -Subject: [PATCH] m4/guestfs-ocaml.m4: Fix deprecated warning format - -In OCaml 4.13: - -Alert ocaml_deprecated_cli: Setting a warning with a sequence of lowercase or uppercase letters, -like 'CDEFLMPSUVYZX', is deprecated. -Use the equivalent signed form: +C+D+E+F+L+M+P+S+U+V+Y+Z+X+52-3. - -(cherry picked from -guestfs-tools commit fa4f59e1d99c08d7e0bae2a7cb54f254a6506d67) ---- - m4/guestfs-ocaml.m4 | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/m4/guestfs-ocaml.m4 b/m4/guestfs-ocaml.m4 -index 4b8a44dee..d7f9462ea 100644 ---- a/m4/guestfs-ocaml.m4 -+++ b/m4/guestfs-ocaml.m4 -@@ -232,7 +232,7 @@ EOF - ]) - - dnl Flags we want to pass to every OCaml compiler call. --OCAML_WARN_ERROR="-warn-error CDEFLMPSUVYZX+52-3" -+OCAML_WARN_ERROR="-warn-error +C+D+E+F+L+M+P+S+U+V+Y+Z+X+52-3" - AC_SUBST([OCAML_WARN_ERROR]) - OCAML_FLAGS="-g -annot $safe_string_option" - AC_SUBST([OCAML_FLAGS]) --- -2.31.1 - diff --git a/SOURCES/0004-RHEL-Remove-libguestfs-live-RHBZ-798980.patch b/SOURCES/0004-RHEL-Remove-libguestfs-live-RHBZ-798980.patch deleted file mode 100644 index ec41d00..0000000 --- a/SOURCES/0004-RHEL-Remove-libguestfs-live-RHBZ-798980.patch +++ /dev/null @@ -1,55 +0,0 @@ -From ed8c7ae81786c9de45fa320fe699dbd715f52d87 Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Fri, 21 Dec 2012 15:50:11 +0000 -Subject: [PATCH] RHEL: Remove libguestfs live (RHBZ#798980). - -This isn't supported in RHEL. - -Disable daemon tests that require the 'unix' backend. ---- - lib/launch-unix.c | 7 +++++++ - tests/Makefile.am | 3 --- - 2 files changed, 7 insertions(+), 3 deletions(-) - -diff --git a/lib/launch-unix.c b/lib/launch-unix.c -index 0d344f9df..74dd1bb4a 100644 ---- a/lib/launch-unix.c -+++ b/lib/launch-unix.c -@@ -37,6 +37,12 @@ - static int - launch_unix (guestfs_h *g, void *datav, const char *sockpath) - { -+ error (g, -+ "launch: In RHEL, only the 'libvirt' or 'direct' method is supported.\n" -+ "In particular, \"libguestfs live\" is not supported."); -+ return -1; -+ -+#if 0 - int r, daemon_sock = -1; - struct sockaddr_un addr; - uint32_t size; -@@ -106,6 +112,7 @@ launch_unix (guestfs_h *g, void *datav, const char *sockpath) - g->conn = NULL; - } - return -1; -+#endif - } - - static int -diff --git a/tests/Makefile.am b/tests/Makefile.am -index 690e09b5e..919e2f248 100644 ---- a/tests/Makefile.am -+++ b/tests/Makefile.am -@@ -328,9 +328,6 @@ EXTRA_DIST += create/test-disk-create.sh - - check_DATA = daemon/captive-daemon.pm - --TESTS += \ -- daemon/test-daemon-start.pl \ -- daemon/test-btrfs.pl - EXTRA_DIST += \ - daemon/test-daemon-start.pl \ - daemon/test-btrfs.pl --- -2.31.1 - diff --git a/SOURCES/0004-launch-libvirt-place-our-virtio-net-pci-device-in-slot-0x1e.patch b/SOURCES/0004-launch-libvirt-place-our-virtio-net-pci-device-in-slot-0x1e.patch new file mode 100644 index 0000000..c223681 --- /dev/null +++ b/SOURCES/0004-launch-libvirt-place-our-virtio-net-pci-device-in-slot-0x1e.patch @@ -0,0 +1,65 @@ +From 43e0fdd6cb94370e74b1214c7550aa98b8307409 Mon Sep 17 00:00:00 2001 +From: Laszlo Ersek +Date: Thu, 23 Dec 2021 11:36:59 +0100 +Subject: [PATCH] launch-libvirt: place our virtio-net-pci device in slot 0x1e + +The trick we use for adding our virtio-net-pci device +in the libvirt backend can conflict with libvirtd's and QEMU's PCI address +assignment. Try to mitigate that by placing our device in slot 0x1e on the +root bus. In practice this could only conflict with a "dmi-to-pci-bridge" +device model, which libvirtd itself places in slot 0x1e. However, given +the XMLs we generate, and modern QEMU versions, libvirtd has no reason to +auto-add "dmi-to-pci-bridge". Refer to +. + +Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2034160 +Signed-off-by: Laszlo Ersek +Message-Id: <20211223103701.12702-2-lersek@redhat.com> +Reviewed-by: Richard W.M. Jones +Tested-by: Richard W.M. Jones +(cherry picked from commit 5ce5ef6a97a58c5e906083ad4e944545712b3f3f) +--- + lib/guestfs-internal.h | 11 +++++++++++ + lib/launch-libvirt.c | 4 +++- + 2 files changed, 14 insertions(+), 1 deletion(-) + +diff --git a/lib/guestfs-internal.h b/lib/guestfs-internal.h +index 4097b33fd..8eb2dd3ad 100644 +--- a/lib/guestfs-internal.h ++++ b/lib/guestfs-internal.h +@@ -172,6 +172,17 @@ cleanup_mutex_unlock (pthread_mutex_t **ptr) + #define VIRTIO_DEVICE_NAME(type) type "-pci" + #endif + ++/* Place the virtio-net controller in slot 0x1e on the root bus, on normal ++ * hardware with PCI. Refer to RHBZ#2034160. ++ */ ++#ifdef HAVE_LIBVIRT_BACKEND ++#if defined(__arm__) || defined(__s390x__) ++#define VIRTIO_NET_PCI_ADDR "" ++#else ++#define VIRTIO_NET_PCI_ADDR ",addr=1e.0" ++#endif ++#endif ++ + /* Guestfs handle and associated structures. */ + + /* State. */ +diff --git a/lib/launch-libvirt.c b/lib/launch-libvirt.c +index 194530c49..9e8336938 100644 +--- a/lib/launch-libvirt.c ++++ b/lib/launch-libvirt.c +@@ -1851,7 +1851,9 @@ construct_libvirt_xml_qemu_cmdline (guestfs_h *g, + } end_element (); + + start_element ("qemu:arg") { +- attribute ("value", VIRTIO_DEVICE_NAME ("virtio-net") ",netdev=usernet"); ++ attribute ("value", (VIRTIO_DEVICE_NAME ("virtio-net") ++ ",netdev=usernet" ++ VIRTIO_NET_PCI_ADDR)); + } end_element (); + } + +-- +2.19.1.3.g30247aa5d201 + diff --git a/SOURCES/0005-RHEL-Remove-9p-APIs-from-RHEL-RHBZ-921710.patch b/SOURCES/0005-RHEL-Remove-9p-APIs-from-RHEL-RHBZ-921710.patch deleted file mode 100644 index 1bdb11f..0000000 --- a/SOURCES/0005-RHEL-Remove-9p-APIs-from-RHEL-RHBZ-921710.patch +++ /dev/null @@ -1,329 +0,0 @@ -From dfd61ba102e4de9e7fb00106e0e73aa2cc4e11fd Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Thu, 18 Jul 2013 18:31:53 +0100 -Subject: [PATCH] RHEL: Remove 9p APIs from RHEL (RHBZ#921710). - ---- - daemon/9p.c | 182 -------------------------------------- - daemon/Makefile.am | 1 - - docs/C_SOURCE_FILES | 1 - - generator/actions_core.ml | 21 ----- - generator/proc_nr.ml | 2 - - gobject/Makefile.inc | 2 - - po/POTFILES | 2 - - tests/Makefile.am | 1 - - 8 files changed, 212 deletions(-) - delete mode 100644 daemon/9p.c - -diff --git a/daemon/9p.c b/daemon/9p.c -deleted file mode 100644 -index 743a96abd..000000000 ---- a/daemon/9p.c -+++ /dev/null -@@ -1,182 +0,0 @@ --/* libguestfs - the guestfsd daemon -- * Copyright (C) 2011 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. -- */ -- --#include -- --#include --#include --#include --#include --#include --#include --#include --#include --#include --#include -- --#include "ignore-value.h" -- --#include "daemon.h" --#include "actions.h" -- --#define BUS_PATH "/sys/bus/virtio/drivers/9pnet_virtio" -- --static void --modprobe_9pnet_virtio (void) --{ -- /* Required with Linux 5.6 and maybe earlier kernels. For unclear -- * reasons the module is not an automatic dependency of the 9p -- * module so doesn't get loaded automatically. -- */ -- ignore_value (command (NULL, NULL, "modprobe", "9pnet_virtio", NULL)); --} -- --/* https://bugzilla.redhat.com/show_bug.cgi?id=714981#c1 */ --char ** --do_list_9p (void) --{ -- CLEANUP_FREE_STRINGSBUF DECLARE_STRINGSBUF (r); -- DIR *dir; -- -- modprobe_9pnet_virtio (); -- -- dir = opendir (BUS_PATH); -- if (!dir) { -- perror ("opendir: " BUS_PATH); -- if (errno != ENOENT) { -- reply_with_perror ("opendir: " BUS_PATH); -- return NULL; -- } -- -- /* If this directory doesn't exist, it probably means that -- * the virtio driver isn't loaded. Don't return an error -- * in this case, but return an empty list. -- */ -- if (end_stringsbuf (&r) == -1) -- return NULL; -- -- return take_stringsbuf (&r); -- } -- -- while (1) { -- struct dirent *d; -- -- errno = 0; -- d = readdir (dir); -- if (d == NULL) break; -- -- if (STRPREFIX (d->d_name, "virtio")) { -- CLEANUP_FREE char *mount_tag_path = NULL; -- if (asprintf (&mount_tag_path, BUS_PATH "/%s/mount_tag", -- d->d_name) == -1) { -- reply_with_perror ("asprintf"); -- closedir (dir); -- return NULL; -- } -- -- /* A bit unclear, but it looks like the virtio transport allows -- * the mount tag length to be unlimited (or up to 65536 bytes). -- * See: linux/include/linux/virtio_9p.h -- */ -- CLEANUP_FREE char *mount_tag = read_whole_file (mount_tag_path, NULL); -- if (mount_tag == 0) -- continue; -- -- if (add_string (&r, mount_tag) == -1) { -- closedir (dir); -- return NULL; -- } -- } -- } -- -- /* Check readdir didn't fail */ -- if (errno != 0) { -- reply_with_perror ("readdir: /sys/block"); -- closedir (dir); -- return NULL; -- } -- -- /* Close the directory handle */ -- if (closedir (dir) == -1) { -- reply_with_perror ("closedir: /sys/block"); -- return NULL; -- } -- -- /* Sort the tags. */ -- if (r.size > 0) -- sort_strings (r.argv, r.size); -- -- /* NULL terminate the list */ -- if (end_stringsbuf (&r) == -1) -- return NULL; -- -- return take_stringsbuf (&r); --} -- --/* Takes optional arguments, consult optargs_bitmask. */ --int --do_mount_9p (const char *mount_tag, const char *mountpoint, const char *options) --{ -- CLEANUP_FREE char *mp = NULL, *opts = NULL, *err = NULL; -- struct stat statbuf; -- int r; -- -- ABS_PATH (mountpoint, 0, return -1); -- -- mp = sysroot_path (mountpoint); -- if (!mp) { -- reply_with_perror ("malloc"); -- return -1; -- } -- -- /* Check the mountpoint exists and is a directory. */ -- if (stat (mp, &statbuf) == -1) { -- reply_with_perror ("%s", mountpoint); -- return -1; -- } -- if (!S_ISDIR (statbuf.st_mode)) { -- reply_with_perror ("%s: mount point is not a directory", mountpoint); -- return -1; -- } -- -- /* Add trans=virtio to the options. */ -- if ((optargs_bitmask & GUESTFS_MOUNT_9P_OPTIONS_BITMASK) && -- STRNEQ (options, "")) { -- if (asprintf (&opts, "trans=virtio,%s", options) == -1) { -- reply_with_perror ("asprintf"); -- return -1; -- } -- } -- else { -- opts = strdup ("trans=virtio"); -- if (opts == NULL) { -- reply_with_perror ("strdup"); -- return -1; -- } -- } -- -- modprobe_9pnet_virtio (); -- r = command (NULL, &err, -- "mount", "-o", opts, "-t", "9p", mount_tag, mp, NULL); -- if (r == -1) { -- reply_with_error ("%s on %s: %s", mount_tag, mountpoint, err); -- return -1; -- } -- -- return 0; --} -diff --git a/daemon/Makefile.am b/daemon/Makefile.am -index 7322bfa5d..872eaa8bc 100644 ---- a/daemon/Makefile.am -+++ b/daemon/Makefile.am -@@ -84,7 +84,6 @@ guestfsd_SOURCES = \ - ../common/protocol/guestfs_protocol.h \ - ../common/utils/cleanups.h \ - ../common/utils/guestfs-utils.h \ -- 9p.c \ - acl.c \ - actions.h \ - available.c \ -diff --git a/docs/C_SOURCE_FILES b/docs/C_SOURCE_FILES -index 6a97d8b0e..896314e7e 100644 ---- a/docs/C_SOURCE_FILES -+++ b/docs/C_SOURCE_FILES -@@ -43,7 +43,6 @@ common/visit/visit.c - common/visit/visit.h - common/windows/windows.c - common/windows/windows.h --daemon/9p.c - daemon/acl.c - daemon/actions.h - daemon/augeas.c -diff --git a/generator/actions_core.ml b/generator/actions_core.ml -index 5933282dc..c6ffa2f6a 100644 ---- a/generator/actions_core.ml -+++ b/generator/actions_core.ml -@@ -6157,27 +6157,6 @@ This returns true iff the device exists and contains all zero bytes. - - Note that for large devices this can take a long time to run." }; - -- { defaults with -- name = "list_9p"; added = (1, 11, 12); -- style = RStringList (RPlainString, "mounttags"), [], []; -- shortdesc = "list 9p filesystems"; -- longdesc = "\ --List all 9p filesystems attached to the guest. A list of --mount tags is returned." }; -- -- { defaults with -- name = "mount_9p"; added = (1, 11, 12); -- style = RErr, [String (PlainString, "mounttag"); String (PlainString, "mountpoint")], [OString "options"]; -- camel_name = "Mount9P"; -- shortdesc = "mount 9p filesystem"; -- longdesc = "\ --Mount the virtio-9p filesystem with the tag C on the --directory C. -- --If required, C will be automatically added to the options. --Any other options required can be passed in the optional C --parameter." }; -- - { defaults with - name = "list_dm_devices"; added = (1, 11, 15); - style = RStringList (RDevice, "devices"), [], []; -diff --git a/generator/proc_nr.ml b/generator/proc_nr.ml -index 74b95baf7..6b6cb7353 100644 ---- a/generator/proc_nr.ml -+++ b/generator/proc_nr.ml -@@ -295,8 +295,6 @@ let proc_nr = [ - 282, "internal_autosync"; - 283, "is_zero"; - 284, "is_zero_device"; --285, "list_9p"; --286, "mount_9p"; - 287, "list_dm_devices"; - 288, "ntfsresize"; - 289, "btrfs_filesystem_resize"; -diff --git a/gobject/Makefile.inc b/gobject/Makefile.inc -index 650f8ddac..c4e735967 100644 ---- a/gobject/Makefile.inc -+++ b/gobject/Makefile.inc -@@ -94,7 +94,6 @@ guestfs_gobject_headers= \ - include/guestfs-gobject/optargs-mksquashfs.h \ - include/guestfs-gobject/optargs-mkswap.h \ - include/guestfs-gobject/optargs-mktemp.h \ -- include/guestfs-gobject/optargs-mount_9p.h \ - include/guestfs-gobject/optargs-mount_local.h \ - include/guestfs-gobject/optargs-ntfsclone_out.h \ - include/guestfs-gobject/optargs-ntfsfix.h \ -@@ -188,7 +187,6 @@ guestfs_gobject_sources= \ - src/optargs-mksquashfs.c \ - src/optargs-mkswap.c \ - src/optargs-mktemp.c \ -- src/optargs-mount_9p.c \ - src/optargs-mount_local.c \ - src/optargs-ntfsclone_out.c \ - src/optargs-ntfsfix.c \ -diff --git a/po/POTFILES b/po/POTFILES -index 29205b6a6..23afe619c 100644 ---- a/po/POTFILES -+++ b/po/POTFILES -@@ -26,7 +26,6 @@ common/utils/stringlists-utils.c - common/utils/utils.c - common/visit/visit.c - common/windows/windows.c --daemon/9p.c - daemon/acl.c - daemon/augeas.c - daemon/available.c -@@ -264,7 +263,6 @@ gobject/src/optargs-mkfs_btrfs.c - gobject/src/optargs-mksquashfs.c - gobject/src/optargs-mkswap.c - gobject/src/optargs-mktemp.c --gobject/src/optargs-mount_9p.c - gobject/src/optargs-mount_local.c - gobject/src/optargs-ntfsclone_out.c - gobject/src/optargs-ntfsfix.c -diff --git a/tests/Makefile.am b/tests/Makefile.am -index 919e2f248..e3613fec4 100644 ---- a/tests/Makefile.am -+++ b/tests/Makefile.am -@@ -43,7 +43,6 @@ check-slow: - check-valgrind: - $(MAKE) VG="@VG@" check - --TESTS += 9p/test-9p.sh - EXTRA_DIST += 9p/test-9p.sh - - SLOW_TESTS += bigdirs/test-big-dirs.pl --- -2.31.1 - diff --git a/SOURCES/0005-lib-extract-NETWORK_ADDRESS-and-NETWORK_PREFIX-as-macros.patch b/SOURCES/0005-lib-extract-NETWORK_ADDRESS-and-NETWORK_PREFIX-as-macros.patch new file mode 100644 index 0000000..a6c1dd1 --- /dev/null +++ b/SOURCES/0005-lib-extract-NETWORK_ADDRESS-and-NETWORK_PREFIX-as-macros.patch @@ -0,0 +1,70 @@ +From 80899629519139a7eb86842942a9471d05eb4112 Mon Sep 17 00:00:00 2001 +From: Laszlo Ersek +Date: Thu, 23 Dec 2021 11:37:00 +0100 +Subject: [PATCH] lib: extract NETWORK_ADDRESS and NETWORK_PREFIX as macros + +The 169.254.0.0/16 network specification (for the appliance) is currently +duplicated between the direct backend and the libvirt backend. In a +subsequent patch, we're going to need the network specification in yet +another spot; extract it now to the NETWORK_ADDRESS and NETWORK_PREFIX +macros (simply as strings). + +Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2034160 +Signed-off-by: Laszlo Ersek +Message-Id: <20211223103701.12702-3-lersek@redhat.com> +Reviewed-by: Richard W.M. Jones +Tested-by: Richard W.M. Jones +(cherry picked from commit 216de164e091a5c36403f24901698044a43ae0d9) +--- + lib/guestfs-internal.h | 6 ++++++ + lib/launch-direct.c | 2 +- + lib/launch-libvirt.c | 3 ++- + 3 files changed, 9 insertions(+), 2 deletions(-) + +diff --git a/lib/guestfs-internal.h b/lib/guestfs-internal.h +index 8eb2dd3ad..e24d570f5 100644 +--- a/lib/guestfs-internal.h ++++ b/lib/guestfs-internal.h +@@ -183,6 +183,12 @@ cleanup_mutex_unlock (pthread_mutex_t **ptr) + #endif + #endif + ++/* Network address and network mask (expressed as address prefix) that the ++ * appliance will see (if networking is enabled). ++ */ ++#define NETWORK_ADDRESS "169.254.0.0" ++#define NETWORK_PREFIX "16" ++ + /* Guestfs handle and associated structures. */ + + /* State. */ +diff --git a/lib/launch-direct.c b/lib/launch-direct.c +index e5b9a5611..4f038f4f0 100644 +--- a/lib/launch-direct.c ++++ b/lib/launch-direct.c +@@ -689,7 +689,7 @@ launch_direct (guestfs_h *g, void *datav, const char *arg) + start_list ("-netdev") { + append_list ("user"); + append_list ("id=usernet"); +- append_list ("net=169.254.0.0/16"); ++ append_list ("net=" NETWORK_ADDRESS "/" NETWORK_PREFIX); + } end_list (); + start_list ("-device") { + append_list (VIRTIO_DEVICE_NAME ("virtio-net")); +diff --git a/lib/launch-libvirt.c b/lib/launch-libvirt.c +index 9e8336938..266d88824 100644 +--- a/lib/launch-libvirt.c ++++ b/lib/launch-libvirt.c +@@ -1843,7 +1843,8 @@ construct_libvirt_xml_qemu_cmdline (guestfs_h *g, + } end_element (); + + start_element ("qemu:arg") { +- attribute ("value", "user,id=usernet,net=169.254.0.0/16"); ++ attribute ("value", ++ "user,id=usernet,net=" NETWORK_ADDRESS "/" NETWORK_PREFIX); + } end_element (); + + start_element ("qemu:arg") { +-- +2.19.1.3.g30247aa5d201 + diff --git a/SOURCES/0006-RHEL-Disable-unsupported-remote-drive-protocols-RHBZ.patch b/SOURCES/0006-RHEL-Disable-unsupported-remote-drive-protocols-RHBZ.patch deleted file mode 100644 index c245ac1..0000000 --- a/SOURCES/0006-RHEL-Disable-unsupported-remote-drive-protocols-RHBZ.patch +++ /dev/null @@ -1,609 +0,0 @@ -From 01e9dd07579f6852ab94b215c66d6d7bd0cb022d 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 - (RHBZ#962113). - -This disables support for unsupported remote drive protocols: - - * ftp - * ftps - * http - * https - * tftp - * gluster - * iscsi - * sheepdog - * ssh - -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 ----- - fish/guestfish.pod | 66 ++-------------- - fish/test-add-uri.sh | 32 -------- - generator/actions_core.ml | 50 +------------ - lib/drives.c | 8 ++ - lib/guestfs.pod | 100 ------------------------- - tests/disks/test-qemu-drive-libvirt.sh | 28 ------- - tests/disks/test-qemu-drive.sh | 60 --------------- - 8 files changed, 16 insertions(+), 348 deletions(-) - -diff --git a/docs/guestfs-testing.pod b/docs/guestfs-testing.pod -index f558964bf..8f264ed17 100644 ---- a/docs/guestfs-testing.pod -+++ b/docs/guestfs-testing.pod -@@ -109,26 +109,6 @@ image. To exit, type C. - If you get an error, try enabling debugging (add C<-v> to the command - line). Also make sure that L succeeds. - --=head2 Try to open a remote guest image with guestfish. -- --You may also have to disable libvirt by setting this: -- -- export LIBGUESTFS_BACKEND=direct -- --If you have a disk image available over HTTP/FTP, try to open it. -- -- guestfish --ro -i --format=raw -a http://www.example.com/disk.img -- --For SSH you will need to make sure that ssh-agent is set up so you --don't need a password to log in to the remote machine. Then a command --similar to this should work: -- -- guestfish --ro -i --format=raw \ -- -a ssh://remote.example.com/path/to/disk.img -- --If you get an error, try enabling debugging (add C<-v> to the command --line). Also make sure that L succeeds. -- - =head2 Run virt-alignment-scan on all your guests. - - Run L on guests or disk images: -diff --git a/fish/guestfish.pod b/fish/guestfish.pod -index 9f086f110..bb4167b06 100644 ---- a/fish/guestfish.pod -+++ b/fish/guestfish.pod -@@ -131,9 +131,9 @@ To list what is available do: - - =head2 Remote drives - --Access a remote disk using ssh: -+Access a remote disk using NBD: - -- guestfish -a ssh://example.com/path/to/disk.img -+ guestfish -a nbd://example.com - - =head2 Remote control - -@@ -1134,12 +1134,12 @@ L>. - On the command line, you can use the I<-a> option to add network - block devices using a URI-style format, for example: - -- guestfish -a ssh://root@example.com/disk.img -+ guestfish -a nbd://example.com - - URIs I be used with the L command. The equivalent - command using the API directly is: - -- > add /disk.img protocol:ssh server:tcp:example.com username:root -+ > add /disk.img protocol:nbd server:tcp:example.com - - The possible I<-a URI> formats are described below. - -@@ -1149,40 +1149,6 @@ The possible I<-a URI> formats are described below. - - Add the local disk image (or device) called F. - --=head2 B<-a ftp://[user@]example.com[:port]/disk.img> -- --=head2 B<-a ftps://[user@]example.com[:port]/disk.img> -- --=head2 B<-a http://[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, HTTP or TFTP server. -- --The equivalent API command would be: -- -- > 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, and may be C. -- --The equivalent API command would be: -- -- > add volname/image protocol:gluster server:tcp:example.com -- --=head2 B<-a iscsi://example.com[:port]/target-iqn-name[/lun]> -- --Add a disk located on an iSCSI server. -- --The equivalent API command would be: -- -- > add target-iqn-name/lun protocol:iscsi server:tcp:example.com -- - =head2 B<-a nbd://example.com[:port]> - - =head2 B<-a nbd://example.com[:port]/exportname> -@@ -1217,35 +1183,13 @@ The equivalent API command would be: - - > 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: -- -- > add volume protocol:sheepdog [server:tcp:example.com] -- --=head2 B<-a ssh://[user@]example.com[:port]/disk.img> -- --Add a disk image located on a remote server, accessed using the Secure --Shell (ssh) SFTP protocol. SFTP is supported out of the box by all --major SSH servers. -- --The equivalent API command would be: -- -- > add /disk protocol:ssh server:tcp:example.com [username:user] -- - Note that the URIs follow the syntax of - L: in particular, there - are restrictions on the allowed characters for the various components - of the URI. Characters such as C<:>, C<@>, and C B be - percent-encoded: - -- $ guestfish -a ssh://user:pass%40word@example.com/disk.img -+ $ guestfish -a rbd://user:pass%40word@example.com[:port]/pool/disk - - In this case, the password is C. - -diff --git a/fish/test-add-uri.sh b/fish/test-add-uri.sh -index 21d424984..ddabeb639 100755 ---- a/fish/test-add-uri.sh -+++ b/fish/test-add-uri.sh -@@ -40,14 +40,6 @@ function fail () - $VG guestfish -x -a file://$abs_builddir/test-add-uri.img test-add-uri.out 2>&1 - grep -sq 'add_drive ".*/test-add-uri.img"' test-add-uri.out || fail - --# curl --$VG guestfish -x -a ftp://user@example.com/disk.img 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 -- --# gluster --$VG guestfish -x -a gluster://example.com/disk test-add-uri.out 2>&1 --grep -sq 'add_drive "disk" "protocol:gluster" "server:tcp:example.com"' test-add-uri.out || fail -- - # NBD - $VG guestfish -x -a nbd://example.com test-add-uri.out 2>&1 - 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 - $VG guestfish -x -a rbd:///pool/disk test-add-uri.out 2>&1 - grep -sq 'add_drive "pool/disk" "protocol:rbd"' test-add-uri.out || fail - --# sheepdog --$VG guestfish -x -a sheepdog:///volume/image 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 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 --$VG guestfish -x -a ssh://example.com/disk.img test-add-uri.out 2>&1 --grep -sq 'add_drive "/disk.img" "protocol:ssh" "server:tcp:example.com"' test-add-uri.out || fail -- --$VG guestfish -x -a ssh://user@example.com/disk.img test-add-uri.out 2>&1 --grep -sq 'add_drive "/disk.img" "protocol:ssh" "server:tcp:example.com" "username:user"' test-add-uri.out || fail -- --$VG guestfish -x -a ssh://user@example.com:2000/disk.img test-add-uri.out 2>&1 --grep -sq 'add_drive "/disk.img" "protocol:ssh" "server:tcp:example.com:2000" "username:user"' test-add-uri.out || fail -- --# iSCSI --$VG guestfish -x -a iscsi://example.com/iqn.2015-12.com.libguestfs:test1/0 test-add-uri.out 2>&1 --grep -sq 'add_drive "iqn.2015-12.com.libguestfs:test1/0" "protocol:iscsi" "server:tcp:example.com"' test-add-uri.out || fail -- --$VG guestfish -x -a iscsi://user:password@example.com/iqn.2015-12.com.libguestfs:test2/0 test-add-uri.out 2>&1 --grep -sq 'add_drive "iqn.2015-12.com.libguestfs:test2/0" "protocol:iscsi" "server:tcp:example.com" "username:user" "secret:password"' test-add-uri.out || fail -- - rm test-add-uri.out - rm test-add-uri.img -diff --git a/generator/actions_core.ml b/generator/actions_core.ml -index c6ffa2f6a..91dce1db5 100644 ---- a/generator/actions_core.ml -+++ b/generator/actions_core.ml -@@ -297,29 +297,6 @@ F is interpreted as a local file or device. - This is the default if the optional protocol parameter - is omitted. - --=item C -- --Connect to a remote FTP, HTTP or TFTP server. --The C parameter must also be supplied - see below. -- --See also: L -- --=item C -- --Connect to the GlusterFS server. --The C parameter must also be supplied - see below. -- --See also: L -- --=item C -- --Connect to the iSCSI server. --The C parameter must also be supplied - see below. --The C parameter may be supplied. See below. --The C parameter may be supplied. See below. -- --See also: L. -- - =item C - - Connect to the Network Block Device server. -@@ -336,22 +313,6 @@ The C parameter may be supplied. See below. - - See also: L. - --=item C -- --Connect to the Sheepdog server. --The C parameter may also be supplied - see below. -- --See also: L. -- --=item C -- --Connect to the Secure Shell (ssh) server. -- --The C parameter must be supplied. --The C parameter may be supplied. See below. -- --See also: L. -- - =back - - =item C -@@ -362,13 +323,8 @@ is a list of server(s). - Protocol Number of servers required - -------- -------------------------- - file List must be empty or param not used at all -- ftp|ftps|http|https|tftp Exactly one -- gluster Exactly one -- iscsi Exactly one - nbd Exactly one - rbd Zero or more -- sheepdog Zero or more -- ssh Exactly one - - Each list element is a string specifying a server. The string must be - in one of the following formats: -@@ -384,10 +340,10 @@ for the protocol is used (see F). - - =item C - --For the C, C, C, C, C, C, C --and C protocols, this specifies the remote username. -+For the C -+protocol, this specifies the remote username. - --If not given, then the local username is used for C, and no authentication -+If not given, then no authentication - is attempted for ceph. But note this sometimes may give unexpected results, for - 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 46af66db4..c81ded5d7 100644 ---- a/lib/drives.c -+++ b/lib/drives.c -@@ -168,6 +168,7 @@ create_drive_non_file (guestfs_h *g, - return drv; - } - -+#if 0 /* DISABLED IN RHEL 8 */ - static struct drive * - create_drive_curl (guestfs_h *g, - const struct drive_create_data *data) -@@ -226,6 +227,7 @@ create_drive_gluster (guestfs_h *g, - - return create_drive_non_file (g, data); - } -+#endif /* DISABLED IN RHEL 8 */ - - static int - nbd_port (void) -@@ -294,6 +296,7 @@ create_drive_rbd (guestfs_h *g, - return create_drive_non_file (g, data); - } - -+#if 0 /* DISABLED IN RHEL 8 */ - static struct drive * - create_drive_sheepdog (guestfs_h *g, - const struct drive_create_data *data) -@@ -394,6 +397,7 @@ create_drive_iscsi (guestfs_h *g, - - return create_drive_non_file (g, data); - } -+#endif /* DISABLED IN RHEL 8 */ - - /** - * Create the special F drive. -@@ -856,6 +860,7 @@ guestfs_impl_add_drive_opts (guestfs_h *g, const char *filename, - drv = create_drive_file (g, &data); - } - } -+#if 0 /* DISABLED IN RHEL 8 */ - else if (STREQ (protocol, "ftp")) { - data.protocol = drive_protocol_ftp; - drv = create_drive_curl (g, &data); -@@ -880,6 +885,7 @@ guestfs_impl_add_drive_opts (guestfs_h *g, const char *filename, - data.protocol = drive_protocol_iscsi; - drv = create_drive_iscsi (g, &data); - } -+#endif /* DISABLED IN RHEL 8 */ - else if (STREQ (protocol, "nbd")) { - data.protocol = drive_protocol_nbd; - drv = create_drive_nbd (g, &data); -@@ -888,6 +894,7 @@ guestfs_impl_add_drive_opts (guestfs_h *g, const char *filename, - data.protocol = drive_protocol_rbd; - drv = create_drive_rbd (g, &data); - } -+#if 0 /* DISABLED IN RHEL 8 */ - else if (STREQ (protocol, "sheepdog")) { - data.protocol = drive_protocol_sheepdog; - drv = create_drive_sheepdog (g, &data); -@@ -900,6 +907,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 { - error (g, _("unknown protocol ‘%s’"), protocol); - drv = NULL; /*FALLTHROUGH*/ -diff --git a/lib/guestfs.pod b/lib/guestfs.pod -index ff58aa0bb..1af00f1bb 100644 ---- a/lib/guestfs.pod -+++ b/lib/guestfs.pod -@@ -715,70 +715,6 @@ servers. The server string is documented in - L. The C and C parameters are - also optional, and if not given, then no authentication will be used. - --=head3 FTP, HTTP AND TFTP -- --Libguestfs can access remote disks over FTP, FTPS, HTTP, HTTPS --or TFTP protocols. -- --To do this, set the optional C and C parameters of --L like this: -- -- char **servers = { "www.example.org", NULL }; -- guestfs_add_drive_opts (g, "/disk.img", -- GUESTFS_ADD_DRIVE_OPTS_FORMAT, "raw", -- GUESTFS_ADD_DRIVE_OPTS_PROTOCOL, "http", -- GUESTFS_ADD_DRIVE_OPTS_SERVER, servers, -- -1); -- --The C can be one of C<"ftp">, C<"ftps">, C<"http">, --C<"https"> or C<"tftp">. -- --C (the C parameter) is a list which must have a --single element. The single element is a string defining the web, --FTP or TFTP server. The format of this string is documented in --L. -- --=head3 GLUSTER -- --Libguestfs can access Gluster disks. -- --To do this, set the optional C and C parameters of --L 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 (the C 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. -- --Note that gluster usually requires the client process (ie. libguestfs) --to run as B and will give unfathomable errors if it is not --(eg. "No data available"). -- --=head3 ISCSI -- --Libguestfs can access iSCSI disks remotely. -- --To do this, set the optional C and C parameters like --this: -- -- char **server = { "iscsi.example.org:3000", NULL }; -- guestfs_add_drive_opts (g, "target-iqn-name/lun", -- GUESTFS_ADD_DRIVE_OPTS_FORMAT, "raw", -- GUESTFS_ADD_DRIVE_OPTS_PROTOCOL, "iscsi", -- GUESTFS_ADD_DRIVE_OPTS_SERVER, server, -- -1); -- --The C parameter is a list which must have a single element. --The single element is a string defining the iSCSI server. The format --of this string is documented in L. -- - =head3 NETWORK BLOCK DEVICE - - Libguestfs can access Network Block Device (NBD) disks remotely. -@@ -841,42 +777,6 @@ L - - =back - --=head3 SHEEPDOG -- --Libguestfs can access Sheepdog disks. -- --To do this, set the optional C and C parameters of --L 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 may be zero or more server addresses --(C<"hostname:port">). The format of the server strings is documented --in L. -- --=head3 SSH -- --Libguestfs can access disks over a Secure Shell (SSH) connection. -- --To do this, set the C and C and (optionally) --C parameters of L like this: -- -- char **server = { "remote.example.com", NULL }; -- guestfs_add_drive_opts (g, "/path/to/disk.img", -- GUESTFS_ADD_DRIVE_OPTS_FORMAT, "raw", -- GUESTFS_ADD_DRIVE_OPTS_PROTOCOL, "ssh", -- GUESTFS_ADD_DRIVE_OPTS_SERVER, server, -- GUESTFS_ADD_DRIVE_OPTS_USERNAME, "remoteuser", -- -1); -- --The format of the server string is documented in --L. -- - =head2 INSPECTION - - 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 -index 595a95a5e..b49534c94 100755 ---- a/tests/disks/test-qemu-drive-libvirt.sh -+++ b/tests/disks/test-qemu-drive-libvirt.sh -@@ -65,34 +65,6 @@ check_output - grep -sq -- '-drive file=rbd:abc-def/ghi-jkl:auth_supported=none,' "$DEBUG_QEMU_FILE" || fail ceph2 - 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. -- --$guestfish -d iscsi run ||: --check_output --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" -- --# 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 ||: -diff --git a/tests/disks/test-qemu-drive.sh b/tests/disks/test-qemu-drive.sh -index 12937fb30..b3e4f9903 100755 ---- a/tests/disks/test-qemu-drive.sh -+++ b/tests/disks/test-qemu-drive.sh -@@ -62,45 +62,6 @@ check_output - grep -sq -- '-drive file=rbd:abc-def/ghi-jkl:auth_supported=none,' "$DEBUG_QEMU_FILE" || fail - rm "$DEBUG_QEMU_FILE" - --# HTTP. -- --guestfish < +Date: Thu, 23 Dec 2021 11:37:01 +0100 +Subject: [PATCH] launch-libvirt: add virtio-net via the standard + element + +Starting with version 3.8.0, libvirt allows us to specify the network +address and network mask (as prefix) for SLIRP directly via the + element in the domain XML: +. This means +we don't need the hack for virtio-net on such versions. + +Restrict the hack in construct_libvirt_xml_qemu_cmdline() to +libvirt<3.8.0, and generate the proper element in +construct_libvirt_xml_devices() on libvirt>=3.8.0. + +Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2034160 +Suggested-by: Richard W.M. Jones +Signed-off-by: Laszlo Ersek +Message-Id: <20211223103701.12702-4-lersek@redhat.com> +Reviewed-by: Richard W.M. Jones +Tested-by: Richard W.M. Jones +(cherry picked from commit 5858c2cf6c24b3776e3867eafd9d86a1f4912d9c) +--- + lib/guestfs-internal.h | 3 ++- + lib/launch-libvirt.c | 27 +++++++++++++++++++++++++-- + 2 files changed, 27 insertions(+), 3 deletions(-) + +diff --git a/lib/guestfs-internal.h b/lib/guestfs-internal.h +index e24d570f5..4a19e5c6b 100644 +--- a/lib/guestfs-internal.h ++++ b/lib/guestfs-internal.h +@@ -173,7 +173,8 @@ cleanup_mutex_unlock (pthread_mutex_t **ptr) + #endif + + /* Place the virtio-net controller in slot 0x1e on the root bus, on normal +- * hardware with PCI. Refer to RHBZ#2034160. ++ * hardware with PCI. Necessary only before libvirt 3.8.0. Refer to ++ * RHBZ#2034160. + */ + #ifdef HAVE_LIBVIRT_BACKEND + #if defined(__arm__) || defined(__s390x__) +diff --git a/lib/launch-libvirt.c b/lib/launch-libvirt.c +index 266d88824..cc714c02e 100644 +--- a/lib/launch-libvirt.c ++++ b/lib/launch-libvirt.c +@@ -1413,6 +1413,28 @@ construct_libvirt_xml_devices (guestfs_h *g, + } end_element (); + } end_element (); + ++ /* Virtio-net NIC with SLIRP (= userspace) back-end, if networking is ++ * enabled. Starting with libvirt 3.8.0, we can specify the network address ++ * and prefix for SLIRP in the domain XML. Therefore, we can add the NIC ++ * via the standard element rather than , and ++ * so libvirt can manage the PCI address of the virtio-net NIC like the PCI ++ * addresses of all other devices. Refer to RHBZ#2034160. ++ */ ++ if (g->enable_network && ++ guestfs_int_version_ge (¶ms->data->libvirt_version, 3, 8, 0)) { ++ start_element ("interface") { ++ attribute ("type", "user"); ++ start_element ("model") { ++ attribute ("type", "virtio"); ++ } end_element (); ++ start_element ("ip") { ++ attribute ("family", "ipv4"); ++ attribute ("address", NETWORK_ADDRESS); ++ attribute ("prefix", NETWORK_PREFIX); ++ } end_element (); ++ } end_element (); ++ } ++ + /* Libvirt adds some devices by default. Indicate to libvirt + * that we don't want them. + */ +@@ -1835,9 +1857,10 @@ construct_libvirt_xml_qemu_cmdline (guestfs_h *g, + } end_element (); + + /* Workaround because libvirt user networking cannot specify "net=" +- * parameter. ++ * parameter. Necessary only before libvirt 3.8.0; refer to RHBZ#2034160. + */ +- if (g->enable_network) { ++ if (g->enable_network && ++ !guestfs_int_version_ge (¶ms->data->libvirt_version, 3, 8, 0)) { + start_element ("qemu:arg") { + attribute ("value", "-netdev"); + } end_element (); +-- +2.19.1.3.g30247aa5d201 + diff --git a/SOURCES/0007-RHEL-Remove-User-Mode-Linux-RHBZ-1144197.patch b/SOURCES/0007-RHEL-Remove-User-Mode-Linux-RHBZ-1144197.patch deleted file mode 100644 index 998760d..0000000 --- a/SOURCES/0007-RHEL-Remove-User-Mode-Linux-RHBZ-1144197.patch +++ /dev/null @@ -1,72 +0,0 @@ -From 85adb673dd4705faaac3194d131f2c40bb7a1c78 Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Fri, 19 Sep 2014 13:38:20 +0100 -Subject: [PATCH] RHEL: Remove User-Mode Linux (RHBZ#1144197). - -This isn't supported in RHEL. ---- - lib/launch-uml.c | 13 +++++++++++++ - 1 file changed, 13 insertions(+) - -diff --git a/lib/launch-uml.c b/lib/launch-uml.c -index 5aec50a57..8b9fcd770 100644 ---- a/lib/launch-uml.c -+++ b/lib/launch-uml.c -@@ -44,7 +44,9 @@ struct backend_uml_data { - char umid[UML_UMID_LEN+1]; /* umid=<...> unique ID. */ - }; - -+#if 0 - static void print_vmlinux_command_line (guestfs_h *g, char **argv); -+#endif - - /* Run uml_mkcow to create a COW overlay. */ - static char * -@@ -81,6 +83,7 @@ create_cow_overlay_uml (guestfs_h *g, void *datav, struct drive *drv) - return make_cow_overlay (g, drv->src.u.path); - } - -+#if 0 - /* Test for features which are not supported by the UML backend. - * Possibly some of these should just be warnings, not errors. - */ -@@ -133,10 +136,17 @@ uml_supported (guestfs_h *g) - - return true; - } -+#endif - - static int - launch_uml (guestfs_h *g, void *datav, const char *arg) - { -+ error (g, -+ "launch: In RHEL, only the 'libvirt' or 'direct' method is supported.\n" -+ "In particular, User-Mode Linux (UML) is not supported."); -+ return -1; -+ -+#if 0 - struct backend_uml_data *data = datav; - CLEANUP_FREE_STRINGSBUF DECLARE_STRINGSBUF (cmdline); - int console_sock = -1, daemon_sock = -1; -@@ -496,8 +506,10 @@ launch_uml (guestfs_h *g, void *datav, const char *arg) - } - g->state = CONFIG; - return -1; -+#endif - } - -+#if 0 - /* This is called from the forked subprocess just before vmlinux runs, - * so it can just print the message straight to stderr, where it will - * be picked up and funnelled through the usual appliance event API. -@@ -527,6 +539,7 @@ print_vmlinux_command_line (guestfs_h *g, char **argv) - - fputc ('\n', stderr); - } -+#endif - - static int - shutdown_uml (guestfs_h *g, void *datav, int check_for_errors) --- -2.31.1 - diff --git a/SOURCES/0007-RHEL-Remove-libguestfs-live-RHBZ-798980.patch b/SOURCES/0007-RHEL-Remove-libguestfs-live-RHBZ-798980.patch new file mode 100644 index 0000000..62c8b50 --- /dev/null +++ b/SOURCES/0007-RHEL-Remove-libguestfs-live-RHBZ-798980.patch @@ -0,0 +1,55 @@ +From dabee87775ee919a8ae930ca5f03c7bb4b7616e6 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Fri, 21 Dec 2012 15:50:11 +0000 +Subject: [PATCH] RHEL: Remove libguestfs live (RHBZ#798980). + +This isn't supported in RHEL. + +Disable daemon tests that require the 'unix' backend. +--- + lib/launch-unix.c | 7 +++++++ + tests/Makefile.am | 3 --- + 2 files changed, 7 insertions(+), 3 deletions(-) + +diff --git a/lib/launch-unix.c b/lib/launch-unix.c +index 0d344f9df..74dd1bb4a 100644 +--- a/lib/launch-unix.c ++++ b/lib/launch-unix.c +@@ -37,6 +37,12 @@ + static int + launch_unix (guestfs_h *g, void *datav, const char *sockpath) + { ++ error (g, ++ "launch: In RHEL, only the 'libvirt' or 'direct' method is supported.\n" ++ "In particular, \"libguestfs live\" is not supported."); ++ return -1; ++ ++#if 0 + int r, daemon_sock = -1; + struct sockaddr_un addr; + uint32_t size; +@@ -106,6 +112,7 @@ launch_unix (guestfs_h *g, void *datav, const char *sockpath) + g->conn = NULL; + } + return -1; ++#endif + } + + static int +diff --git a/tests/Makefile.am b/tests/Makefile.am +index 690e09b5e..919e2f248 100644 +--- a/tests/Makefile.am ++++ b/tests/Makefile.am +@@ -328,9 +328,6 @@ EXTRA_DIST += create/test-disk-create.sh + + check_DATA = daemon/captive-daemon.pm + +-TESTS += \ +- daemon/test-daemon-start.pl \ +- daemon/test-btrfs.pl + EXTRA_DIST += \ + daemon/test-daemon-start.pl \ + daemon/test-btrfs.pl +-- +2.19.1.3.g30247aa5d201 + diff --git a/SOURCES/0008-RHEL-Reject-use-of-libguestfs-winsupport-features-ex.patch b/SOURCES/0008-RHEL-Reject-use-of-libguestfs-winsupport-features-ex.patch deleted file mode 100644 index 95b89f7..0000000 --- a/SOURCES/0008-RHEL-Reject-use-of-libguestfs-winsupport-features-ex.patch +++ /dev/null @@ -1,69 +0,0 @@ -From 36b483bb8150a09c7fa6aecb25bf5524fe2e7b93 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 - virt-* tools (RHBZ#1240276). - -Fix the tests: it doesn't let us use guestfish for arbitrary Windows -edits. ---- - generator/c.ml | 16 ++++++++++++++++ - test-data/phony-guests/make-windows-img.sh | 1 + - tests/charsets/test-charset-fidelity.c | 2 ++ - 3 files changed, 19 insertions(+) - -diff --git a/generator/c.ml b/generator/c.ml -index ea69abf76..56ee38aa4 100644 ---- a/generator/c.ml -+++ b/generator/c.ml -@@ -1846,6 +1846,22 @@ and generate_client_actions actions () = - check_args_validity c_name style; - trace_call name c_name style; - -+ (* RHEL 8 *) -+ if name = "mount" || name = "mount_ro" || name = "mount_options" || -+ name = "mount_vfs" then ( -+ pr " if (g->program && !STRPREFIX (g->program, \"virt-\")) {\n"; -+ pr " CLEANUP_FREE char *vfs_type = guestfs_vfs_type (g, mountable);\n"; -+ pr " if (vfs_type && STREQ (vfs_type, \"ntfs\")) {\n"; -+ pr " error (g, \"mount: unsupported filesystem type\");\n"; -+ pr " if (trace_flag)\n"; -+ pr " guestfs_int_trace (g, \"%%s = %%s (error)\",\n"; -+ pr " \"%s\", \"-1\");\n" name; -+ pr " return %s;\n" (string_of_errcode errcode); -+ pr " }\n"; -+ pr " }\n"; -+ pr "\n"; -+ ); -+ - (* Calculate the total size of all FileIn arguments to pass - * as a progress bar hint. - *) -diff --git a/test-data/phony-guests/make-windows-img.sh b/test-data/phony-guests/make-windows-img.sh -index 30908a918..73cf5144e 100755 ---- a/test-data/phony-guests/make-windows-img.sh -+++ b/test-data/phony-guests/make-windows-img.sh -@@ -37,6 +37,7 @@ fi - - # Create a disk image. - guestfish < +Date: Thu, 18 Jul 2013 18:31:53 +0100 +Subject: [PATCH] RHEL: Remove 9p APIs from RHEL (RHBZ#921710). + +--- + daemon/9p.c | 182 -------------------------------------- + daemon/Makefile.am | 1 - + docs/C_SOURCE_FILES | 1 - + generator/actions_core.ml | 21 ----- + generator/proc_nr.ml | 2 - + gobject/Makefile.inc | 2 - + po/POTFILES | 2 - + tests/Makefile.am | 1 - + 8 files changed, 212 deletions(-) + delete mode 100644 daemon/9p.c + +diff --git a/daemon/9p.c b/daemon/9p.c +deleted file mode 100644 +index 9a3a5cfdf..000000000 +--- a/daemon/9p.c ++++ /dev/null +@@ -1,182 +0,0 @@ +-/* libguestfs - the guestfsd daemon +- * Copyright (C) 2011 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. +- */ +- +-#include +- +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +- +-#include "ignore-value.h" +- +-#include "daemon.h" +-#include "actions.h" +- +-#define BUS_PATH "/sys/bus/virtio/drivers/9pnet_virtio" +- +-static void +-modprobe_9pnet_virtio (void) +-{ +- /* Required with Linux 5.6 and maybe earlier kernels. For unclear +- * reasons the module is not an automatic dependency of the 9p +- * module so doesn't get loaded automatically. +- */ +- ignore_value (command (NULL, NULL, "modprobe", "9pnet_virtio", NULL)); +-} +- +-/* https://bugzilla.redhat.com/show_bug.cgi?id=714981#c1 */ +-char ** +-do_list_9p (void) +-{ +- CLEANUP_FREE_STRINGSBUF DECLARE_STRINGSBUF (r); +- DIR *dir; +- +- modprobe_9pnet_virtio (); +- +- dir = opendir (BUS_PATH); +- if (!dir) { +- perror ("opendir: " BUS_PATH); +- if (errno != ENOENT) { +- reply_with_perror ("opendir: " BUS_PATH); +- return NULL; +- } +- +- /* If this directory doesn't exist, it probably means that +- * the virtio driver isn't loaded. Don't return an error +- * in this case, but return an empty list. +- */ +- if (end_stringsbuf (&r) == -1) +- return NULL; +- +- return take_stringsbuf (&r); +- } +- +- while (1) { +- struct dirent *d; +- +- errno = 0; +- d = readdir (dir); +- if (d == NULL) break; +- +- if (STRPREFIX (d->d_name, "virtio")) { +- CLEANUP_FREE char *mount_tag_path = NULL; +- if (asprintf (&mount_tag_path, BUS_PATH "/%s/mount_tag", +- d->d_name) == -1) { +- reply_with_perror ("asprintf"); +- closedir (dir); +- return NULL; +- } +- +- /* A bit unclear, but it looks like the virtio transport allows +- * the mount tag length to be unlimited (or up to 65536 bytes). +- * See: linux/include/linux/virtio_9p.h +- */ +- CLEANUP_FREE char *mount_tag = read_whole_file (mount_tag_path, NULL); +- if (mount_tag == 0) +- continue; +- +- if (add_string (&r, mount_tag) == -1) { +- closedir (dir); +- return NULL; +- } +- } +- } +- +- /* Check readdir didn't fail */ +- if (errno != 0) { +- reply_with_perror ("readdir: " BUS_PATH); +- closedir (dir); +- return NULL; +- } +- +- /* Close the directory handle */ +- if (closedir (dir) == -1) { +- reply_with_perror ("closedir: " BUS_PATH); +- return NULL; +- } +- +- /* Sort the tags. */ +- if (r.size > 0) +- sort_strings (r.argv, r.size); +- +- /* NULL terminate the list */ +- if (end_stringsbuf (&r) == -1) +- return NULL; +- +- return take_stringsbuf (&r); +-} +- +-/* Takes optional arguments, consult optargs_bitmask. */ +-int +-do_mount_9p (const char *mount_tag, const char *mountpoint, const char *options) +-{ +- CLEANUP_FREE char *mp = NULL, *opts = NULL, *err = NULL; +- struct stat statbuf; +- int r; +- +- ABS_PATH (mountpoint, 0, return -1); +- +- mp = sysroot_path (mountpoint); +- if (!mp) { +- reply_with_perror ("malloc"); +- return -1; +- } +- +- /* Check the mountpoint exists and is a directory. */ +- if (stat (mp, &statbuf) == -1) { +- reply_with_perror ("%s", mountpoint); +- return -1; +- } +- if (!S_ISDIR (statbuf.st_mode)) { +- reply_with_perror ("%s: mount point is not a directory", mountpoint); +- return -1; +- } +- +- /* Add trans=virtio to the options. */ +- if ((optargs_bitmask & GUESTFS_MOUNT_9P_OPTIONS_BITMASK) && +- STRNEQ (options, "")) { +- if (asprintf (&opts, "trans=virtio,%s", options) == -1) { +- reply_with_perror ("asprintf"); +- return -1; +- } +- } +- else { +- opts = strdup ("trans=virtio"); +- if (opts == NULL) { +- reply_with_perror ("strdup"); +- return -1; +- } +- } +- +- modprobe_9pnet_virtio (); +- r = command (NULL, &err, +- "mount", "-o", opts, "-t", "9p", mount_tag, mp, NULL); +- if (r == -1) { +- reply_with_error ("%s on %s: %s", mount_tag, mountpoint, err); +- return -1; +- } +- +- return 0; +-} +diff --git a/daemon/Makefile.am b/daemon/Makefile.am +index 7322bfa5d..872eaa8bc 100644 +--- a/daemon/Makefile.am ++++ b/daemon/Makefile.am +@@ -84,7 +84,6 @@ guestfsd_SOURCES = \ + ../common/protocol/guestfs_protocol.h \ + ../common/utils/cleanups.h \ + ../common/utils/guestfs-utils.h \ +- 9p.c \ + acl.c \ + actions.h \ + available.c \ +diff --git a/docs/C_SOURCE_FILES b/docs/C_SOURCE_FILES +index 6a97d8b0e..896314e7e 100644 +--- a/docs/C_SOURCE_FILES ++++ b/docs/C_SOURCE_FILES +@@ -43,7 +43,6 @@ common/visit/visit.c + common/visit/visit.h + common/windows/windows.c + common/windows/windows.h +-daemon/9p.c + daemon/acl.c + daemon/actions.h + daemon/augeas.c +diff --git a/generator/actions_core.ml b/generator/actions_core.ml +index 226fb860a..05320fcd3 100644 +--- a/generator/actions_core.ml ++++ b/generator/actions_core.ml +@@ -6157,27 +6157,6 @@ This returns true iff the device exists and contains all zero bytes. + + Note that for large devices this can take a long time to run." }; + +- { defaults with +- name = "list_9p"; added = (1, 11, 12); +- style = RStringList (RPlainString, "mounttags"), [], []; +- shortdesc = "list 9p filesystems"; +- longdesc = "\ +-List all 9p filesystems attached to the guest. A list of +-mount tags is returned." }; +- +- { defaults with +- name = "mount_9p"; added = (1, 11, 12); +- style = RErr, [String (PlainString, "mounttag"); String (PlainString, "mountpoint")], [OString "options"]; +- camel_name = "Mount9P"; +- shortdesc = "mount 9p filesystem"; +- longdesc = "\ +-Mount the virtio-9p filesystem with the tag C on the +-directory C. +- +-If required, C will be automatically added to the options. +-Any other options required can be passed in the optional C +-parameter." }; +- + { defaults with + name = "list_dm_devices"; added = (1, 11, 15); + style = RStringList (RDevice, "devices"), [], []; +diff --git a/generator/proc_nr.ml b/generator/proc_nr.ml +index 74b95baf7..6b6cb7353 100644 +--- a/generator/proc_nr.ml ++++ b/generator/proc_nr.ml +@@ -295,8 +295,6 @@ let proc_nr = [ + 282, "internal_autosync"; + 283, "is_zero"; + 284, "is_zero_device"; +-285, "list_9p"; +-286, "mount_9p"; + 287, "list_dm_devices"; + 288, "ntfsresize"; + 289, "btrfs_filesystem_resize"; +diff --git a/gobject/Makefile.inc b/gobject/Makefile.inc +index 650f8ddac..c4e735967 100644 +--- a/gobject/Makefile.inc ++++ b/gobject/Makefile.inc +@@ -94,7 +94,6 @@ guestfs_gobject_headers= \ + include/guestfs-gobject/optargs-mksquashfs.h \ + include/guestfs-gobject/optargs-mkswap.h \ + include/guestfs-gobject/optargs-mktemp.h \ +- include/guestfs-gobject/optargs-mount_9p.h \ + include/guestfs-gobject/optargs-mount_local.h \ + include/guestfs-gobject/optargs-ntfsclone_out.h \ + include/guestfs-gobject/optargs-ntfsfix.h \ +@@ -188,7 +187,6 @@ guestfs_gobject_sources= \ + src/optargs-mksquashfs.c \ + src/optargs-mkswap.c \ + src/optargs-mktemp.c \ +- src/optargs-mount_9p.c \ + src/optargs-mount_local.c \ + src/optargs-ntfsclone_out.c \ + src/optargs-ntfsfix.c \ +diff --git a/po/POTFILES b/po/POTFILES +index 29205b6a6..23afe619c 100644 +--- a/po/POTFILES ++++ b/po/POTFILES +@@ -26,7 +26,6 @@ common/utils/stringlists-utils.c + common/utils/utils.c + common/visit/visit.c + common/windows/windows.c +-daemon/9p.c + daemon/acl.c + daemon/augeas.c + daemon/available.c +@@ -264,7 +263,6 @@ gobject/src/optargs-mkfs_btrfs.c + gobject/src/optargs-mksquashfs.c + gobject/src/optargs-mkswap.c + gobject/src/optargs-mktemp.c +-gobject/src/optargs-mount_9p.c + gobject/src/optargs-mount_local.c + gobject/src/optargs-ntfsclone_out.c + gobject/src/optargs-ntfsfix.c +diff --git a/tests/Makefile.am b/tests/Makefile.am +index 919e2f248..e3613fec4 100644 +--- a/tests/Makefile.am ++++ b/tests/Makefile.am +@@ -43,7 +43,6 @@ check-slow: + check-valgrind: + $(MAKE) VG="@VG@" check + +-TESTS += 9p/test-9p.sh + EXTRA_DIST += 9p/test-9p.sh + + SLOW_TESTS += bigdirs/test-big-dirs.pl +-- +2.19.1.3.g30247aa5d201 + diff --git a/SOURCES/0009-RHEL-Create-etc-crypto-policies-back-ends-opensslcnf.patch b/SOURCES/0009-RHEL-Create-etc-crypto-policies-back-ends-opensslcnf.patch deleted file mode 100644 index 67403cc..0000000 --- a/SOURCES/0009-RHEL-Create-etc-crypto-policies-back-ends-opensslcnf.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 94995cf9710042557dd5ca86695be13b5ffa50d4 Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Tue, 29 Jun 2021 15:29:11 +0100 -Subject: [PATCH] RHEL: Create /etc/crypto-policies/back-ends/opensslcnf.config - -https://bugzilla.redhat.com/show_bug.cgi?id=1977214#c13 ---- - appliance/init | 8 ++++++++ - 1 file changed, 8 insertions(+) - -diff --git a/appliance/init b/appliance/init -index 7076821d2..fe6497b4d 100755 ---- a/appliance/init -+++ b/appliance/init -@@ -76,6 +76,14 @@ if ! test -e /etc/mtab; then - ln -s /proc/mounts /etc/mtab - fi - -+# openssl 3 requires /etc/crypto-policies/back-ends/opensslcnf.config -+# to exist, but it is created in a %post script in crypto-policies -+# https://bugzilla.redhat.com/show_bug.cgi?id=1977214#c13 -+if ! test -r /etc/crypto-policies/back-ends/opensslcnf.config && -+ test -f /usr/share/crypto-policies/DEFAULT/opensslcnf.txt; then -+ ln -s /usr/share/crypto-policies/DEFAULT/opensslcnf.txt /etc/crypto-policies/back-ends/opensslcnf.config -+fi -+ - # Static nodes must happen before udev is started. - - # Set up kmod static-nodes (RHBZ#1011907). --- -2.31.1 - diff --git a/SOURCES/0009-RHEL-Disable-unsupported-remote-drive-protocols-RHBZ-962113.patch b/SOURCES/0009-RHEL-Disable-unsupported-remote-drive-protocols-RHBZ-962113.patch new file mode 100644 index 0000000..637d80c --- /dev/null +++ b/SOURCES/0009-RHEL-Disable-unsupported-remote-drive-protocols-RHBZ-962113.patch @@ -0,0 +1,609 @@ +From cb18280888d6ab9e840b79ec93eeecf11127b6e6 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 + (RHBZ#962113). + +This disables support for unsupported remote drive protocols: + + * ftp + * ftps + * http + * https + * tftp + * gluster + * iscsi + * sheepdog + * ssh + +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 ----- + fish/guestfish.pod | 66 ++-------------- + fish/test-add-uri.sh | 32 -------- + generator/actions_core.ml | 50 +------------ + lib/drives.c | 8 ++ + lib/guestfs.pod | 100 ------------------------- + tests/disks/test-qemu-drive-libvirt.sh | 28 ------- + tests/disks/test-qemu-drive.sh | 60 --------------- + 8 files changed, 16 insertions(+), 348 deletions(-) + +diff --git a/docs/guestfs-testing.pod b/docs/guestfs-testing.pod +index f558964bf..8f264ed17 100644 +--- a/docs/guestfs-testing.pod ++++ b/docs/guestfs-testing.pod +@@ -109,26 +109,6 @@ image. To exit, type C. + If you get an error, try enabling debugging (add C<-v> to the command + line). Also make sure that L succeeds. + +-=head2 Try to open a remote guest image with guestfish. +- +-You may also have to disable libvirt by setting this: +- +- export LIBGUESTFS_BACKEND=direct +- +-If you have a disk image available over HTTP/FTP, try to open it. +- +- guestfish --ro -i --format=raw -a http://www.example.com/disk.img +- +-For SSH you will need to make sure that ssh-agent is set up so you +-don't need a password to log in to the remote machine. Then a command +-similar to this should work: +- +- guestfish --ro -i --format=raw \ +- -a ssh://remote.example.com/path/to/disk.img +- +-If you get an error, try enabling debugging (add C<-v> to the command +-line). Also make sure that L succeeds. +- + =head2 Run virt-alignment-scan on all your guests. + + Run L on guests or disk images: +diff --git a/fish/guestfish.pod b/fish/guestfish.pod +index 9f086f110..bb4167b06 100644 +--- a/fish/guestfish.pod ++++ b/fish/guestfish.pod +@@ -131,9 +131,9 @@ To list what is available do: + + =head2 Remote drives + +-Access a remote disk using ssh: ++Access a remote disk using NBD: + +- guestfish -a ssh://example.com/path/to/disk.img ++ guestfish -a nbd://example.com + + =head2 Remote control + +@@ -1134,12 +1134,12 @@ L>. + On the command line, you can use the I<-a> option to add network + block devices using a URI-style format, for example: + +- guestfish -a ssh://root@example.com/disk.img ++ guestfish -a nbd://example.com + + URIs I be used with the L command. The equivalent + command using the API directly is: + +- > add /disk.img protocol:ssh server:tcp:example.com username:root ++ > add /disk.img protocol:nbd server:tcp:example.com + + The possible I<-a URI> formats are described below. + +@@ -1149,40 +1149,6 @@ The possible I<-a URI> formats are described below. + + Add the local disk image (or device) called F. + +-=head2 B<-a ftp://[user@]example.com[:port]/disk.img> +- +-=head2 B<-a ftps://[user@]example.com[:port]/disk.img> +- +-=head2 B<-a http://[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, HTTP or TFTP server. +- +-The equivalent API command would be: +- +- > 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, and may be C. +- +-The equivalent API command would be: +- +- > add volname/image protocol:gluster server:tcp:example.com +- +-=head2 B<-a iscsi://example.com[:port]/target-iqn-name[/lun]> +- +-Add a disk located on an iSCSI server. +- +-The equivalent API command would be: +- +- > add target-iqn-name/lun protocol:iscsi server:tcp:example.com +- + =head2 B<-a nbd://example.com[:port]> + + =head2 B<-a nbd://example.com[:port]/exportname> +@@ -1217,35 +1183,13 @@ The equivalent API command would be: + + > 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: +- +- > add volume protocol:sheepdog [server:tcp:example.com] +- +-=head2 B<-a ssh://[user@]example.com[:port]/disk.img> +- +-Add a disk image located on a remote server, accessed using the Secure +-Shell (ssh) SFTP protocol. SFTP is supported out of the box by all +-major SSH servers. +- +-The equivalent API command would be: +- +- > add /disk protocol:ssh server:tcp:example.com [username:user] +- + Note that the URIs follow the syntax of + L: in particular, there + are restrictions on the allowed characters for the various components + of the URI. Characters such as C<:>, C<@>, and C B be + percent-encoded: + +- $ guestfish -a ssh://user:pass%40word@example.com/disk.img ++ $ guestfish -a rbd://user:pass%40word@example.com[:port]/pool/disk + + In this case, the password is C. + +diff --git a/fish/test-add-uri.sh b/fish/test-add-uri.sh +index 21d424984..ddabeb639 100755 +--- a/fish/test-add-uri.sh ++++ b/fish/test-add-uri.sh +@@ -40,14 +40,6 @@ function fail () + $VG guestfish -x -a file://$abs_builddir/test-add-uri.img test-add-uri.out 2>&1 + grep -sq 'add_drive ".*/test-add-uri.img"' test-add-uri.out || fail + +-# curl +-$VG guestfish -x -a ftp://user@example.com/disk.img 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 +- +-# gluster +-$VG guestfish -x -a gluster://example.com/disk test-add-uri.out 2>&1 +-grep -sq 'add_drive "disk" "protocol:gluster" "server:tcp:example.com"' test-add-uri.out || fail +- + # NBD + $VG guestfish -x -a nbd://example.com test-add-uri.out 2>&1 + 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 + $VG guestfish -x -a rbd:///pool/disk test-add-uri.out 2>&1 + grep -sq 'add_drive "pool/disk" "protocol:rbd"' test-add-uri.out || fail + +-# sheepdog +-$VG guestfish -x -a sheepdog:///volume/image 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 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 +-$VG guestfish -x -a ssh://example.com/disk.img test-add-uri.out 2>&1 +-grep -sq 'add_drive "/disk.img" "protocol:ssh" "server:tcp:example.com"' test-add-uri.out || fail +- +-$VG guestfish -x -a ssh://user@example.com/disk.img test-add-uri.out 2>&1 +-grep -sq 'add_drive "/disk.img" "protocol:ssh" "server:tcp:example.com" "username:user"' test-add-uri.out || fail +- +-$VG guestfish -x -a ssh://user@example.com:2000/disk.img test-add-uri.out 2>&1 +-grep -sq 'add_drive "/disk.img" "protocol:ssh" "server:tcp:example.com:2000" "username:user"' test-add-uri.out || fail +- +-# iSCSI +-$VG guestfish -x -a iscsi://example.com/iqn.2015-12.com.libguestfs:test1/0 test-add-uri.out 2>&1 +-grep -sq 'add_drive "iqn.2015-12.com.libguestfs:test1/0" "protocol:iscsi" "server:tcp:example.com"' test-add-uri.out || fail +- +-$VG guestfish -x -a iscsi://user:password@example.com/iqn.2015-12.com.libguestfs:test2/0 test-add-uri.out 2>&1 +-grep -sq 'add_drive "iqn.2015-12.com.libguestfs:test2/0" "protocol:iscsi" "server:tcp:example.com" "username:user" "secret:password"' test-add-uri.out || fail +- + rm test-add-uri.out + rm test-add-uri.img +diff --git a/generator/actions_core.ml b/generator/actions_core.ml +index 05320fcd3..155d739fe 100644 +--- a/generator/actions_core.ml ++++ b/generator/actions_core.ml +@@ -297,29 +297,6 @@ F is interpreted as a local file or device. + This is the default if the optional protocol parameter + is omitted. + +-=item C +- +-Connect to a remote FTP, HTTP or TFTP server. +-The C parameter must also be supplied - see below. +- +-See also: L +- +-=item C +- +-Connect to the GlusterFS server. +-The C parameter must also be supplied - see below. +- +-See also: L +- +-=item C +- +-Connect to the iSCSI server. +-The C parameter must also be supplied - see below. +-The C parameter may be supplied. See below. +-The C parameter may be supplied. See below. +- +-See also: L. +- + =item C + + Connect to the Network Block Device server. +@@ -336,22 +313,6 @@ The C parameter may be supplied. See below. + + See also: L. + +-=item C +- +-Connect to the Sheepdog server. +-The C parameter may also be supplied - see below. +- +-See also: L. +- +-=item C +- +-Connect to the Secure Shell (ssh) server. +- +-The C parameter must be supplied. +-The C parameter may be supplied. See below. +- +-See also: L. +- + =back + + =item C +@@ -362,13 +323,8 @@ is a list of server(s). + Protocol Number of servers required + -------- -------------------------- + file List must be empty or param not used at all +- ftp|ftps|http|https|tftp Exactly one +- gluster Exactly one +- iscsi Exactly one + nbd Exactly one + rbd Zero or more +- sheepdog Zero or more +- ssh Exactly one + + Each list element is a string specifying a server. The string must be + in one of the following formats: +@@ -384,10 +340,10 @@ for the protocol is used (see F). + + =item C + +-For the C, C, C, C, C, C, C +-and C protocols, this specifies the remote username. ++For the C ++protocol, this specifies the remote username. + +-If not given, then the local username is used for C, and no authentication ++If not given, then no authentication + is attempted for ceph. But note this sometimes may give unexpected results, for + 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 46af66db4..c81ded5d7 100644 +--- a/lib/drives.c ++++ b/lib/drives.c +@@ -168,6 +168,7 @@ create_drive_non_file (guestfs_h *g, + return drv; + } + ++#if 0 /* DISABLED IN RHEL 8 */ + static struct drive * + create_drive_curl (guestfs_h *g, + const struct drive_create_data *data) +@@ -226,6 +227,7 @@ create_drive_gluster (guestfs_h *g, + + return create_drive_non_file (g, data); + } ++#endif /* DISABLED IN RHEL 8 */ + + static int + nbd_port (void) +@@ -294,6 +296,7 @@ create_drive_rbd (guestfs_h *g, + return create_drive_non_file (g, data); + } + ++#if 0 /* DISABLED IN RHEL 8 */ + static struct drive * + create_drive_sheepdog (guestfs_h *g, + const struct drive_create_data *data) +@@ -394,6 +397,7 @@ create_drive_iscsi (guestfs_h *g, + + return create_drive_non_file (g, data); + } ++#endif /* DISABLED IN RHEL 8 */ + + /** + * Create the special F drive. +@@ -856,6 +860,7 @@ guestfs_impl_add_drive_opts (guestfs_h *g, const char *filename, + drv = create_drive_file (g, &data); + } + } ++#if 0 /* DISABLED IN RHEL 8 */ + else if (STREQ (protocol, "ftp")) { + data.protocol = drive_protocol_ftp; + drv = create_drive_curl (g, &data); +@@ -880,6 +885,7 @@ guestfs_impl_add_drive_opts (guestfs_h *g, const char *filename, + data.protocol = drive_protocol_iscsi; + drv = create_drive_iscsi (g, &data); + } ++#endif /* DISABLED IN RHEL 8 */ + else if (STREQ (protocol, "nbd")) { + data.protocol = drive_protocol_nbd; + drv = create_drive_nbd (g, &data); +@@ -888,6 +894,7 @@ guestfs_impl_add_drive_opts (guestfs_h *g, const char *filename, + data.protocol = drive_protocol_rbd; + drv = create_drive_rbd (g, &data); + } ++#if 0 /* DISABLED IN RHEL 8 */ + else if (STREQ (protocol, "sheepdog")) { + data.protocol = drive_protocol_sheepdog; + drv = create_drive_sheepdog (g, &data); +@@ -900,6 +907,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 { + error (g, _("unknown protocol ‘%s’"), protocol); + drv = NULL; /*FALLTHROUGH*/ +diff --git a/lib/guestfs.pod b/lib/guestfs.pod +index ff58aa0bb..1af00f1bb 100644 +--- a/lib/guestfs.pod ++++ b/lib/guestfs.pod +@@ -715,70 +715,6 @@ servers. The server string is documented in + L. The C and C parameters are + also optional, and if not given, then no authentication will be used. + +-=head3 FTP, HTTP AND TFTP +- +-Libguestfs can access remote disks over FTP, FTPS, HTTP, HTTPS +-or TFTP protocols. +- +-To do this, set the optional C and C parameters of +-L like this: +- +- char **servers = { "www.example.org", NULL }; +- guestfs_add_drive_opts (g, "/disk.img", +- GUESTFS_ADD_DRIVE_OPTS_FORMAT, "raw", +- GUESTFS_ADD_DRIVE_OPTS_PROTOCOL, "http", +- GUESTFS_ADD_DRIVE_OPTS_SERVER, servers, +- -1); +- +-The C can be one of C<"ftp">, C<"ftps">, C<"http">, +-C<"https"> or C<"tftp">. +- +-C (the C parameter) is a list which must have a +-single element. The single element is a string defining the web, +-FTP or TFTP server. The format of this string is documented in +-L. +- +-=head3 GLUSTER +- +-Libguestfs can access Gluster disks. +- +-To do this, set the optional C and C parameters of +-L 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 (the C 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. +- +-Note that gluster usually requires the client process (ie. libguestfs) +-to run as B and will give unfathomable errors if it is not +-(eg. "No data available"). +- +-=head3 ISCSI +- +-Libguestfs can access iSCSI disks remotely. +- +-To do this, set the optional C and C parameters like +-this: +- +- char **server = { "iscsi.example.org:3000", NULL }; +- guestfs_add_drive_opts (g, "target-iqn-name/lun", +- GUESTFS_ADD_DRIVE_OPTS_FORMAT, "raw", +- GUESTFS_ADD_DRIVE_OPTS_PROTOCOL, "iscsi", +- GUESTFS_ADD_DRIVE_OPTS_SERVER, server, +- -1); +- +-The C parameter is a list which must have a single element. +-The single element is a string defining the iSCSI server. The format +-of this string is documented in L. +- + =head3 NETWORK BLOCK DEVICE + + Libguestfs can access Network Block Device (NBD) disks remotely. +@@ -841,42 +777,6 @@ L + + =back + +-=head3 SHEEPDOG +- +-Libguestfs can access Sheepdog disks. +- +-To do this, set the optional C and C parameters of +-L 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 may be zero or more server addresses +-(C<"hostname:port">). The format of the server strings is documented +-in L. +- +-=head3 SSH +- +-Libguestfs can access disks over a Secure Shell (SSH) connection. +- +-To do this, set the C and C and (optionally) +-C parameters of L like this: +- +- char **server = { "remote.example.com", NULL }; +- guestfs_add_drive_opts (g, "/path/to/disk.img", +- GUESTFS_ADD_DRIVE_OPTS_FORMAT, "raw", +- GUESTFS_ADD_DRIVE_OPTS_PROTOCOL, "ssh", +- GUESTFS_ADD_DRIVE_OPTS_SERVER, server, +- GUESTFS_ADD_DRIVE_OPTS_USERNAME, "remoteuser", +- -1); +- +-The format of the server string is documented in +-L. +- + =head2 INSPECTION + + 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 +index 595a95a5e..b49534c94 100755 +--- a/tests/disks/test-qemu-drive-libvirt.sh ++++ b/tests/disks/test-qemu-drive-libvirt.sh +@@ -65,34 +65,6 @@ check_output + grep -sq -- '-drive file=rbd:abc-def/ghi-jkl:auth_supported=none,' "$DEBUG_QEMU_FILE" || fail ceph2 + 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. +- +-$guestfish -d iscsi run ||: +-check_output +-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" +- +-# 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 ||: +diff --git a/tests/disks/test-qemu-drive.sh b/tests/disks/test-qemu-drive.sh +index 12937fb30..b3e4f9903 100755 +--- a/tests/disks/test-qemu-drive.sh ++++ b/tests/disks/test-qemu-drive.sh +@@ -62,45 +62,6 @@ check_output + grep -sq -- '-drive file=rbd:abc-def/ghi-jkl:auth_supported=none,' "$DEBUG_QEMU_FILE" || fail + rm "$DEBUG_QEMU_FILE" + +-# HTTP. +- +-guestfish < +Date: Fri, 19 Sep 2014 13:38:20 +0100 +Subject: [PATCH] RHEL: Remove User-Mode Linux (RHBZ#1144197). + +This isn't supported in RHEL. +--- + lib/launch-uml.c | 13 +++++++++++++ + 1 file changed, 13 insertions(+) + +diff --git a/lib/launch-uml.c b/lib/launch-uml.c +index 5aec50a57..8b9fcd770 100644 +--- a/lib/launch-uml.c ++++ b/lib/launch-uml.c +@@ -44,7 +44,9 @@ struct backend_uml_data { + char umid[UML_UMID_LEN+1]; /* umid=<...> unique ID. */ + }; + ++#if 0 + static void print_vmlinux_command_line (guestfs_h *g, char **argv); ++#endif + + /* Run uml_mkcow to create a COW overlay. */ + static char * +@@ -81,6 +83,7 @@ create_cow_overlay_uml (guestfs_h *g, void *datav, struct drive *drv) + return make_cow_overlay (g, drv->src.u.path); + } + ++#if 0 + /* Test for features which are not supported by the UML backend. + * Possibly some of these should just be warnings, not errors. + */ +@@ -133,10 +136,17 @@ uml_supported (guestfs_h *g) + + return true; + } ++#endif + + static int + launch_uml (guestfs_h *g, void *datav, const char *arg) + { ++ error (g, ++ "launch: In RHEL, only the 'libvirt' or 'direct' method is supported.\n" ++ "In particular, User-Mode Linux (UML) is not supported."); ++ return -1; ++ ++#if 0 + struct backend_uml_data *data = datav; + CLEANUP_FREE_STRINGSBUF DECLARE_STRINGSBUF (cmdline); + int console_sock = -1, daemon_sock = -1; +@@ -496,8 +506,10 @@ launch_uml (guestfs_h *g, void *datav, const char *arg) + } + g->state = CONFIG; + return -1; ++#endif + } + ++#if 0 + /* This is called from the forked subprocess just before vmlinux runs, + * so it can just print the message straight to stderr, where it will + * be picked up and funnelled through the usual appliance event API. +@@ -527,6 +539,7 @@ print_vmlinux_command_line (guestfs_h *g, char **argv) + + fputc ('\n', stderr); + } ++#endif + + static int + shutdown_uml (guestfs_h *g, void *datav, int check_for_errors) +-- +2.19.1.3.g30247aa5d201 + diff --git a/SOURCES/0010-daemon-inspection-Add-support-for-Kylin-RHBZ-1995391.patch b/SOURCES/0010-daemon-inspection-Add-support-for-Kylin-RHBZ-1995391.patch deleted file mode 100644 index 836726a..0000000 --- a/SOURCES/0010-daemon-inspection-Add-support-for-Kylin-RHBZ-1995391.patch +++ /dev/null @@ -1,100 +0,0 @@ -From ab80c515bfd527e1609d4e5ffd7c6b18d5a202dc Mon Sep 17 00:00:00 2001 -From: Laszlo Ersek -Date: Wed, 13 Oct 2021 18:30:23 +0200 -Subject: [PATCH] daemon: inspection: Add support for Kylin (RHBZ#1995391). - -Similar-to: cd08039d2427b584237265237c713d8cf46536a0 -Signed-off-by: Laszlo Ersek -Message-Id: <20211013163023.21786-1-lersek@redhat.com> -Acked-by: Richard W.M. Jones -(cherry picked from commit 305b02e7e74afc3777b2291783cd7634fb76ecaf) ---- - daemon/inspect_fs.ml | 2 ++ - daemon/inspect_fs_unix.ml | 1 + - daemon/inspect_types.ml | 2 ++ - daemon/inspect_types.mli | 1 + - generator/actions_inspection.ml | 4 ++++ - 5 files changed, 10 insertions(+) - -diff --git a/daemon/inspect_fs.ml b/daemon/inspect_fs.ml -index 02b5a0470..77f0f6aea 100644 ---- a/daemon/inspect_fs.ml -+++ b/daemon/inspect_fs.ml -@@ -275,6 +275,7 @@ and check_package_format { distro } = - Some PACKAGE_FORMAT_RPM - | Some DISTRO_DEBIAN - | Some DISTRO_KALI_LINUX -+ | Some DISTRO_KYLIN (* supposedly another Ubuntu derivative *) - | Some DISTRO_LINUX_MINT - | Some DISTRO_UBUNTU -> - Some PACKAGE_FORMAT_DEB -@@ -345,6 +346,7 @@ and check_package_management { distro; version } = - | Some DISTRO_ALTLINUX - | Some DISTRO_DEBIAN - | Some DISTRO_KALI_LINUX -+ | Some DISTRO_KYLIN (* supposedly another Ubuntu derivative *) - | Some DISTRO_LINUX_MINT - | Some DISTRO_UBUNTU -> - Some PACKAGE_MANAGEMENT_APT -diff --git a/daemon/inspect_fs_unix.ml b/daemon/inspect_fs_unix.ml -index 652bacc0f..7f6eb92e9 100644 ---- a/daemon/inspect_fs_unix.ml -+++ b/daemon/inspect_fs_unix.ml -@@ -146,6 +146,7 @@ and distro_of_os_release_id = function - | "frugalware" -> Some DISTRO_FRUGALWARE - | "gentoo" -> Some DISTRO_GENTOO - | "kali" -> Some DISTRO_KALI_LINUX -+ | "kylin" -> Some DISTRO_KYLIN - | "mageia" -> Some DISTRO_MAGEIA - | "neokylin" -> Some DISTRO_NEOKYLIN - | "openmandriva" -> Some DISTRO_OPENMANDRIVA -diff --git a/daemon/inspect_types.ml b/daemon/inspect_types.ml -index 18e410ce0..e2bc7165c 100644 ---- a/daemon/inspect_types.ml -+++ b/daemon/inspect_types.ml -@@ -79,6 +79,7 @@ and distro = - | DISTRO_FRUGALWARE - | DISTRO_GENTOO - | DISTRO_KALI_LINUX -+ | DISTRO_KYLIN - | DISTRO_LINUX_MINT - | DISTRO_MAGEIA - | DISTRO_MANDRIVA -@@ -211,6 +212,7 @@ and string_of_distro = function - | DISTRO_FRUGALWARE -> "frugalware" - | DISTRO_GENTOO -> "gentoo" - | DISTRO_KALI_LINUX -> "kalilinux" -+ | DISTRO_KYLIN -> "kylin" - | DISTRO_LINUX_MINT -> "linuxmint" - | DISTRO_MAGEIA -> "mageia" - | DISTRO_MANDRIVA -> "mandriva" -diff --git a/daemon/inspect_types.mli b/daemon/inspect_types.mli -index d12f7a61a..43c79818f 100644 ---- a/daemon/inspect_types.mli -+++ b/daemon/inspect_types.mli -@@ -86,6 +86,7 @@ and distro = - | DISTRO_FRUGALWARE - | DISTRO_GENTOO - | DISTRO_KALI_LINUX -+ | DISTRO_KYLIN - | DISTRO_LINUX_MINT - | DISTRO_MAGEIA - | DISTRO_MANDRIVA -diff --git a/generator/actions_inspection.ml b/generator/actions_inspection.ml -index 690afd460..0c6d39b43 100644 ---- a/generator/actions_inspection.ml -+++ b/generator/actions_inspection.ml -@@ -214,6 +214,10 @@ Gentoo. - - Kali Linux. - -+=item \"kylin\" -+ -+Kylin. -+ - =item \"linuxmint\" - - Linux Mint. --- -2.31.1 - diff --git a/SOURCES/0011-RHEL-Reject-use-of-libguestfs-winsupport-features-except-for-virt-tools-RHBZ-1240276.patch b/SOURCES/0011-RHEL-Reject-use-of-libguestfs-winsupport-features-except-for-virt-tools-RHBZ-1240276.patch new file mode 100644 index 0000000..9cb32f6 --- /dev/null +++ b/SOURCES/0011-RHEL-Reject-use-of-libguestfs-winsupport-features-except-for-virt-tools-RHBZ-1240276.patch @@ -0,0 +1,69 @@ +From 6372b9cd8bb2d8a183fc6d2ca4688047a0474c2f 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 + virt-* tools (RHBZ#1240276). + +Fix the tests: it doesn't let us use guestfish for arbitrary Windows +edits. +--- + generator/c.ml | 16 ++++++++++++++++ + test-data/phony-guests/make-windows-img.sh | 1 + + tests/charsets/test-charset-fidelity.c | 2 ++ + 3 files changed, 19 insertions(+) + +diff --git a/generator/c.ml b/generator/c.ml +index ea69abf76..56ee38aa4 100644 +--- a/generator/c.ml ++++ b/generator/c.ml +@@ -1846,6 +1846,22 @@ and generate_client_actions actions () = + check_args_validity c_name style; + trace_call name c_name style; + ++ (* RHEL 8 *) ++ if name = "mount" || name = "mount_ro" || name = "mount_options" || ++ name = "mount_vfs" then ( ++ pr " if (g->program && !STRPREFIX (g->program, \"virt-\")) {\n"; ++ pr " CLEANUP_FREE char *vfs_type = guestfs_vfs_type (g, mountable);\n"; ++ pr " if (vfs_type && STREQ (vfs_type, \"ntfs\")) {\n"; ++ pr " error (g, \"mount: unsupported filesystem type\");\n"; ++ pr " if (trace_flag)\n"; ++ pr " guestfs_int_trace (g, \"%%s = %%s (error)\",\n"; ++ pr " \"%s\", \"-1\");\n" name; ++ pr " return %s;\n" (string_of_errcode errcode); ++ pr " }\n"; ++ pr " }\n"; ++ pr "\n"; ++ ); ++ + (* Calculate the total size of all FileIn arguments to pass + * as a progress bar hint. + *) +diff --git a/test-data/phony-guests/make-windows-img.sh b/test-data/phony-guests/make-windows-img.sh +index 30908a918..73cf5144e 100755 +--- a/test-data/phony-guests/make-windows-img.sh ++++ b/test-data/phony-guests/make-windows-img.sh +@@ -37,6 +37,7 @@ fi + + # Create a disk image. + guestfish < -Date: Mon, 22 Nov 2021 15:09:41 +0000 -Subject: [PATCH] xfs: Document lazy-counters setting cannot be changed in XFS - version 5 - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2024022 -(cherry picked from commit e7f72ab146b9c2aaee92a600a1fcbefb0202d41c) ---- - generator/actions_core.ml | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/generator/actions_core.ml b/generator/actions_core.ml -index 91dce1db5..155d739fe 100644 ---- a/generator/actions_core.ml -+++ b/generator/actions_core.ml -@@ -7600,7 +7600,10 @@ can modify parameters. - - Some of the parameters of a mounted filesystem can be examined - and modified using the C and --C calls." }; -+C calls. -+ -+Beginning with XFS version 5, it is no longer possible to modify -+the lazy-counters setting (ie. C parameter has no effect)." }; - - { defaults with - name = "xfs_repair"; added = (1, 19, 36); --- -2.31.1 - diff --git a/SOURCES/0012-RHEL-Create-etc-crypto-policies-back-ends-opensslcnf.config.patch b/SOURCES/0012-RHEL-Create-etc-crypto-policies-back-ends-opensslcnf.config.patch new file mode 100644 index 0000000..8cef009 --- /dev/null +++ b/SOURCES/0012-RHEL-Create-etc-crypto-policies-back-ends-opensslcnf.config.patch @@ -0,0 +1,32 @@ +From c50bb81e40b36a74c15f9bc515a2f04a1eb00673 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Tue, 29 Jun 2021 15:29:11 +0100 +Subject: [PATCH] RHEL: Create /etc/crypto-policies/back-ends/opensslcnf.config + +https://bugzilla.redhat.com/show_bug.cgi?id=1977214#c13 +--- + appliance/init | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/appliance/init b/appliance/init +index 7076821d2..fe6497b4d 100755 +--- a/appliance/init ++++ b/appliance/init +@@ -76,6 +76,14 @@ if ! test -e /etc/mtab; then + ln -s /proc/mounts /etc/mtab + fi + ++# openssl 3 requires /etc/crypto-policies/back-ends/opensslcnf.config ++# to exist, but it is created in a %post script in crypto-policies ++# https://bugzilla.redhat.com/show_bug.cgi?id=1977214#c13 ++if ! test -r /etc/crypto-policies/back-ends/opensslcnf.config && ++ test -f /usr/share/crypto-policies/DEFAULT/opensslcnf.txt; then ++ ln -s /usr/share/crypto-policies/DEFAULT/opensslcnf.txt /etc/crypto-policies/back-ends/opensslcnf.config ++fi ++ + # Static nodes must happen before udev is started. + + # Set up kmod static-nodes (RHBZ#1011907). +-- +2.19.1.3.g30247aa5d201 + diff --git a/SOURCES/copy-patches.sh b/SOURCES/copy-patches.sh index 46b1f33..21830aa 100755 --- a/SOURCES/copy-patches.sh +++ b/SOURCES/copy-patches.sh @@ -7,24 +7,29 @@ set -e # it like this: # ./copy-patches.sh +project=libguestfs rhel_version=9.0.0 # Check we're in the right directory. -if [ ! -f libguestfs.spec ]; then - echo "$0: run this from the directory containing 'libguestfs.spec'" +if [ ! -f $project.spec ]; then + echo "$0: run this from the directory containing '$project.spec'" exit 1 fi -git_checkout=$HOME/d/libguestfs-rhel-$rhel_version +case `id -un` in + rjones) git_checkout=$HOME/d/$project-rhel-$rhel_version ;; + lacos) git_checkout=$HOME/src/v2v/$project ;; + *) git_checkout=$HOME/d/$project-rhel-$rhel_version ;; +esac if [ ! -d $git_checkout ]; then echo "$0: $git_checkout does not exist" echo "This script is only for use by the maintainer when preparing a" - echo "libguestfs release on RHEL." + echo "$project release on RHEL." exit 1 fi -# Get the base version of libguestfs. -version=`grep '^Version:' libguestfs.spec | awk '{print $2}'` +# Get the base version of the project. +version=`grep '^Version:' $project.spec | awk '{print $2}'` tag="v$version" # Remove any existing patches. @@ -32,7 +37,7 @@ git rm -f [0-9]*.patch ||: rm -f [0-9]*.patch # Get the patches. -(cd $git_checkout; rm -f [0-9]*.patch; git format-patch -N --submodule=diff $tag) +(cd $git_checkout; rm -f [0-9]*.patch; git -c core.abbrev=9 format-patch -O/dev/null -N --submodule=diff $tag) mv $git_checkout/[0-9]*.patch . # Remove any not to be applied. @@ -43,7 +48,7 @@ git add [0-9]*.patch # Print out the patch lines. echo -echo "--- Copy the following text into libguestfs.spec file" +echo "--- Copy the following text into $project.spec file" echo echo "# Patches." diff --git a/SOURCES/libguestfs-1.46.0.tar.gz.sig b/SOURCES/libguestfs-1.46.0.tar.gz.sig deleted file mode 100644 index 25134a9..0000000 --- a/SOURCES/libguestfs-1.46.0.tar.gz.sig +++ /dev/null @@ -1,17 +0,0 @@ ------BEGIN PGP SIGNATURE----- - -iQJFBAABCAAvFiEE93dPsa0HSn6Mh2fqkXOPc+G3aKAFAmFMh4QRHHJpY2hAYW5u -ZXhpYS5vcmcACgkQkXOPc+G3aKBDBBAAuXwIyIs2XfkDX9W/MvNrX37pVRJugEdi -HHpw+4dn9rNSzGYBEAXJ7qTAXt6ZvNG0x/YcPrbWIuoLGtEa5AVs8tPsObMpdeKw -lYxk4GZhKwWN20RfJalolKmkes1LAfnu5+YTOUj+hPxk++u9IBs5CDTVemwP+XaN -eWyCukH9KOl/DxgsRNvjurvuGD0hAjCfKEcfVU5tMDa4e0NtCJc3G9QMBQn5gEZ/ -plk1D8CBa+93ZNXapKji+8cqgcnhkl8y9tujaLIdaNHQ2Y0ptLGQWNIozWrE5iF0 -9upC1kT3hJjx9+uF4dUv7kzU8By1x4AHUh9iQsVnfk6Kb+tpQDRrhF0o/dZJ0tib -Q8ADToiGEaXecMun1vsXRHOdaMSn/Nqrvkn8DRJTxqLFlE3oZLOigxxPdWwmdCtX -pe4ONpx9LrTtmROfDAKv8awNFLRXzbmUDOhY7tn/JTMKugdeOJkKBy5VvLrkM40Z -HtHsntt/B/J1FoK5TLDxcNrQo5u7MfPmnhn09AVf9OaItrh1wRCjFYCtcOt/Pxqw -xGyqsGJ32Es5r1QnY/hIjl/kkxkG6rfqRYBoU/QThmgvYxn+lM58SUOunM9aC+Ub -3taY77ge+M7ylNCx7+gJnwIF9ZltvJJ3zZ+LJ1PzcfL2ns6d/Om8/icrESS2fvFD -3w/keerUf9U= -=NsMY ------END PGP SIGNATURE----- diff --git a/SOURCES/libguestfs-1.46.1.tar.gz.sig b/SOURCES/libguestfs-1.46.1.tar.gz.sig new file mode 100644 index 0000000..6f2b2df --- /dev/null +++ b/SOURCES/libguestfs-1.46.1.tar.gz.sig @@ -0,0 +1,17 @@ +-----BEGIN PGP SIGNATURE----- + +iQJFBAABCAAvFiEE93dPsa0HSn6Mh2fqkXOPc+G3aKAFAmGyO9wRHHJpY2hAYW5u +ZXhpYS5vcmcACgkQkXOPc+G3aKBl+RAAoxqpUWTEiXxwyWWhW0IotI5xyEdyrkL6 ++po1pqtEXzcFeCHX+lB86C9nkolmFEDfz1wnlNVbz1La35Zdkw1gCD96Fx3/s4xl +s7pZ9073FauSo4IjseWAPcFj3SF4aEeK8xvpOQaq+rcA3Zmg5vZJCqW0xnEGqeCO +UTgmKPgmg2NJaUnUq7TRI8AxNDElD+MetV+olywjJG2QETSFP65ZwdppT8fUZvl/ +W4s38gvHAGLQgKZL7MudQXTDUkGD7rThr3IKGQP8UJGr+IpR4MxxkkDAndeb37ps +6b+s3popuJRwXaSw7gPPGut5jfdJNBJ5KIYqxxWu+fmRTkXD+qoDR1AuJLZlCO7E +Yp9X9rTZh55wZk8NetG0XNDkyoBqJoBkoL3h5wvHOTOoYX4KfjL5YxHbjuhMJ3O1 +O0JiwtrqmkQ3c4HzmMJEBctj3ZuhdL5d+MJH7VtTjKy95FJlmEGPRa1DYoaeW6lv +tVE/zEv6dsy1dpzVgMM/lugTTs2NRwNhLo843OpVCQjZfDk0fEOcWo+0sW0tca05 +EdnocDI8bAW98dLAla6RJwMvBaD6Y/RtutMDO9AY7hVFDeIc1bYBHPtvDSYwd9ul +hB849Q3dtdEeVk3+5rsxZllXowltnfe4KxvkII4NHJVHp5uZZruHHF4pNvKmAFD1 +B9VPVX4vIgw= +=UAq6 +-----END PGP SIGNATURE----- diff --git a/SPECS/libguestfs.spec b/SPECS/libguestfs.spec index 9e2d52f..0798b31 100644 --- a/SPECS/libguestfs.spec +++ b/SPECS/libguestfs.spec @@ -56,8 +56,8 @@ Summary: Access and modify virtual machine disk images Name: libguestfs Epoch: 1 -Version: 1.46.0 -Release: 5%{?dist} +Version: 1.46.1 +Release: 2%{?dist} License: LGPLv2+ # Build only for architectures that have a kernel @@ -95,17 +95,18 @@ Source8: copy-patches.sh # https://github.com/libguestfs/libguestfs/commits/rhel-9.0.0 # Patches. -Patch0001: 0001-Go-bindings-fix-C-array-of-strings-char-allocation.patch -Patch0002: 0002-daemon-inspect_fs_unix-recognize-modern-Pardus-GNU-L.patch -Patch0003: 0003-m4-guestfs-ocaml.m4-Fix-deprecated-warning-format.patch -Patch0004: 0004-RHEL-Remove-libguestfs-live-RHBZ-798980.patch -Patch0005: 0005-RHEL-Remove-9p-APIs-from-RHEL-RHBZ-921710.patch -Patch0006: 0006-RHEL-Disable-unsupported-remote-drive-protocols-RHBZ.patch -Patch0007: 0007-RHEL-Remove-User-Mode-Linux-RHBZ-1144197.patch -Patch0008: 0008-RHEL-Reject-use-of-libguestfs-winsupport-features-ex.patch -Patch0009: 0009-RHEL-Create-etc-crypto-policies-back-ends-opensslcnf.patch -Patch0010: 0010-daemon-inspection-Add-support-for-Kylin-RHBZ-1995391.patch -Patch0011: 0011-xfs-Document-lazy-counters-setting-cannot-be-changed.patch +Patch0001: 0001-daemon-inspect_fs_unix-recognize-modern-Pardus-GNU-Linux-releases.patch +Patch0002: 0002-daemon-inspection-Add-support-for-Kylin-RHBZ-1995391.patch +Patch0003: 0003-Add-detection-support-for-Rocky-Linux-CentOS-RHEL-like.patch +Patch0004: 0004-launch-libvirt-place-our-virtio-net-pci-device-in-slot-0x1e.patch +Patch0005: 0005-lib-extract-NETWORK_ADDRESS-and-NETWORK_PREFIX-as-macros.patch +Patch0006: 0006-launch-libvirt-add-virtio-net-via-the-standard-interface-element.patch +Patch0007: 0007-RHEL-Remove-libguestfs-live-RHBZ-798980.patch +Patch0008: 0008-RHEL-Remove-9p-APIs-from-RHEL-RHBZ-921710.patch +Patch0009: 0009-RHEL-Disable-unsupported-remote-drive-protocols-RHBZ-962113.patch +Patch0010: 0010-RHEL-Remove-User-Mode-Linux-RHBZ-1144197.patch +Patch0011: 0011-RHEL-Reject-use-of-libguestfs-winsupport-features-except-for-virt-tools-RHBZ-1240276.patch +Patch0012: 0012-RHEL-Create-etc-crypto-policies-back-ends-opensslcnf.config.patch %if 0%{patches_touch_autotools} BuildRequires: autoconf, automake, libtool, gettext-devel @@ -1145,19 +1146,23 @@ rm ocaml/html/.gitignore %changelog -* Tue Nov 23 2021 Richard W.M. Jones - 1:1.46.0-5 +* Thu Dec 23 2021 Laszlo Ersek - 1:1.46.1-2 +- Add detection support for Rocky Linux + resolves: rhbz#2030709 +- Resolve conflict between manual and libvirt-assigned PCI addresses + resolves: rhbz#2034160 + +* Thu Dec 09 2021 Richard W.M. Jones - 1:1.46.1-1 +- Rebase to new stable branch version 1.46.1 + resolves: rhbz#2011711 - Add --enable-appliance-format-auto - Add support for Kylin - Document lazy-counters setting cannot be changed in XFS version 5 resolves: rhbz#2025944, rhbz#1995391, rhbz#2024022 - -* Fri Oct 29 2021 Richard W.M. Jones - 1:1.46.0-4 - Require libvirt-daemon-driver-storage-core resolves: rhbz#2018358 - -* Fri Oct 08 2021 Richard W.M. Jones - 1:1.46.0-1 -- Rebase to new stable branch version 1.46.0 - resolves: rhbz#2011711 +- Fix usage of strerror_r which caused corrupted error messages + resolves: rhbz#2030396 * Tue Sep 14 2021 Richard W.M. Jones - 1:1.45.6-14 - Specify backing format for qemu 6.1