mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 13:45:38 +00:00
qemu: Validate capabilities for virtio-iommu
Signed-off-by: Andrea Bolognani <abologna@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
d8072c0015
commit
28ddd917be
@ -4874,6 +4874,14 @@ qemuValidateDomainDeviceDefIOMMU(const virDomainIOMMUDef *iommu,
|
||||
virDomainIOMMUModelTypeToString(iommu->model));
|
||||
return -1;
|
||||
}
|
||||
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_IOMMU_PCI) ||
|
||||
!virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_IOMMU_BOOT_BYPASS)) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("IOMMU device: '%s' is not supported with "
|
||||
"this QEMU binary"),
|
||||
virDomainIOMMUModelTypeToString(iommu->model));
|
||||
return -1;
|
||||
}
|
||||
break;
|
||||
|
||||
case VIR_DOMAIN_IOMMU_MODEL_LAST:
|
||||
|
@ -0,0 +1 @@
|
||||
unsupported configuration: IOMMU device: 'virtio' is not supported with this QEMU binary
|
@ -3248,6 +3248,7 @@ mymain(void)
|
||||
DO_TEST_CAPS_LATEST_PARSE_ERROR("intel-iommu-wrong-machine");
|
||||
DO_TEST_CAPS_ARCH_LATEST("iommu-smmuv3", "aarch64");
|
||||
DO_TEST_CAPS_LATEST("virtio-iommu-x86_64");
|
||||
DO_TEST_CAPS_VER_PARSE_ERROR("virtio-iommu-x86_64", "6.1.0");
|
||||
DO_TEST_CAPS_ARCH_LATEST("virtio-iommu-aarch64", "aarch64");
|
||||
DO_TEST_CAPS_LATEST_PARSE_ERROR("virtio-iommu-wrong-machine");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user