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.
+++ This bug was initially created as a clone of Bug #1969347 +++
Description of problem:
Failed to start ovmf guest for the second time
Version-Release number of selected component (if applicable):
libvirt-7.4.0-1.el9.x86_64
qemu-kvm-6.0.0-3.el9.x86_64
How reproducible:
100%
1. Start a ovmf guest with the following xml:
...
<os>
<type arch='x86_64' machine='pc-q35-rhel8.4.0'>hvm</type>
<loader readonly='yes' secure='yes' type='pflash'>/usr/share/edk2/ovmf/OVMF_CODE.secboot.fd</loader>
<nvram>/var/lib/libvirt/qemu/nvram/avocado-vt-vm1_VARS.fd</nvram>
<boot dev='hd'/>
</os>
...
# virsh start avocado-vt-vm1
Domain 'avocado-vt-vm1' started
# getfattr -n trusted.libvirt.security.ref_selinux /var/lib/libvirt/qemu/nvram/avocado-vt-vm1_VARS.fd
getfattr: Removing leading '/' from absolute path names
# file: var/lib/libvirt/qemu/nvram/avocado-vt-vm1_VARS.fd
trusted.libvirt.security.ref_selinux="2"
2. Destroy the guest and start again.
# virsh destroy avocado-vt-vm1
Domain 'avocado-vt-vm1' destroyed
# getfattr -n trusted.libvirt.security.ref_selinux /var/lib/libvirt/qemu/nvram/avocado-vt-vm1_VARS.fd
getfattr: Removing leading '/' from absolute path names
# file: var/lib/libvirt/qemu/nvram/avocado-vt-vm1_VARS.fd
trusted.libvirt.security.ref_selinux="1"
# virsh start avocado-vt-vm1
error: Failed to start domain 'avocado-vt-vm1'
error: Requested operation is not valid: Setting different SELinux label on /var/lib/libvirt/qemu/nvram/avocado-vt-vm1_VARS.fd which is already in use
# getfattr -n trusted.libvirt.security.ref_selinux /var/lib/libvirt/qemu/nvram/avocado-vt-vm1_VARS.fd
getfattr: Removing leading '/' from absolute path names
# file: var/lib/libvirt/qemu/nvram/avocado-vt-vm1_VARS.fd
trusted.libvirt.security.ref_selinux="1"
Actual results:
Can't start the guest for the second time
Expected results:
Can start the guest
Additional info:
Verified Version:
libvirt-7.5.0-1.el9.x86_64
qemu-kvm-6.0.0-9.el9.x86_64
Verified Steps:
1. Start a ovmf guest with the following os xml and rhel9 image:
...
<os>
<type arch='x86_64' machine='pc-q35-rhel8.5.0'>hvm</type>
<loader readonly='yes' type='pflash'>/usr/share/edk2/ovmf/OVMF_CODE.secboot.fd</loader>
<nvram template='/usr/share/edk2/ovmf/OVMF_VARS.fd'>/var/lib/libvirt/qemu/nvram/lmn_VARS.fd</nvram>
<boot dev='hd'/>
</os>
...
# virsh start lmn
Domain 'lmn' started
# virsh console lmn
Connected to domain 'lmn'
Escape character is ^] (Ctrl + ])
localhost login: root
Password:
[root@localhost ~]#
2. Destroy the guest and start the guest again.
# virsh destroy lmn
Domain 'lmn' destroyed
# virsh start lmn
Domain 'lmn' started
3. Check the boot of the guest.
# virsh console lmn
Connected to domain 'lmn'
Escape character is ^] (Ctrl + ])
localhost login: root
Password:
[root@localhost ~]#
4. Start a guest with the following os xml and an enrolled image
...
<os firmware='efi'>
<type arch='x86_64' machine='pc-q35-rhel8.5.0'>hvm</type>
<boot dev='hd'/>
</os>
...
# rm -rf /var/lib/libvirt/qemu/nvram/lmn_VARS.fd
# virsh start lmn
Domain 'lmn' started
# virsh console lmn
Connected to domain 'lmn'
Escape character is ^] (Ctrl + ])
localhost login: root
Password:
[root@localhost ~]#
5. Repeat the step 2-3.
All the test results are expected.