Bug 2101633
| Summary: | libvirt live xml shows options which qemu do not support, and no error msg in libvirtd.log | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 9 | Reporter: | yalzhang <yalzhang> |
| Component: | libvirt | Assignee: | Michal Privoznik <mprivozn> |
| libvirt sub component: | General | QA Contact: | yalzhang <yalzhang> |
| Status: | CLOSED ERRATA | Docs Contact: | |
| Severity: | unspecified | ||
| Priority: | unspecified | CC: | dzheng, jdenemar, lmen, mprivozn, smitterl, virt-maint, xuzhang, yicui |
| Version: | 9.1 | Keywords: | Triaged, Upstream |
| Target Milestone: | rc | Flags: | pm-rhel:
mirror+
|
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | libvirt-8.7.0-1.el9 | Doc Type: | If docs needed, set a value |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2023-05-09 07:26:34 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: | 8.7.0 |
| Embargoed: | |||
I'm not sure what's going on here. I mean, in the XML you have model='intel' but in the cmd line there's virtio-iommu. I could not reproduce this problem, can you share full domain XML please? Meanwhile, it's only virtio IOMMU that can have an <address/>, let me post patches for that. Improvements posted here: https://listman.redhat.com/archives/libvir-list/2022-July/232686.html Merged upstream as: 43e9d322be domain_validate: Disallow non-virtio IOMMU with an <address/> 92678703ce docs: Document <address/> for IOMMU device 4a9c86ee2f qemu_domain_address: Drop needless virDomainIOMMUModel typecast v8.5.0-50-g43e9d322be (In reply to Michal Privoznik from comment #1) > I'm not sure what's going on here. I mean, in the XML you have model='intel' > but in the cmd line there's virtio-iommu. I could not reproduce this > problem, can you share full domain XML please? Meanwhile, it's only virtio > IOMMU that can have an <address/>, let me post patches for that. Sorry, I must have copy-paste error there. I have updated the description in comment 0. # virsh dumpxml rhel <disk type='file' device='disk'> <driver name='qemu' type='qcow2' iommu='on' ats='on'/> <source file='/var/lib/libvirt/images/RHEL-9.1.0-20220518.1-x86_64-ovmf.qcow2' index='1'/> <backingStore/> <target dev='vda' bus='virtio'/> <boot order='1'/> <alias name='virtio-disk0'/> <address type='pci' domain='0x0000' bus='0x05' slot='0x00' function='0x0'/> </disk> <interface type='network'> <mac address='52:54:00:2b:f0:91'/> <source network='default' portid='28469d51-52ab-40f6-b40d-f1623a3d9df6' bridge='virbr0'/> <target dev='vnet12'/> <model type='virtio'/> <driver iommu='on' ats='on'/> <alias name='net0'/> <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0'/> </interface> ...... <iommu model='virtio'> <driver intremap='on' caching_mode='on' eim='on' iotlb='on'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/> </iommu> Related qemu cmd line: -device {"driver":"virtio-iommu","bus":"pcie.0","addr":"0x4"} -blockdev {"node-name":"libvirt-1-format","read-only":false,"driver":"qcow2","file":"libvirt-1-storage","backing":null} -device {"driver":"virtio-blk-pci","iommu_platform":true,"ats":true,"bus":"pci.5","addr":"0x0","drive":"libvirt-1-format","id":"virtio-disk0","bootindex":1} -netdev tap,fd=23,vhost=on,vhostfd=25,id=hostnet0 -device {"driver":"virtio-net-pci","iommu_platform":true,"ats":true,"netdev":"hostnet0","id":"net0","mac":"52:54:00:2b:f0:91","bus":"pci.3","addr":"0x0"} There is another qemu bug about the ats support(Bug 2101632) since virtio iommu do not support ats and device-iotlb. (In reply to Michal Privoznik from comment #1) > problem, can you share full domain XML please? Meanwhile, it's only virtio > IOMMU that can have an <address/>, let me post patches for that. Yes, from the test results, only virtio iommu will have an <address/>, intel iommu does not have an <address/>. Patches posted here: https://listman.redhat.com/archives/libvir-list/2022-July/232726.html commit c5bc752666ab0fc9799e7b9139e1035fe279e97f
Author: Michal Prívozník <mprivozn>
AuthorDate: Fri Jul 8 11:33:02 2022 +0200
Commit: Michal Prívozník <mprivozn>
CommitDate: Mon Aug 8 16:59:55 2022 +0200
conf: Check IOMMU for unsupported attributes
Currently, it's possible to pass various attributes to an IOMMU's
<driver/> element hoping that we enable them in underlying
hypervisor. However, depending on the IOMMU model, some of these
attributes can't be enabled and are simply ignored. This is
suboptimal and we should reject such configuration in the
validate phase.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2101633
Signed-off-by: Michal Privoznik <mprivozn>
Reviewed-by: Ján Tomko <jtomko>
v8.6.0-64-gc5bc752666
Test on libvirt-8.7.0-1.el9.x86_64, either of the attributes: 'intremap', 'caching_mode', 'eim', 'iotlb' or 'aw_bits' can not be validated, which is expected. # virsh edit rhel error: XML error: iommu model 'virtio' doesn't support additional attributes Failed. Try again? [y,n,i,f,?]: To define a vm with the unsupported attributes: # virsh define rhel.xml error: Failed to define domain from rhel.xml error: XML error: iommu model 'virtio' doesn't support additional attributes 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: libvirt live xml shows options which qemu do not support, and no error msg in libvirtd.log Version-Release number of selected component (if applicable): Host: libvirt-8.4.0-3.el9.x86_64 qemu-kvm-7.0.50-6.el9.wrb220615.x86_64 Guest: kernel-5.14.0-104.mr955_220602_1540.el9.x86_64 How reproducible: 100% Steps to Reproduce: 1. Configure the vm with virtio iommu and start the vm # virsh start rhel Domain 'rhel' started # virsh dumpxml rhel ... <iommu model='virtio'> <driver intremap='on' caching_mode='on' eim='on' iotlb='on'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/> </iommu> ...... 2. check the qemu cmd line, there is no options for the iommu device: # ps aux | grep iommu ... -device {"driver":"virtio-iommu","bus":"pcie.0","addr":"0x4"} ... Actual results: The libvirt set options are ignored since it is not supported, but there is no error msg in the log Expected results: There should be some error msg in the libvirtd.log, or libvirt should ignore the setting in the live xml Additional info: for intel iommu: <iommu model='intel'> <driver intremap='on' caching_mode='on' eim='on' iotlb='on'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/> </iommu> will end up with: -device {"driver":"intel-iommu","intremap":"on","caching-mode":true,"eim":"on","device-iotlb":true}