import libguestfs-1.44.0-5.module+el8.6.0+13732+b2b9b31d

This commit is contained in:
CentOS Sources 2022-02-07 18:03:55 +00:00 committed by Stepan Oksanichenko
parent 56921fa8c2
commit 3bd52612ef
20 changed files with 250 additions and 17 deletions

View File

@ -52,5 +52,5 @@ index 921e6d1df..8b2887247 100644
TESTS_ENVIRONMENT = $(top_builddir)/run --test
--
2.18.4
2.31.1

View File

@ -326,5 +326,5 @@ index 69ea7134a..0782e8ceb 100644
gobject/src/optargs-ntfsclone_out.c
gobject/src/optargs-ntfsfix.c
--
2.18.4
2.31.1

View File

@ -605,5 +605,5 @@ index 19dd60a2f..583e031bd 100755
-grep -sq -- '-drive file=ssh://rich@example.com/disk.img,' "$DEBUG_QEMU_FILE" || fail
-rm "$DEBUG_QEMU_FILE"
--
2.18.4
2.31.1

View File

@ -68,5 +68,5 @@ index 5aec50a57..8b9fcd770 100644
static int
shutdown_uml (guestfs_h *g, void *datav, int check_for_errors)
--
2.18.4
2.31.1

View File

@ -65,5 +65,5 @@ index 39ccc2068..2b2e2d8a9 100644
exit (EXIT_FAILURE);
--
2.18.4
2.31.1

View File

@ -33,5 +33,5 @@ index 25ffea0d9..bbb4db464 100644
NO_SNV_CFLAGS=
--
2.18.4
2.31.1

View File

@ -90,5 +90,5 @@ index 000000000..27089beaa
+
+rm $f
--
2.18.4
2.31.1

View File

@ -109,5 +109,5 @@ index 6e00c7083..02b5a0470 100644
debug_matching "Linux /usr";
role := `Usr;
--
2.18.4
2.31.1

View File

@ -45,5 +45,5 @@ index 44a7df25f..75a4d3a28 100644
if (STREQ (optargs->preallocation, "off") ||
STREQ (optargs->preallocation, "sparse"))
--
2.18.4
2.31.1

View File

@ -40,5 +40,5 @@ index 5e856c91f..7da8ae29e 100644
| Either ret -> ret
| Or exn -> raise exn
--
2.18.4
2.31.1

View File

@ -1060,5 +1060,5 @@ index bf1f83c9d..f90bda04e 100644
AC_PATH_PROGS([PBMTEXT],[pbmtext],[no])
AC_PATH_PROGS([PNMTOPNG],[pnmtopng],[no])
--
2.18.4
2.31.1

View File

@ -32,5 +32,5 @@ index 92a3abf58..be0e81e22 100644
/* Convert this to an OCaml struct. Any NULL fields must be turned
--
2.18.4
2.31.1

View File

@ -4660,5 +4660,5 @@ index 28b9c1db0..90492b814 100755
$g->upload ($ENV{SRCDIR}.'/../binaries/bin-x86_64-dynamic', '/bin/ls');
--
2.18.4
2.31.1

View File

@ -30,5 +30,5 @@ index 0782e8ceb..fdc6e8062 100644
lib/errors.c
lib/event-string.c
--
2.18.4
2.31.1

View File

@ -60,5 +60,5 @@ index b404148c6..000000000
- popdef([VARIABLE])
-])
--
2.18.4
2.31.1

View File

@ -470,5 +470,5 @@ index df6060a73..72cddaf88 100644
</applications>
</operatingsystem>
--
2.18.4
2.31.1

View File

@ -0,0 +1,65 @@
From 6657d0c1018ab44ae680376463ac3f0421548fb4 Mon Sep 17 00:00:00 2001
From: Laszlo Ersek <lersek@redhat.com>
Date: Thu, 23 Dec 2021 11:36:59 +0100
Subject: [PATCH] launch-libvirt: place our virtio-net-pci device in slot 0x1e
The <qemu:commandline> 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
<https://libvirt.org/formatdomain.html#controllers>.
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2034160
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20211223103701.12702-2-lersek@redhat.com>
Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
Tested-by: Richard W.M. Jones <rjones@redhat.com>
(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 4799ee0a1..0b46f0070 100644
--- a/lib/guestfs-internal.h
+++ b/lib/guestfs-internal.h
@@ -147,6 +147,17 @@
#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 026dc6b26..5842319df 100644
--- a/lib/launch-libvirt.c
+++ b/lib/launch-libvirt.c
@@ -1834,7 +1834,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.31.1

View File

@ -0,0 +1,70 @@
From 4b9eac11db3e2cc9ace397ed4c804356a7d9adbf Mon Sep 17 00:00:00 2001
From: Laszlo Ersek <lersek@redhat.com>
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 <lersek@redhat.com>
Message-Id: <20211223103701.12702-3-lersek@redhat.com>
Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
Tested-by: Richard W.M. Jones <rjones@redhat.com>
(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 0b46f0070..97a13ff2c 100644
--- a/lib/guestfs-internal.h
+++ b/lib/guestfs-internal.h
@@ -158,6 +158,12 @@
#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 b6ed9766f..de17d2167 100644
--- a/lib/launch-direct.c
+++ b/lib/launch-direct.c
@@ -681,7 +681,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 5842319df..0f38f0aec 100644
--- a/lib/launch-libvirt.c
+++ b/lib/launch-libvirt.c
@@ -1826,7 +1826,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.31.1

View File

@ -0,0 +1,91 @@
From 8570de6e766297e4c9feab1c54ae05037f33edeb Mon Sep 17 00:00:00 2001
From: Laszlo Ersek <lersek@redhat.com>
Date: Thu, 23 Dec 2021 11:37:01 +0100
Subject: [PATCH] launch-libvirt: add virtio-net via the standard <interface>
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
<interface> element in the domain XML:
<https://libvirt.org/formatdomain.html#userspace-slirp-stack>. This means
we don't need the <qemu:commandline> 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 <interface> 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 <rjones@redhat.com>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20211223103701.12702-4-lersek@redhat.com>
Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
Tested-by: Richard W.M. Jones <rjones@redhat.com>
(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 97a13ff2c..b11c945e9 100644
--- a/lib/guestfs-internal.h
+++ b/lib/guestfs-internal.h
@@ -148,7 +148,8 @@
#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 0f38f0aec..f6bb39d99 100644
--- a/lib/launch-libvirt.c
+++ b/lib/launch-libvirt.c
@@ -1396,6 +1396,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 <interface> element rather than <qemu:commandline>, 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 (&params->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.
*/
@@ -1818,9 +1840,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 (&params->data->libvirt_version, 3, 8, 0)) {
start_element ("qemu:arg") {
attribute ("value", "-netdev");
} end_element ();
--
2.31.1

View File

@ -32,7 +32,7 @@ Summary: Access and modify virtual machine disk images
Name: libguestfs
Epoch: 1
Version: 1.44.0
Release: 4%{?dist}
Release: 5%{?dist}
License: LGPLv2+
ExclusiveArch: x86_64 %{power64} aarch64 s390x
@ -66,6 +66,9 @@ Patch0013: 0013-test-data-phony-guests-Fix-phony-RPM-database-fix-vi.patch
Patch0014: 0014-po-POTFILES-Fix-list-of-files-for-translation.patch
Patch0015: 0015-m4-guestfs-find-db-tool.m4-Remove-unused-file.patch
Patch0016: 0016-test-data-phony-guests-Fix-phony-RPM-database-fix-vi.patch
Patch0017: 0017-launch-libvirt-place-our-virtio-net-pci-device-in-sl.patch
Patch0018: 0018-lib-extract-NETWORK_ADDRESS-and-NETWORK_PREFIX-as-ma.patch
Patch0019: 0019-launch-libvirt-add-virtio-net-via-the-standard-inter.patch
# Replacement README file.
Source4: README-replacement.in
@ -1179,6 +1182,10 @@ rm ocaml/html/.gitignore
%changelog
* Fri Dec 24 2021 Richard W.M. Jones <rjones@redhat.com> - 1:1.44.0-5
- Fix libguestfs failure with qemu 6.2, libvirt 7.10
resolves: rhbz#2035177
* Thu Oct 14 2021 Richard W.M. Jones <rjones@redhat.com> - 1:1.44.0-4
- Autodetect backing format for qemu-img create -b
- Move appliance to separate subpackage