m4/guestfs-qemu.m4: Remove virtio-serial test

I'm not sure what versions of qemu lack virtio-serial support, but
it's not ones that we have ever seen, so remove this test.  Also
virtio-serial doesn't work without kernel support, but we never tested
that.

If qemu or the guest kernel really lacks virtio-serial (likely it has
been compiled out) then we'll see it as soon as someone uses
libguestfs.

This also removes QEMU_OPTIONS_FOR_CONFIGURE, and the test of the qemu
version, since both are no longer used after we remove this test.
This commit is contained in:
Richard W.M. Jones
2026-03-17 13:53:08 +00:00
committed by rwmjones
parent 48607d9d15
commit 389c6b7583

View File

@@ -42,92 +42,4 @@ AS_IF([test "x$with_qemu" = "xno"],[
test "x$QEMU" = "xno" && AC_MSG_ERROR([qemu must be installed])
AC_DEFINE_UNQUOTED([QEMU],["$QEMU"],[Location of qemu binary.])
dnl Check that the chosen qemu has virtio-serial support.
dnl For historical reasons this can be disabled by setting
dnl vmchannel_test=no.
if test "x$vmchannel_test" != "xno"; then
AC_MSG_CHECKING([that $QEMU -help works])
if $QEMU -help >&AS_MESSAGE_LOG_FD 2>&1; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
AC_MSG_FAILURE(
[$QEMU -help: command failed.
This could be a very old version of qemu, or qemu might not be
working.
])
fi
AC_MSG_CHECKING([that $QEMU -version works])
if $QEMU -version >&AS_MESSAGE_LOG_FD 2>&1; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
AC_MSG_FAILURE(
[$QEMU -version: command failed.
This could be a very old version of qemu, or qemu might not be
working.
])
fi
AC_MSG_CHECKING([for $QEMU version >= 1])
if $QEMU -version | grep -sq 'version @<:@1-9@:>@'; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
AC_MSG_FAILURE([$QEMU version must be >= 1.0.])
fi
dnl Unfortunately $QEMU -device \? won't just work. We probably
dnl need to add a cocktail of different arguments which differ
dnl on the various emulators. Thanks, qemu.
AC_MSG_CHECKING([what extra options we need to use for qemu feature tests])
QEMU_OPTIONS_FOR_CONFIGURE=
# Note: the order we test these matters.
for opt in "-machine virt" "-machine accel=kvm:tcg" "-display none"; do
if $QEMU $QEMU_OPTIONS_FOR_CONFIGURE $opt -device \? >&AS_MESSAGE_LOG_FD 2>&1; then
QEMU_OPTIONS_FOR_CONFIGURE="$QEMU_OPTIONS_FOR_CONFIGURE $opt"
fi
done
AC_MSG_RESULT([$QEMU_OPTIONS_FOR_CONFIGURE])
AC_MSG_CHECKING([that $QEMU $QEMU_OPTIONS_FOR_CONFIGURE -device ? works])
if $QEMU $QEMU_OPTIONS_FOR_CONFIGURE -device \? >&AS_MESSAGE_LOG_FD 2>&1; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
AC_MSG_FAILURE([$QEMU $QEMU_OPTIONS_FOR_CONFIGURE -device ? doesn't work.])
fi
AC_MSG_CHECKING([for virtio-serial support in $QEMU])
if $QEMU $QEMU_OPTIONS_FOR_CONFIGURE -device \? 2>&1 | grep -sq virtio-serial; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
AC_MSG_FAILURE(
[I did not find virtio-serial support in
$QEMU.
virtio-serial support in qemu or KVM is essential for libguestfs
to operate.
Usually this means that you have to install a newer version of qemu
and/or KVM. Please read the relevant section in the README file for
more information about this.
You can override this test by setting the environment variable
vmchannel_test=no
However if you don't have the right support in your qemu, then this
just delays the pain.
If I am using the wrong qemu or you want to compile qemu from source
and install it in another location, then you should configure with
the --with-qemu option.
])
fi
fi
])