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.
Description of problem:
virtio-iommu device cannot generate alias element and customized alias will not work for virtio-iommu
Version-Release number of selected component (if applicable):
libvirt-8.5.0-2.el9.x86_64
qemu-kvm-7.0.0-9.el9.x86_64
How reproducible:
100%
Steps to Reproduce:
Test1: Check the auto-assigned alias for virtio-iommu:
1. Start a q35 VM with virtio-iommu:
...
<iommu model="virtio"/>
...
2. Check the live XML and qemu command line of iommu:
➜ ~ virsh dumpxml rhel --xpath //iommu
<iommu model="virtio">
<address type="pci" domain="0x0000" bus="0x00" slot="0x03" function="0x0"/>
</iommu>
➜ ~ ps aux|grep iommu
... -device {"driver":"virtio-iommu","bus":"pcie.0","addr":"0x3"}
No <alias/> in live XML. No id in the properties of virtio-iommu.
Test2: Set customized alias for virtio-iommu:
1. Start a q35 VM with customized alias for virtio-iommu
...
<iommu model="virtio">
<alias name="ua-xx"/>
</iommu>
...
2. Check the live XML and qemu command line of iommu. Validate the live XML
➜ ~ virsh dumpxml rhel --xpath //iommu
<iommu model="virtio">
<alias name="ua-xx"/>
<address type="pci" domain="0x0000" bus="0x00" slot="0x03" function="0x0"/>
</iommu>
➜ ~ ps aux|grep iommu
... -device {"driver":"virtio-iommu","bus":"pcie.0","addr":"0x3"}
No id property for virtio-iommu.
➜ ~ virsh dumpxml rhel|virt-xml-validate -
Relax-NG validity error : Extra element devices in interleave
-:64: element devices: Relax-NG validity error : Element domain failed to validate content
- fails to validate
Validation failed.
Actual results:
As above
Expected results:
If no customized alias, libvirt will generate one for iommu and works for live XML and qemu command line. And customized alias of iommu will works. The XML validation will pass for virtio-iommu with alias.
Additional info:
try with intel_iommu can also hit this issue
steps to reproduce: same with the above Description
just change the model from "virtio" to "intel"
<iommu model="intel">
get the same error message:
Extra element devices in interleave
Element domain failed to validate content
Patches merged upstream.
commit 510540961417288a24d0870f0226f8255420c463
Author: Andrea Bolognani <abologna>
Date: Thu Jul 21 11:14:21 2022 +0200
qemu: Add IOMMU device alias to command line
Note that we can only do this for intel-iommu and virtio-iommu,
which are configured using -device; smmuv3 is configured using
a machine type property, so there's no room on the command line
for an alias in that case.
https://bugzilla.redhat.com/show_bug.cgi?id=2108483
Signed-off-by: Andrea Bolognani <abologna>
Reviewed-by: Michal Privoznik <mprivozn>
v8.5.0-172-g5105409614
Comment 4yalzhang@redhat.com
2022-09-16 01:51:26 UTC
Test on libvirt-8.7.0-1.el9.x86_64, the result is as expected, intel iommu also works fine.
1. start vm with a virtio iommu device
2. # virsh dumpxml rhel --xpath //iommu
<iommu model="virtio">
<alias name="iommu0"/>
<address type="pci" domain="0x0000" bus="0x00" slot="0x04" function="0x0"/>
</iommu>
3. # virsh dumpxml rhel|virt-xml-validate -
- validates
4. Try with customized alias:
# virsh dumpxml rhel --xpath //iommu
<iommu model="virtio">
<alias name="ua-b52d2352-5650-4546-9a22-9d685cf6ce23"/>
<address type="pci" domain="0x0000" bus="0x00" slot="0x04" function="0x0"/>
</iommu>
# virsh start rhel
Domain 'rhel' started
# virsh dumpxml rhel|virt-xml-validate -
- validates
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 (libvirt 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/RHBA-2023:2171
Description of problem: virtio-iommu device cannot generate alias element and customized alias will not work for virtio-iommu Version-Release number of selected component (if applicable): libvirt-8.5.0-2.el9.x86_64 qemu-kvm-7.0.0-9.el9.x86_64 How reproducible: 100% Steps to Reproduce: Test1: Check the auto-assigned alias for virtio-iommu: 1. Start a q35 VM with virtio-iommu: ... <iommu model="virtio"/> ... 2. Check the live XML and qemu command line of iommu: ➜ ~ virsh dumpxml rhel --xpath //iommu <iommu model="virtio"> <address type="pci" domain="0x0000" bus="0x00" slot="0x03" function="0x0"/> </iommu> ➜ ~ ps aux|grep iommu ... -device {"driver":"virtio-iommu","bus":"pcie.0","addr":"0x3"} No <alias/> in live XML. No id in the properties of virtio-iommu. Test2: Set customized alias for virtio-iommu: 1. Start a q35 VM with customized alias for virtio-iommu ... <iommu model="virtio"> <alias name="ua-xx"/> </iommu> ... 2. Check the live XML and qemu command line of iommu. Validate the live XML ➜ ~ virsh dumpxml rhel --xpath //iommu <iommu model="virtio"> <alias name="ua-xx"/> <address type="pci" domain="0x0000" bus="0x00" slot="0x03" function="0x0"/> </iommu> ➜ ~ ps aux|grep iommu ... -device {"driver":"virtio-iommu","bus":"pcie.0","addr":"0x3"} No id property for virtio-iommu. ➜ ~ virsh dumpxml rhel|virt-xml-validate - Relax-NG validity error : Extra element devices in interleave -:64: element devices: Relax-NG validity error : Element domain failed to validate content - fails to validate Validation failed. Actual results: As above Expected results: If no customized alias, libvirt will generate one for iommu and works for live XML and qemu command line. And customized alias of iommu will works. The XML validation will pass for virtio-iommu with alias. Additional info: