lib/launch-libvirt.c: Assume libvirt >= 9.0.0 and passt support

Libvirt 9.0.0 was released in January 2023, and it seems safe to
assume that if you're enabling the non-default backend, you can at
least use a new version of libvirt.

If you're using new libvirt, might as well also assume passt is
available.
This commit is contained in:
Richard W.M. Jones
2025-09-29 13:17:13 +01:00
committed by rwmjones
parent d730fc8b7c
commit 48bad58024
3 changed files with 5 additions and 13 deletions

View File

@@ -190,7 +190,7 @@ Optional if compiling from tarball.
I<Required>. ocaml-hivex is the OCaml binding for hivex, which is
required when building the daemon.
=item libvirt E<ge> 0.10.2
=item libvirt E<ge> 9.0.0
Optional. Always use the latest possible version of libvirt.

View File

@@ -1384,17 +1384,9 @@ construct_libvirt_xml_devices (guestfs_h *g,
if (g->enable_network) {
start_element ("interface") {
attribute ("type", "user");
/* If libvirt is 9.0.0+ and "passt" is available, ask for passt rather
* than SLIRP (RHBZ#2184967). Note that this causes some
* appliance-visible changes (although network connectivity is certainly
* functional); refer to RHBZ#2222766 about those.
*/
if (guestfs_int_version_ge (&params->data->libvirt_version, 9, 0, 0) &&
guestfs_int_passt_runnable (g)) {
start_element ("backend") {
attribute ("type", "passt");
} end_element ();
}
start_element ("backend") {
attribute ("type", "passt");
} end_element ();
start_element ("model") {
attribute ("type", "virtio");
} end_element ();

View File

@@ -264,7 +264,7 @@ AC_ARG_WITH([libvirt],[
[],
[with_libvirt=check])
AS_IF([test "$with_libvirt" != "no"],[
PKG_CHECK_MODULES([LIBVIRT], [libvirt >= 0.10.2],[
PKG_CHECK_MODULES([LIBVIRT], [libvirt >= 9.0.0],[
AC_SUBST([LIBVIRT_CFLAGS])
AC_SUBST([LIBVIRT_LIBS])
AC_DEFINE([HAVE_LIBVIRT],[1],[libvirt found at compile time.])