Hi Daniel,

On a whim, I tried installing libvirt on a Raspberry Pi 5. I was
pleasantly surprised to find that it all worked, apart from one small
wrinkle.

I typically use virt-install and set up a serial console, but this
failed with the error:

ERROR    unsupported configuration: BIOS serial console only supported
on x86 architectures

I created the VM with a graphical console then manually adjusted the
config afterwards to use a serial console and it all worked fine. After
a bit of digging I saw an email[1] from yourself talking about how
graphics=off has semantic effects beyond just controlling whether the
firmware prints to the serial or not.  After a bit more digging, I
found out that Qemu 8.0[2] removed the sga device due to SeaBIOS 1.11.0
and newer supporting this feature natively when QEMU is started with the
option -M graphics=off.

I made the following small patch against the Debian package:

--- libvirt-11.3.0.orig/src/qemu/qemu_validate.c
+++ libvirt-11.3.0/src/qemu/qemu_validate.c
@@ -1304,15 +1304,7 @@ qemuValidateDomainDef(const virDomainDef
         /* On x86 -machine graphics=off toggles the use of the
          * serial console in SeaBIOS (and theoretically other
          * firmwares).
-         * On non-x86, it has also sorts of other effects
-         * on QEMU device models created and so we don't
-         * want to allow its use.
          */
-        if (!ARCH_IS_X86(def->os.arch)) {
-            virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("BIOS serial console only supported on x86 architectures"));
-            return -1;
-        }
         if (!def->nserials) {
             virReportError(VIR_ERR_XML_ERROR, "%s",
_("need at least one serial port to use BIOS serial output"));

With that change, I can now create VMs with a serial console through
virt-install on the Raspberry PI 5.

Have I got this right? If so, I'm happy to submit the patch.

Regards,

Leigh.

--
[1] https://mail.gnu.org/archive/html/qemu-devel/2021-09/msg02417.html
[2] https://wiki.qemu.org/ChangeLog/8.0

Reply via email to