Bug 2002325

Summary: Use -machine graphics=off instead of sga device
Product: Red Hat Enterprise Linux 9 Reporter: Richard W.M. Jones <rjones>
Component: libguestfsAssignee: Richard W.M. Jones <rjones>
Status: CLOSED ERRATA QA Contact: YongkuiGuo <yoguo>
Severity: high Docs Contact:
Priority: high    
Version: 9.0CC: kkiwi, kraxel, lersek, rjones, virt-maint, xuwei, yoguo
Target Milestone: rcKeywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libguestfs-1.45.6-13.el9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-05-17 12:28:37 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:
Embargoed:
Bug Depends On: 2002392, 2003092    
Bug Blocks: 2000845    

Description Richard W.M. Jones 2021-09-08 14:49:36 UTC
Description of problem:

libguestfs currently uses SGA (an extension of seabios)
to enable serial output of BIOS messages at boot.  However
we want to deprecate this device in RHEL 9.  (Unfortunately
it has already been removed.)

There is a new alternative to this:

 -machine graphics=off

which makes seabios direct all messages to the serial port.

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

libguestfs-1.45.6-12.el9.x86_64

How reproducible:

?

Steps to Reproduce:
1. export LIBGUESTFS_BACKEND=direct
2. libguestfs-test-tool

See if the BIOS messages appear in the output, eg:

  SGABIOS $Id$ (mockbuild@) Fri Apr 16 19:26:02 UTC 2021
  Term: 80x24
  4 0
  SeaBIOS (version 1.14.0-5.el9)
  Booting from ROM...

If they are not present then that's a problem.

Comment 4 YongkuiGuo 2021-09-14 06:27:21 UTC
1. Test with libguestfs-1.45.6-12.el9:

# LIBGUESTFS_BACKEND=direct libguestfs-test-tool
...
/usr/libexec/qemu-kvm \
    -global virtio-blk-pci.scsi=off \
    -no-user-config \
    -nodefaults \
    -display none \
    -machine accel=kvm:tcg \
    -cpu max \
    -m 1280 \
    -no-reboot \
    -rtc driftfix=slew \
    -no-hpet \
    -global kvm-pit.lost_tick_policy=discard \
    -kernel /var/tmp/.guestfs-0/appliance.d/kernel \
    -initrd /var/tmp/.guestfs-0/appliance.d/initrd \
    -object rng-random,filename=/dev/urandom,id=rng0 \
    -device virtio-rng-pci,rng=rng0 \
    -device virtio-scsi-pci,id=scsi \
    -drive file=/tmp/libguestfs9ahDOj/scratch1.img,cache=unsafe,format=raw,id=hd0,if=none \
    -device scsi-hd,drive=hd0 \
    -drive file=/var/tmp/.guestfs-0/appliance.d/root,snapshot=on,id=appliance,cache=unsafe,if=none,format=raw \
    -device scsi-hd,drive=appliance \
    -device virtio-serial-pci \
    -serial stdio \
    -device sga \
    -chardev socket,path=/tmp/libguestfs7MA7a6/guestfsd.sock,id=channel0 \
    -device virtserialport,chardev=channel0,name=org.libguestfs.channel.0 \
    -append "panic=1 console=ttyS0 edd=off udevtimeout=6000 udev.event-timeout=6000 no_timer_check printk.time=1 cgroup_disable=memory usbcore.nousb cryptomgr.notests tsc=reliable 8250.nr_uarts=1 root=UUID=2397a64b-b6ac-4e5b-9987-cbfde4dca4be selinux=0 guestfs_verbose=1 TERM=xterm-256color"
Could not open option rom 'sgabios.bin': No such file or directory
[    0.000000] Linux version 5.14.0-1.el9.x86_64 (mockbuild.eng.bos.redhat.com) (gcc (GCC) 11.2.1 20210728 (Red Hat 11.2.1-2), GNU ld version 2.35.2-9.el9) #1 SMP Mon Aug 30 21:21:29 EDT 2021
...

2. Verify with libguestfs-1.45.6-13.el9

# LIBGUESTFS_BACKEND=direct libguestfs-test-tool

...
/usr/libexec/qemu-kvm \
    -global virtio-blk-pci.scsi=off \
    -no-user-config \
    -nodefaults \
    -display none \
    -machine accel=kvm:tcg,graphics=off \
    -cpu max \
    -m 1280 \
    -no-reboot \
    -rtc driftfix=slew \
    -no-hpet \
    -global kvm-pit.lost_tick_policy=discard \
    -kernel /var/tmp/.guestfs-0/appliance.d/kernel \
    -initrd /var/tmp/.guestfs-0/appliance.d/initrd \
    -object rng-random,filename=/dev/urandom,id=rng0 \
    -device virtio-rng-pci,rng=rng0 \
    -device virtio-scsi-pci,id=scsi \
    -drive file=/tmp/libguestfsQp1dMu/scratch1.img,cache=unsafe,format=raw,id=hd0,if=none \
    -device scsi-hd,drive=hd0 \
    -drive file=/var/tmp/.guestfs-0/appliance.d/root,snapshot=on,id=appliance,cache=unsafe,if=none,format=raw \
    -device scsi-hd,drive=appliance \
    -device virtio-serial-pci \
    -serial stdio \
    -chardev socket,path=/tmp/libguestfsdqveLY/guestfsd.sock,id=channel0 \
    -device virtserialport,chardev=channel0,name=org.libguestfs.channel.0 \
    -append "panic=1 console=ttyS0 edd=off udevtimeout=6000 udev.event-timeout=6000 no_timer_check printk.time=1 cgroup_disable=memory usbcore.nousb cryptomgr.notests tsc=reliable 8250.nr_uarts=1 root=UUID=fecbf277-aa85-4ad0-9777-cfedb39300e5 selinux=0 guestfs_verbose=1 TERM=xterm-256color"
\x1bc\x1b[?7l\x1b[2J\x1b[0mSeaBIOS (version 1.14.0-6.el9)
Booting from ROM..\x1bc\x1b[?7l\x1b[2J[    0.000000] Linux version 5.14.0-1.el9.x86_64 (mockbuild.eng.bos.redhat.com) (gcc (GCC) 11.2.1 20210728 (Red Hat 11.2.1-2), GNU ld version 2.35.2-9.el9) #1 SMP Mon Aug 30 21:21:29 EDT 2021

Comment 6 errata-xmlrpc 2022-05-17 12:28:37 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: libguestfs), 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:2317