Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 2111567

Summary: EDK2 build stuck with qemu-kvm-7.0.0-8.el9 or newer
Product: Red Hat Enterprise Linux 9 Reporter: Miroslav Rezanina <mrezanin>
Component: edk2Assignee: Miroslav Rezanina <mrezanin>
Status: CLOSED ERRATA QA Contact: Xueqiang Wei <xuwei>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 9.1CC: berrange, coli, jinzhao, juzhang, kraxel, pbonzini, virt-maint, yfu
Target Milestone: rcKeywords: Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: edk2-20220526git16779ede2d36-3.el9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-11-15 09:56:33 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:

Description Miroslav Rezanina 2022-07-27 13:43:29 UTC
Description of problem:
-----------------------
When running EDK2 build using qemu-kvm-7.0.0-8.el9 or newer, ovmf-vars-generator script ends in loop and never ends. This behavior is probably related to changes related to deprecated cpu handling.

Version-Release number of selected component (if applicable):
-------------------------------------------------------------
qemu-kvm-7.0.0-8.el9

How reproducible:
-----------------
Run EDK2 rpm build.

Actual results:
---------------
Build is stucked and never finishes.

Expected results:
-----------------
Build successfully finishes.

Comment 1 Daniel Berrangé 2022-07-27 13:50:42 UTC
> This behavior is probably related to changes related to deprecated cpu handling

It shouldn't do - those changes didn't have any functional effect on usage of QEMU beyond printing a message on stderr if a deprecated CPU is used.

Comment 2 Daniel Berrangé 2022-07-27 13:54:40 UTC
(In reply to Daniel Berrangé from comment #1)
> > This behavior is probably related to changes related to deprecated cpu handling
> 
> It shouldn't do - those changes didn't have any functional effect on usage
> of QEMU beyond printing a message on stderr if a deprecated CPU is used.

Having said that  'ovmf-vars-generator' appears to be parsing stdout/stderr, so may in fact be impacted.

I'd suggest modifying the script to pass '-cpu max' to see if that helps.

Comment 4 Oliver Steffen 2022-07-27 15:43:19 UTC
'ovmf-vars-generator' runs qemu as a 'subprocess' and uses 'subprocess.stdout.readline()' to look at the output.
If the subprocess quits unexpectedly, it can happen that 'readline()' blocks forever.
Often, this is handled like this:

  while proc.poll() is None:
      data = proc.stdout.readline()
      ...

I would be good if 'ovmf-vars-generator' would detect if qemu stopps early and also report
this via its return code.

Comment 13 Yanan Fu 2022-08-02 14:04:36 UTC
QE bot(pre verify): Set 'Verified:Tested,SanityOnly' as gating/tier1 test pass.

Comment 16 Xueqiang Wei 2022-08-05 10:12:39 UTC
Failed to build edk2-ovmf-20220526git16779ede2d36-2.el9

# rpmbuild -bb edk2.spec
......
......
+SqIs/vdWGA40O3SFdzET14m2k=' --skip-testing Build/Ovmf3264/DEBUG_GCC5/FV/OVMF_VARS.secboot.fd
DEBUG:root:Temp output: /tmp/qosb.03nh_3vy.vars
INFO:root:Starting enrollment
INFO:root:Performing enrollment

Never finishes.



Build edk2-ovmf-20220526git16779ede2d36-3.el9 successfully.

# rpmbuild -bb edk2.spec
......
......
Wrote: /root/rpmbuild/RPMS/noarch/edk2-tools-doc-20220526git16779ede2d36-3.el9.noarch.rpm
Wrote: /root/rpmbuild/RPMS/x86_64/edk2-tools-20220526git16779ede2d36-3.el9.x86_64.rpm
Wrote: /root/rpmbuild/RPMS/noarch/edk2-ovmf-20220526git16779ede2d36-3.el9.noarch.rpm
Wrote: /root/rpmbuild/RPMS/x86_64/edk2-tools-debuginfo-20220526git16779ede2d36-3.el9.x86_64.rpm
Wrote: /root/rpmbuild/RPMS/x86_64/edk2-debugsource-20220526git16779ede2d36-3.el9.x86_64.rpm
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.PvXUaE
+ umask 022
+ cd /root/rpmbuild/BUILD
+ cd edk2-16779ede2d36
+ /usr/bin/rm -rf /root/rpmbuild/BUILDROOT/edk2-20220526git16779ede2d36-3.el9.x86_64
+ RPM_EC=0
++ jobs -p
+ exit 0

Comment 19 Xueqiang Wei 2022-08-09 08:06:38 UTC
According to Comment 15 and Comment 16, set status to VERIFIED. Thanks.

Comment 21 errata-xmlrpc 2022-11-15 09:56:33 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 (edk2 bug fix and enhancement update), 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/RHEA-2022:7971