}
-static int
-qemuBuildSgaCommandLine(virCommand *cmd,
- const virDomainDef *def)
-{
- /* Serial graphics adapter */
- if (def->os.bios.useserial == VIR_TRISTATE_BOOL_YES)
- virCommandAddArgList(cmd, "-device", "sga", NULL);
-
- return 0;
-}
-
-
static char *
qemuBuildClockArgStr(virDomainClockDef *def)
{
virBufferAsprintf(&buf, ",memory-backend=%s", defaultRAMid);
}
+ /* On x86 targets, graphics=off activates the serial console
+ * output mode in the firmware. On non-x86 targets it has
+ * various other undesirable effects that we certainly do
+ * not want to have. We rely on the validation code to have
+ * blocked useserial=yes on non-x86
+ */
+ if (def->os.bios.useserial == VIR_TRISTATE_BOOL_YES) {
+ virBufferAddLit(&buf, ",graphics=off");
+ }
+
virCommandAddArgBuffer(cmd, &buf);
return 0;
virCommandAddArg(cmd, "-no-user-config");
virCommandAddArg(cmd, "-nodefaults");
- if (qemuBuildSgaCommandLine(cmd, def) < 0)
- return NULL;
-
if (qemuBuildMonitorCommandLine(logManager, secManager, cmd, cfg, def, priv) < 0)
return NULL;
/* Serial graphics adapter */
if (def->os.bios.useserial == VIR_TRISTATE_BOOL_YES) {
- /* -device sga is only sane on x86, since the option ROM it
- * loads contains x86 machine code.
+ /* 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 (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_SGA)) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("qemu does not support SGA"));
- return -1;
- }
if (!def->nserials) {
virReportError(VIR_ERR_XML_ERROR, "%s",
_("need at least one serial port to use BIOS serial output"));
/usr/bin/qemu-system-i386 \
-name guest=test-bios,debug-threads=on \
-S \
--machine pc,accel=tcg,usb=off,dump-guest-core=off \
+-machine pc,accel=tcg,usb=off,dump-guest-core=off,graphics=off \
-bios /usr/share/seabios/bios.bin \
-m 1024 \
-realtime mlock=off \
-display none \
-no-user-config \
-nodefaults \
--device sga \
-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-test-bios/monitor.sock,server=on,wait=off \
-mon chardev=charmonitor,id=monitor,mode=control \
-rtc base=utc \
DO_TEST_PARSE_ERROR_NOCAPS("reboot-timeout-enabled");
DO_TEST("bios",
- QEMU_CAPS_DEVICE_ISA_SERIAL,
- QEMU_CAPS_SGA);
+ QEMU_CAPS_DEVICE_ISA_SERIAL);
DO_TEST_NOCAPS("bios-nvram");
DO_TEST("bios-nvram-secure",
QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE,