mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 03:12:22 +00:00
qemu: Assign PCI address to virtio-iommu
The device is configured to be an integrated endpoint, as is necessary for it to function correctly. Signed-off-by: Andrea Bolognani <abologna@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
b0eb1e193f
commit
f119336162
@ -1005,7 +1005,7 @@ qemuDomainDeviceCalculatePCIConnectFlags(virDomainDeviceDef *dev,
|
||||
case VIR_DOMAIN_DEVICE_IOMMU:
|
||||
switch ((virDomainIOMMUModel) dev->data.iommu->model) {
|
||||
case VIR_DOMAIN_IOMMU_MODEL_VIRTIO:
|
||||
return 0;
|
||||
return virtioFlags | VIR_PCI_CONNECT_INTEGRATED;
|
||||
|
||||
case VIR_DOMAIN_IOMMU_MODEL_INTEL:
|
||||
case VIR_DOMAIN_IOMMU_MODEL_SMMUV3:
|
||||
@ -2386,6 +2386,10 @@ qemuDomainAssignDevicePCISlots(virDomainDef *def,
|
||||
|
||||
switch ((virDomainIOMMUModel) iommu->model) {
|
||||
case VIR_DOMAIN_IOMMU_MODEL_VIRTIO:
|
||||
if (virDeviceInfoPCIAddressIsWanted(&iommu->info) &&
|
||||
qemuDomainPCIAddressReserveNextAddr(addrs, &iommu->info) < 0) {
|
||||
return -1;
|
||||
}
|
||||
break;
|
||||
|
||||
case VIR_DOMAIN_IOMMU_MODEL_INTEL:
|
||||
|
@ -27,6 +27,8 @@
|
||||
<controller type='pci' index='0' model='pcie-root'/>
|
||||
<audio id='1' type='none'/>
|
||||
<memballoon model='none'/>
|
||||
<iommu model='virtio'/>
|
||||
<iommu model='virtio'>
|
||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
|
||||
</iommu>
|
||||
</devices>
|
||||
</domain>
|
||||
|
@ -29,6 +29,8 @@
|
||||
<input type='keyboard' bus='ps2'/>
|
||||
<audio id='1' type='none'/>
|
||||
<memballoon model='none'/>
|
||||
<iommu model='virtio'/>
|
||||
<iommu model='virtio'>
|
||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
|
||||
</iommu>
|
||||
</devices>
|
||||
</domain>
|
||||
|
Loading…
x
Reference in New Issue
Block a user