From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46713) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKOKR-00019l-N5 for qemu-devel@nongnu.org; Tue, 05 Jul 2016 07:15:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bKOKK-0008TI-HN for qemu-devel@nongnu.org; Tue, 05 Jul 2016 07:15:47 -0400 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:35183) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKOKK-0008T7-AW for qemu-devel@nongnu.org; Tue, 05 Jul 2016 07:15:40 -0400 Received: by mail-wm0-x244.google.com with SMTP id a66so27900077wme.2 for ; Tue, 05 Jul 2016 04:15:40 -0700 (PDT) Sender: Paolo Bonzini References: <1467664794-31002-1-git-send-email-kraxel@redhat.com> <20160705080605.GA6553@redhat.com> <1467712848.12358.21.camel@redhat.com> From: Paolo Bonzini Message-ID: <4e56459c-c79a-96e8-3cc1-d44ff9a3a5d5@redhat.com> Date: Tue, 5 Jul 2016 13:15:37 +0200 MIME-Version: 1.0 In-Reply-To: <1467712848.12358.21.camel@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH v2 0/3] seabios: add serial console support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann , "Daniel P. Berrange" Cc: seabios@seabios.org, qemu-devel@nongnu.org On 05/07/2016 12:00, Gerd Hoffmann wrote: > One option would be to continue using sgabios.bin in fw_cfg. But > instead of loading and executing it activate the build-in serial console > if we find the file. That would make the switch completely transparent > to upper layers. But it is quite hackish of course ... OpenBIOS uses FW_CFG_NOGRAPHIC for this, which is the negation of qdev_get_machine()->enable_graphics and set by both "-nographic" and "-machine graphics=no" ("-nographic" is a shortcut for "-display none -machine graphics=no"). The default is "-machine graphics=yes". As long as QEMU doesn't enable both FW_CFG_NOGRAPHIC and sgabios.bin, it should be fine. For example, if SeaBIOS's serial console is made accessible with "-machine graphics=no", then: * QEMU's "-device sga" should do nothing if machine->enable_graphics is set. * For old machine types, QEMU should hardcode FW_CFG_NOGRAPHIC to false(*) so that sgabios is never blocked. For new machine types, SGABIOS will still be accessible with "-device sga". New machine types depend on SeaBIOS that has a serial console, otherwise "-nographic -device sga" breaks. Paolo (*) Hardcoding FW_CFG_NOGRAPHIC to false doesn't match what old QEMU does, but provides the best backwards-compatibility: - old->new: Because old QEMU provides sgabios, you have to include sgabios.bin in the destination too or migration fails. After migration, the BIOS comes from old QEMU and itnever looks at FW_CFG_NOGRAPHIC, so the value doesn't matter---we just make it false. - new->old: Because old QEMU expects sgabios to be there, you have to include sgabios.bin. The BIOS comes from new QEMU and looks at FW_CFG_NOGRAPHIC. To avoid double hooking FW_CFG_NOGRAPHIC has to be false.