From f8febbf14310283e454f123ec9596a0b62aa4d13 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Fri, 8 Oct 2021 12:58:48 +0100 Subject: [PATCH] Rebase to new stable branch version 1.46.0 resolves: rhbz#2011711 --- ...x-C-array-of-strings-char-allocation.patch | 153 ++++++++++++++++++ 0001-build-Don-t-use-non-POSIX-tests.patch | 38 ----- ...s_unix-recognize-modern-Pardus-GNU-L.patch | 39 +++++ ...k-fields-when-creating-Python-struct.patch | 86 ---------- ...-IBM850-iconv-converter-for-syslinux.patch | 34 ---- ...aml.m4-Fix-deprecated-warning-format.patch | 33 ++++ ...L-Remove-libguestfs-live-RHBZ-798980.patch | 2 +- 0004-lib-direct-Remove-use-of-sga.patch | 82 ---------- ...Remove-9p-APIs-from-RHEL-RHBZ-921710.patch | 6 +- ...backing-format-for-qemu-img-create-b.patch | 49 ------ ...upported-remote-drive-protocols-RHBZ.patch | 4 +- ...-Remove-User-Mode-Linux-RHBZ-1144197.patch | 2 +- ...of-libguestfs-winsupport-features-ex.patch | 2 +- ...crypto-policies-back-ends-opensslcnf.patch | 12 +- libguestfs.spec | 32 ++-- sources | 4 +- 16 files changed, 258 insertions(+), 320 deletions(-) create mode 100644 0001-Go-bindings-fix-C-array-of-strings-char-allocation.patch delete mode 100644 0001-build-Don-t-use-non-POSIX-tests.patch create mode 100644 0002-daemon-inspect_fs_unix-recognize-modern-Pardus-GNU-L.patch delete mode 100644 0002-python-Don-t-leak-fields-when-creating-Python-struct.patch delete mode 100644 0003-appliance-Add-IBM850-iconv-converter-for-syslinux.patch create mode 100644 0003-m4-guestfs-ocaml.m4-Fix-deprecated-warning-format.patch rename 0006-RHEL-Remove-libguestfs-live-RHBZ-798980.patch => 0004-RHEL-Remove-libguestfs-live-RHBZ-798980.patch (95%) delete mode 100644 0004-lib-direct-Remove-use-of-sga.patch rename 0007-RHEL-Remove-9p-APIs-from-RHEL-RHBZ-921710.patch => 0005-RHEL-Remove-9p-APIs-from-RHEL-RHBZ-921710.patch (98%) delete mode 100644 0005-lib-Autodetect-backing-format-for-qemu-img-create-b.patch rename 0008-RHEL-Disable-unsupported-remote-drive-protocols-RHBZ.patch => 0006-RHEL-Disable-unsupported-remote-drive-protocols-RHBZ.patch (99%) rename 0009-RHEL-Remove-User-Mode-Linux-RHBZ-1144197.patch => 0007-RHEL-Remove-User-Mode-Linux-RHBZ-1144197.patch (96%) rename 0010-RHEL-Reject-use-of-libguestfs-winsupport-features-ex.patch => 0008-RHEL-Reject-use-of-libguestfs-winsupport-features-ex.patch (97%) rename 0011-RHEL-Create-etc-crypto-policies-back-ends-opensslcnf.patch => 0009-RHEL-Create-etc-crypto-policies-back-ends-opensslcnf.patch (78%) diff --git a/0001-Go-bindings-fix-C-array-of-strings-char-allocation.patch b/0001-Go-bindings-fix-C-array-of-strings-char-allocation.patch new file mode 100644 index 0000000..f70a54e --- /dev/null +++ b/0001-Go-bindings-fix-C-array-of-strings-char-allocation.patch @@ -0,0 +1,153 @@ +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/0001-build-Don-t-use-non-POSIX-tests.patch b/0001-build-Don-t-use-non-POSIX-tests.patch deleted file mode 100644 index 055f21c..0000000 --- a/0001-build-Don-t-use-non-POSIX-tests.patch +++ /dev/null @@ -1,38 +0,0 @@ -From e68a844eb406f0b32cc2c4e60ca66bc1a7f94bdc Mon Sep 17 00:00:00 2001 -From: Martin Kletzander -Date: Mon, 31 May 2021 21:16:29 +0200 -Subject: [PATCH] build: Don't use non-POSIX tests - -The `test` builtin/binary usually accepts `==` for string comparison, it is -mostly accepted for typos and people being used to double equals, but is not -documented and not always accepted either. Since autoconf uses the default -shell, it might just fail in some cases with: - - ./configure: 29986: test: xrustc: unexpected operator - ./configure: 29990: test: xcargo: unexpected operator - -Just change it to single equals as it is done everywhere else. - -Signed-off-by: Martin Kletzander ---- - m4/guestfs-rust.m4 | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/m4/guestfs-rust.m4 b/m4/guestfs-rust.m4 -index aa12a9ef5..1dffd8118 100644 ---- a/m4/guestfs-rust.m4 -+++ b/m4/guestfs-rust.m4 -@@ -24,8 +24,8 @@ AS_IF([test "x$enable_rust" != "xno"],[ - AC_CHECK_PROG([RUSTC],[rustc],[rustc],[no]) - AC_CHECK_PROG([CARGO],[cargo],[cargo],[no]) - -- AS_IF([test "x$RUSTC" == "xno"], [AC_MSG_WARN([rustc not found])]) -- AS_IF([test "x$CARGO" == "xno"], [AC_MSG_WARN([cargo not found])]) -+ AS_IF([test "x$RUSTC" = "xno"], [AC_MSG_WARN([rustc not found])]) -+ AS_IF([test "x$CARGO" = "xno"], [AC_MSG_WARN([cargo not found])]) - ],[ - RUSTC=no - CARGO=no --- -2.31.1 - diff --git a/0002-daemon-inspect_fs_unix-recognize-modern-Pardus-GNU-L.patch b/0002-daemon-inspect_fs_unix-recognize-modern-Pardus-GNU-L.patch new file mode 100644 index 0000000..34d2d81 --- /dev/null +++ b/0002-daemon-inspect_fs_unix-recognize-modern-Pardus-GNU-L.patch @@ -0,0 +1,39 @@ +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/0002-python-Don-t-leak-fields-when-creating-Python-struct.patch b/0002-python-Don-t-leak-fields-when-creating-Python-struct.patch deleted file mode 100644 index 09c9f43..0000000 --- a/0002-python-Don-t-leak-fields-when-creating-Python-struct.patch +++ /dev/null @@ -1,86 +0,0 @@ -From e84c63a2ca4bf2366af96eb1a1222cf494e228c9 Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Tue, 27 Jul 2021 08:55:27 +0100 -Subject: [PATCH] python: Don't leak fields when creating Python structs -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -When creating and returning a Python struct we were adding fields from -the C struct, but did not reduce the ref count on the temporary value -after it had been moved to the struct, resulting in a memory leak. - -Reported-by: 朱丹 -Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1985912 ---- - generator/python.ml | 9 +++++++++ - 1 file changed, 9 insertions(+) - -diff --git a/generator/python.ml b/generator/python.ml -index b3d3a5579..1afd05dd6 100644 ---- a/generator/python.ml -+++ b/generator/python.ml -@@ -173,44 +173,52 @@ and generate_python_structs () = - pr " if (value == NULL)\n"; - pr " goto err;\n"; - pr " PyDict_SetItemString (dict, \"%s\", value);\n" name; -+ pr " Py_DECREF (value);\n" - | name, FBuffer -> - pr " value = PyBytes_FromStringAndSize (%s->%s, %s->%s_len);\n" - typ name typ name; - pr " if (value == NULL)\n"; - pr " goto err;\n"; - pr " PyDict_SetItemString (dict, \"%s\", value);\n" name; -+ pr " Py_DECREF (value);\n" - | name, FUUID -> - pr " value = guestfs_int_py_fromstringsize (%s->%s, 32);\n" - typ name; - pr " if (value == NULL)\n"; - pr " goto err;\n"; - pr " PyDict_SetItemString (dict, \"%s\", value);\n" name; -+ pr " Py_DECREF (value);\n" - | name, (FBytes|FUInt64) -> - pr " value = PyLong_FromUnsignedLongLong (%s->%s);\n" typ name; - pr " if (value == NULL)\n"; - pr " goto err;\n"; - pr " PyDict_SetItemString (dict, \"%s\", value);\n" name; -+ pr " Py_DECREF (value);\n" - | name, FInt64 -> - pr " value = PyLong_FromLongLong (%s->%s);\n" typ name; - pr " if (value == NULL)\n"; - pr " goto err;\n"; - pr " PyDict_SetItemString (dict, \"%s\", value);\n" name; -+ pr " Py_DECREF (value);\n" - | name, FUInt32 -> - pr " value = PyLong_FromUnsignedLong (%s->%s);\n" typ name; - pr " if (value == NULL)\n"; - pr " goto err;\n"; - pr " PyDict_SetItemString (dict, \"%s\", value);\n" name; -+ pr " Py_DECREF (value);\n" - | name, FInt32 -> - pr " value = PyLong_FromLong (%s->%s);\n" typ name; - pr " if (value == NULL)\n"; - pr " goto err;\n"; - pr " PyDict_SetItemString (dict, \"%s\", value);\n" name; -+ pr " Py_DECREF (value);\n" - | name, FOptPercent -> - pr " if (%s->%s >= 0) {\n" typ name; - pr " value = PyFloat_FromDouble ((double) %s->%s);\n" typ name; - pr " if (value == NULL)\n"; - pr " goto err;\n"; - pr " PyDict_SetItemString (dict, \"%s\", value);\n" name; -+ pr " Py_DECREF (value);\n"; - pr " }\n"; - pr " else {\n"; - pr " Py_INCREF (Py_None);\n"; -@@ -222,6 +230,7 @@ and generate_python_structs () = - pr " if (value == NULL)\n"; - pr " goto err;\n"; - pr " PyDict_SetItemString (dict, \"%s\", value);\n" name; -+ pr " Py_DECREF (value);\n" - ) cols; - pr " return dict;\n"; - pr " err:\n"; --- -2.31.1 - diff --git a/0003-appliance-Add-IBM850-iconv-converter-for-syslinux.patch b/0003-appliance-Add-IBM850-iconv-converter-for-syslinux.patch deleted file mode 100644 index bb2f9d2..0000000 --- a/0003-appliance-Add-IBM850-iconv-converter-for-syslinux.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 90a076fe19ead3c517ba2b45edfcc7fffec9860d Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Fri, 6 Aug 2021 08:26:51 +0100 -Subject: [PATCH] appliance: Add IBM850 iconv converter for syslinux - -$ guestfish -N fs:vfat:2G syslinux /dev/sda1 -libguestfs: error: syslinux: Error converting to codepage 850 Invalid argument -... - -This happens because of the default codepage requested by syslinux -(code page 850) combined with the appliance missing the iconv -converter for this codepage. - -Reported-by: Yongkui Guo -Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1990720 ---- - appliance/packagelist.in | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/appliance/packagelist.in b/appliance/packagelist.in -index cede0ac0b..b5f9d9dc7 100644 ---- a/appliance/packagelist.in -+++ b/appliance/packagelist.in -@@ -28,6 +28,7 @@ ifelse(REDHAT,1, - dhclient - gfs-utils - gfs2-utils -+ glibc-gconv-extra dnl syslinux requires IBM850 iconv converter - grub - hfsplus-tools - iproute --- -2.31.1 - diff --git a/0003-m4-guestfs-ocaml.m4-Fix-deprecated-warning-format.patch b/0003-m4-guestfs-ocaml.m4-Fix-deprecated-warning-format.patch new file mode 100644 index 0000000..d8631a7 --- /dev/null +++ b/0003-m4-guestfs-ocaml.m4-Fix-deprecated-warning-format.patch @@ -0,0 +1,33 @@ +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/0006-RHEL-Remove-libguestfs-live-RHBZ-798980.patch b/0004-RHEL-Remove-libguestfs-live-RHBZ-798980.patch similarity index 95% rename from 0006-RHEL-Remove-libguestfs-live-RHBZ-798980.patch rename to 0004-RHEL-Remove-libguestfs-live-RHBZ-798980.patch index 9c93374..ec41d00 100644 --- a/0006-RHEL-Remove-libguestfs-live-RHBZ-798980.patch +++ b/0004-RHEL-Remove-libguestfs-live-RHBZ-798980.patch @@ -1,4 +1,4 @@ -From 9dc4c156eef3ad0eb62aa50acbc4198fd1e335cc Mon Sep 17 00:00:00 2001 +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). diff --git a/0004-lib-direct-Remove-use-of-sga.patch b/0004-lib-direct-Remove-use-of-sga.patch deleted file mode 100644 index 1c13375..0000000 --- a/0004-lib-direct-Remove-use-of-sga.patch +++ /dev/null @@ -1,82 +0,0 @@ -From 8a4761c0fb720078757ecaafd26be18293253f2c Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Wed, 8 Sep 2021 16:06:22 +0100 -Subject: [PATCH] lib: direct: Remove use of sga -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -sga (or "sgabios" or "Serial Graphics Adapter") is an option ROM for -seabios which directs output to the serial adapter. This is very -useful for debugging BIOS problems during boot. - -RHEL wants to deprecate this feature (in fact, they just deprecated it -without telling us). However there is an equivalent feature in -seabios (seabios >= 1.11 / qemu >= 2.11.0) which can be enabled using -either -nographic or -machine graphics=off - -This commit removes sga and enables -machine graphics=off in the -direct backend. - -References (for RHEL 9 qemu change): -https://bugzilla.redhat.com/show_bug.cgi?id=2002325 -https://bugzilla.redhat.com/show_bug.cgi?id=2000845 -https://lists.nongnu.org/archive/html/qemu-devel/2021-09/msg02417.html -https://listman.redhat.com/archives/libvir-list/2021-September/msg00205.html - -For the libvirt backend we will continue to use . -This currently breaks when sga is not available, but I talked to Dan -and the plan there is to adapt libvirt so the same XML will enable --machine graphics=off. IOW libguestfs does not need to make any -change. - -References (for libvirt change): -https://bugzilla.redhat.com/show_bug.cgi?id=2003092 -https://listman.redhat.com/archives/libvir-list/2021-September/msg00193.html - -Thanks: Gerd Hoffman, Daniel Berrangé -(cherry picked from commit e14ff937422115e23094ca4cce80ec9fb01c10b3) ---- - lib/launch-direct.c | 19 +++++++------------ - 1 file changed, 7 insertions(+), 12 deletions(-) - -diff --git a/lib/launch-direct.c b/lib/launch-direct.c -index 972e77e13..e5b9a5611 100644 ---- a/lib/launch-direct.c -+++ b/lib/launch-direct.c -@@ -544,6 +544,13 @@ launch_direct (guestfs_h *g, void *datav, const char *arg) - append_list ("gic-version=host"); - #endif - append_list_format ("accel=%s", accel_val); -+#if defined(__i386__) || defined(__x86_64__) -+ /* Tell seabios to send debug messages to the serial port. -+ * This used to be done by sgabios. -+ */ -+ if (g->verbose) -+ append_list ("graphics=off"); -+#endif - } end_list (); - - cpu_model = guestfs_int_get_cpu_model (has_kvm && !force_tcg); -@@ -665,18 +672,6 @@ launch_direct (guestfs_h *g, void *datav, const char *arg) - } end_list (); - #endif - -- if (g->verbose && -- guestfs_int_qemu_supports_device (g, data->qemu_data, -- "Serial Graphics Adapter")) { -- /* Use sgabios instead of vgabios. This means we'll see BIOS -- * messages on the serial port, and also works around this bug -- * in qemu 1.1.0: -- * https://bugs.launchpad.net/qemu/+bug/1021649 -- * QEmu has included sgabios upstream since just before 1.0. -- */ -- arg ("-device", "sga"); -- } -- - /* Set up virtio-serial for the communications channel. */ - start_list ("-chardev") { - append_list ("socket"); --- -2.31.1 - diff --git a/0007-RHEL-Remove-9p-APIs-from-RHEL-RHBZ-921710.patch b/0005-RHEL-Remove-9p-APIs-from-RHEL-RHBZ-921710.patch similarity index 98% rename from 0007-RHEL-Remove-9p-APIs-from-RHEL-RHBZ-921710.patch rename to 0005-RHEL-Remove-9p-APIs-from-RHEL-RHBZ-921710.patch index 8c644d3..1bdb11f 100644 --- a/0007-RHEL-Remove-9p-APIs-from-RHEL-RHBZ-921710.patch +++ b/0005-RHEL-Remove-9p-APIs-from-RHEL-RHBZ-921710.patch @@ -1,4 +1,4 @@ -From 421f0716461427ec1deddaea3e51ba6ba7ccf71c Mon Sep 17 00:00:00 2001 +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). @@ -204,7 +204,7 @@ index 743a96abd..000000000 - return 0; -} diff --git a/daemon/Makefile.am b/daemon/Makefile.am -index 6f13bd43c..cc4dbcd85 100644 +index 7322bfa5d..872eaa8bc 100644 --- a/daemon/Makefile.am +++ b/daemon/Makefile.am @@ -84,7 +84,6 @@ guestfsd_SOURCES = \ @@ -228,7 +228,7 @@ index 6a97d8b0e..896314e7e 100644 daemon/actions.h daemon/augeas.c diff --git a/generator/actions_core.ml b/generator/actions_core.ml -index bb602ee02..db8156c51 100644 +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. diff --git a/0005-lib-Autodetect-backing-format-for-qemu-img-create-b.patch b/0005-lib-Autodetect-backing-format-for-qemu-img-create-b.patch deleted file mode 100644 index fbff694..0000000 --- a/0005-lib-Autodetect-backing-format-for-qemu-img-create-b.patch +++ /dev/null @@ -1,49 +0,0 @@ -From 6be87872732ca8e298152a9eeebde151fe2bd4a2 Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Tue, 31 Aug 2021 08:27:15 +0100 -Subject: [PATCH] lib: Autodetect backing format for qemu-img create -b - -qemu 6.1 has decided to change qemu-img create so that a backing -format (-F) is required if a backing file (-b) is specified. Since we -don't want to change the libguestfs API to force callers to specify -this because that would be an API break, autodetect it. - -This is similar to commit c8c181e8d9 ("launch: libvirt: Autodetect -backing format for readonly drive overlays"). - -Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1998820 -(cherry picked from commit 45de287447bb18d59749fbfc1ec5072413090109) ---- - lib/create.c | 9 +++++++++ - 1 file changed, 9 insertions(+) - -diff --git a/lib/create.c b/lib/create.c -index 44a7df25f..75a4d3a28 100644 ---- a/lib/create.c -+++ b/lib/create.c -@@ -255,6 +255,7 @@ disk_create_qcow2 (guestfs_h *g, const char *filename, int64_t size, - const struct guestfs_disk_create_argv *optargs) - { - const char *backingformat = NULL; -+ CLEANUP_FREE char *backingformat_free = NULL; - const char *preallocation = NULL; - const char *compat = NULL; - int clustersize = -1; -@@ -270,6 +271,14 @@ disk_create_qcow2 (guestfs_h *g, const char *filename, int64_t size, - return -1; - } - } -+ else if (backingfile) { -+ /* Since qemu 6.1, qemu-img create has requires a backing format (-F) -+ * parameter if backing file (-b) is used (RHBZ#1998820). -+ */ -+ backingformat = backingformat_free = guestfs_disk_format (g, backingfile); -+ if (!backingformat) -+ return -1; -+ } - if (optargs->bitmask & GUESTFS_DISK_CREATE_PREALLOCATION_BITMASK) { - if (STREQ (optargs->preallocation, "off") || - STREQ (optargs->preallocation, "sparse")) --- -2.31.1 - diff --git a/0008-RHEL-Disable-unsupported-remote-drive-protocols-RHBZ.patch b/0006-RHEL-Disable-unsupported-remote-drive-protocols-RHBZ.patch similarity index 99% rename from 0008-RHEL-Disable-unsupported-remote-drive-protocols-RHBZ.patch rename to 0006-RHEL-Disable-unsupported-remote-drive-protocols-RHBZ.patch index 78aba95..c245ac1 100644 --- a/0008-RHEL-Disable-unsupported-remote-drive-protocols-RHBZ.patch +++ b/0006-RHEL-Disable-unsupported-remote-drive-protocols-RHBZ.patch @@ -1,4 +1,4 @@ -From b7007f7b1524c8f5d001eda10ebf040b0ae4ca43 Mon Sep 17 00:00:00 2001 +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 @@ -220,7 +220,7 @@ index 21d424984..ddabeb639 100755 rm test-add-uri.out rm test-add-uri.img diff --git a/generator/actions_core.ml b/generator/actions_core.ml -index db8156c51..b87071e3b 100644 +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. diff --git a/0009-RHEL-Remove-User-Mode-Linux-RHBZ-1144197.patch b/0007-RHEL-Remove-User-Mode-Linux-RHBZ-1144197.patch similarity index 96% rename from 0009-RHEL-Remove-User-Mode-Linux-RHBZ-1144197.patch rename to 0007-RHEL-Remove-User-Mode-Linux-RHBZ-1144197.patch index eb27805..998760d 100644 --- a/0009-RHEL-Remove-User-Mode-Linux-RHBZ-1144197.patch +++ b/0007-RHEL-Remove-User-Mode-Linux-RHBZ-1144197.patch @@ -1,4 +1,4 @@ -From dbca97559bc6d44d91dafbf3b7435a0d909fb6fa Mon Sep 17 00:00:00 2001 +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). diff --git a/0010-RHEL-Reject-use-of-libguestfs-winsupport-features-ex.patch b/0008-RHEL-Reject-use-of-libguestfs-winsupport-features-ex.patch similarity index 97% rename from 0010-RHEL-Reject-use-of-libguestfs-winsupport-features-ex.patch rename to 0008-RHEL-Reject-use-of-libguestfs-winsupport-features-ex.patch index 7b1a024..95b89f7 100644 --- a/0010-RHEL-Reject-use-of-libguestfs-winsupport-features-ex.patch +++ b/0008-RHEL-Reject-use-of-libguestfs-winsupport-features-ex.patch @@ -1,4 +1,4 @@ -From b7dd5ace0488cfa0b9caa3ea673edb13324d806e Mon Sep 17 00:00:00 2001 +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 diff --git a/0011-RHEL-Create-etc-crypto-policies-back-ends-opensslcnf.patch b/0009-RHEL-Create-etc-crypto-policies-back-ends-opensslcnf.patch similarity index 78% rename from 0011-RHEL-Create-etc-crypto-policies-back-ends-opensslcnf.patch rename to 0009-RHEL-Create-etc-crypto-policies-back-ends-opensslcnf.patch index 57a6982..67403cc 100644 --- a/0011-RHEL-Create-etc-crypto-policies-back-ends-opensslcnf.patch +++ b/0009-RHEL-Create-etc-crypto-policies-back-ends-opensslcnf.patch @@ -1,4 +1,4 @@ -From fa865ee05a6269c46b1cd2fe5311ac6663260e29 Mon Sep 17 00:00:00 2001 +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 @@ -9,10 +9,10 @@ https://bugzilla.redhat.com/show_bug.cgi?id=1977214#c13 1 file changed, 8 insertions(+) diff --git a/appliance/init b/appliance/init -index b1c4d09ea..be46f9648 100755 +index 7076821d2..fe6497b4d 100755 --- a/appliance/init +++ b/appliance/init -@@ -70,6 +70,14 @@ if ! test -e /etc/mtab; then +@@ -76,6 +76,14 @@ if ! test -e /etc/mtab; then ln -s /proc/mounts /etc/mtab fi @@ -24,9 +24,9 @@ index b1c4d09ea..be46f9648 100755 + ln -s /usr/share/crypto-policies/DEFAULT/opensslcnf.txt /etc/crypto-policies/back-ends/opensslcnf.config +fi + - # devtmpfs is required since udev 176 - mount -t devtmpfs /dev /dev - mkdir -p /dev/pts + # Static nodes must happen before udev is started. + + # Set up kmod static-nodes (RHBZ#1011907). -- 2.31.1 diff --git a/libguestfs.spec b/libguestfs.spec index 89f3030..b8a79a6 100644 --- a/libguestfs.spec +++ b/libguestfs.spec @@ -45,7 +45,7 @@ %endif # The source directory. -%global source_directory 1.45-development +%global source_directory 1.46-stable # Filter perl provides. %{?perl_default_filter} @@ -56,8 +56,8 @@ Summary: Access and modify virtual machine disk images Name: libguestfs Epoch: 1 -Version: 1.45.6 -Release: 14%{?dist} +Version: 1.46.0 +Release: 1%{?dist} License: LGPLv2+ # Build only for architectures that have a kernel @@ -95,20 +95,18 @@ Source8: copy-patches.sh # https://github.com/libguestfs/libguestfs/commits/rhel-9.0.0 # Patches. -Patch0001: 0001-build-Don-t-use-non-POSIX-tests.patch -Patch0002: 0002-python-Don-t-leak-fields-when-creating-Python-struct.patch -Patch0003: 0003-appliance-Add-IBM850-iconv-converter-for-syslinux.patch -Patch0004: 0004-lib-direct-Remove-use-of-sga.patch -Patch0005: 0005-lib-Autodetect-backing-format-for-qemu-img-create-b.patch +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 # Downstream (RHEL-only) patches. %if 0%{?rhel} -Patch0006: 0006-RHEL-Remove-libguestfs-live-RHBZ-798980.patch -Patch0007: 0007-RHEL-Remove-9p-APIs-from-RHEL-RHBZ-921710.patch -Patch0008: 0008-RHEL-Disable-unsupported-remote-drive-protocols-RHBZ.patch -Patch0009: 0009-RHEL-Remove-User-Mode-Linux-RHBZ-1144197.patch -Patch0010: 0010-RHEL-Reject-use-of-libguestfs-winsupport-features-ex.patch -Patch0011: 0011-RHEL-Create-etc-crypto-policies-back-ends-opensslcnf.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 %endif %if 0%{patches_touch_autotools} @@ -967,7 +965,7 @@ rm ocaml/html/.gitignore %files devel -%doc AUTHORS BUGS HACKING TODO README +%doc AUTHORS HACKING TODO README %doc examples/*.c %{_libdir}/libguestfs.so %{_sbindir}/libguestfs-make-fixed-appliance @@ -1148,6 +1146,10 @@ rm ocaml/html/.gitignore %changelog +* 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 + * Tue Sep 14 2021 Richard W.M. Jones - 1:1.45.6-14 - Specify backing format for qemu 6.1 resolves: rhbz#1999419 diff --git a/sources b/sources index 33a2bac..9681d10 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (libguestfs-1.45.6.tar.gz) = 018aec83d153aeabb7c0b255e6d5b40b03ff6d0de12dc1e0557fc35215db593aaa871c4bc1f44e785f74bf02a367aec0e90157f8ff159cccc820ebf1afd2258a -SHA512 (libguestfs-1.45.6.tar.gz.sig) = 8f0be35a265356e7bd823b3d9302449ac62d633de8a9bd40ca457bcb4e4d2aebc827c4867bfdb6f3e3a4f34ade168103f5af0a44b667c875be7721e275433dbe +SHA512 (libguestfs-1.46.0.tar.gz) = 9b1670dff924e046ab82ff1ce6e25428d95b88700b507d4f1dd68a309641e376d14520c7b5aa5bbb81a6ba5c708ebcc46b6fe0970d903a3ed79e76d4ccdca614 +SHA512 (libguestfs-1.46.0.tar.gz.sig) = d4c8e4629377d42e8e9f1cc88ad7885999c9ae94a2ee2e683960b397b1a92411c289bddb65d4c3c350915bba16c949011639614b9ec54037bf43833e917b7858