Bug 2003092

Summary: Convert QEMU driver from SGA bios to graphics=off
Product: Red Hat Enterprise Linux 9 Reporter: Daniel Berrangé <berrange>
Component: libvirtAssignee: Daniel Berrangé <berrange>
libvirt sub component: General QA Contact: Meina Li <meili>
Status: CLOSED ERRATA Docs Contact:
Severity: unspecified    
Priority: unspecified CC: coli, jdenemar, jinqi, jsuchane, lizhu, mmarusak, rjones, virt-maint, xuwei, xuzhang, yoguo
Version: 9.0Keywords: AutomationBackLog
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libvirt-7.8.0-1.el9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-05-17 12:45:32 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version: 7.8.0
Embargoed:
Bug Depends On:    
Bug Blocks: 2000845, 2002325, 2003040    

Description Daniel Berrangé 2021-09-10 11:19:58 UTC
Description of problem:
When given

<domain>
  ..
  <os>
    ..
    <bios useserial='yes'/>
    ...
  </os>
  ..
</domain>

Libvirt will tell QEMU to use '-device sga', to make the BIOS emit boot messages on the serial console.

Bug 2003040 is proposing removal of the sga device and this will break libguestfs.

We need to convert libvirt to use '-M graphics=off' to avoid the regression in libguestfs.

Merged upstream for 7.8.0 release as

69254cafa0899cb30f1614ca647a97b3de5ff414  qemu: stop probing for '-device sga' support
40dfef297a4a03be11a82ba6911bb08905504690 qemu: switch to use -M graphics=off instead of -device sga
58dfbca51da64229dcc18878c1194b46677b5075 qemu: tweak error message to be more general purpose
c82726a46087d5422104fb9dc15756444735f285 qemu: prevent use of <bios useserial='yes'> on non-x86 arches


Testing shows that it is possible to live migrate between a guest using "-device sga" and a guest using "-M graphics=off" in both directions, without any difference in behaviour nor any migration compatibility problems.

Version-Release number of selected component (if applicable):
7.7.0

How reproducible:
Always

Steps to Reproduce:
1. Add  <bios useserial='yes'/> and   <bootmenu enable='yes' timeout='5000'/> in the <os> element of a guest using SeaBIOS
2. virsh start --paused $GUEST
3. virsh console $GUEST
4. In a separate terminal  run 'virsh resume $GUEST'


Actual results:
N/a

Expected results:
In the original terminal there should be a message on the text console from seabios offering to show the menu menu choices

Comment 1 Richard W.M. Jones 2021-09-13 09:34:30 UTC
*** Bug 2002392 has been marked as a duplicate of this bug. ***

Comment 2 Klaus Heinrich Kiwi 2021-10-07 20:02:23 UTC
*** Bug 2007257 has been marked as a duplicate of this bug. ***

Comment 3 Meina Li 2021-10-15 02:57:12 UTC
Test Version:
libvirt-7.8.0-1.el9.x86_64
qemu-kvm-6.1.0-5.el9.x86_64

Test Steps:
1. Prepare a seabios guest with the following os xml:
# virsh dumpxml lmn | grep /os -B5
  <os>
    <type arch='x86_64' machine='pc-q35-rhel8.5.0'>hvm</type>
    <boot dev='hd'/>
    <bootmenu enable='yes' timeout='5000'/>
    <bios useserial='yes'/>
  </os>
2. Start and paused the guest; then check the concole:
# virsh start lmn --paused
Domain 'lmn' started
# virsh console lmn
Connected to domain 'lmn'
Escape character is ^] (Ctrl + ])

3. Check the qemu command:
# ps aux | grep lmn | grep graphics=off
...
-machine pc-q35-rhel8.5.0,accel=kvm,usb=off,dump-guest-core=off,memory-backend=pc.ram,graphics=off
...

3. In another terminal, resume the guest.
# virsh resume lmn
Domain 'lmn' resumed

4. Check the console in the first terminal.
SeaBIOS (version 1.14.0-7.el9)
Machine UUID b91e01f9-58c7-4266-8868-ca8d7ec76d7c

iPXE (http://ipxe.org) 01:00.0 CA00 PCI2.10 PnP PMM+7FF8D110+7FECD110 CA00
                                                                               
Press ESC for boot menu.

Select boot device:

1. Virtio disk PCI:04:00.0
2. Legacy option rom
3. iPXE (PCI 01:00.0)

We can see the message on the text console from seabios offering to show the menu choices

Comment 6 Meina Li 2021-11-03 07:23:07 UTC
Verified Version:
libvirt-7.8.0-1.el9.x86_64
qemu-kvm-6.1.0-6.el9.x86_64
kernel-5.14.0-10.el9.x86_64

Verified Steps:
Same with comment 3.

Comment 8 errata-xmlrpc 2022-05-17 12:45:32 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (new packages: libvirt), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2022:2390