Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
Reviewed-by: Ján Tomko <jtomko(a)redhat.com>
---
src/conf/domain_conf.c | 1 +
src/conf/domain_conf.h | 1 +
src/conf/schemas/domaincommon.rng | 1 +
src/qemu/qemu_command.c | 4 ++++
src/qemu/qemu_domain_address.c | 6 ++++++
src/qemu/qemu_validate.c | 3 +++
6 files changed, 16 insertions(+)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index ba8dd7d7d0..2295d73ff2 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -1287,6 +1287,7 @@ VIR_ENUM_IMPL(virDomainIOMMUModel,
VIR_DOMAIN_IOMMU_MODEL_LAST,
"intel",
"smmuv3",
+ "virtio",
);
VIR_ENUM_IMPL(virDomainVsockModel,
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index c58fe3cb0f..bad0004b3c 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -2755,6 +2755,7 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(virDomainSecDef,
virDomainSecDefFree);
typedef enum {
VIR_DOMAIN_IOMMU_MODEL_INTEL,
VIR_DOMAIN_IOMMU_MODEL_SMMUV3,
+ VIR_DOMAIN_IOMMU_MODEL_VIRTIO,
VIR_DOMAIN_IOMMU_MODEL_LAST
} virDomainIOMMUModel;
diff --git a/src/conf/schemas/domaincommon.rng b/src/conf/schemas/domaincommon.rng
index 3326946842..3951ef3e04 100644
--- a/src/conf/schemas/domaincommon.rng
+++ b/src/conf/schemas/domaincommon.rng
@@ -5457,6 +5457,7 @@
<choice>
<value>intel</value>
<value>smmuv3</value>
+ <value>virtio</value>
</choice>
</attribute>
<optional>
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 9180d5c317..a6d4bb1cb1 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -6451,6 +6451,9 @@ qemuBuildIOMMUCommandLine(virCommand *cmd,
return 0;
+ case VIR_DOMAIN_IOMMU_MODEL_VIRTIO:
+ return 0;
+
case VIR_DOMAIN_IOMMU_MODEL_SMMUV3:
/* There is no -device for SMMUv3, so nothing to be done here */
return 0;
@@ -7037,6 +7040,7 @@ qemuBuildMachineCommandLine(virCommand *cmd,
break;
case VIR_DOMAIN_IOMMU_MODEL_INTEL:
+ case VIR_DOMAIN_IOMMU_MODEL_VIRTIO:
/* These IOMMUs are formatted in qemuBuildIOMMUCommandLine */
break;
diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c
index 6ca6fa54a3..205610c53e 100644
--- a/src/qemu/qemu_domain_address.c
+++ b/src/qemu/qemu_domain_address.c
@@ -1004,6 +1004,9 @@ qemuDomainDeviceCalculatePCIConnectFlags(virDomainDeviceDef *dev,
case VIR_DOMAIN_DEVICE_IOMMU:
switch ((virDomainIOMMUModel) dev->data.iommu->model) {
+ case VIR_DOMAIN_IOMMU_MODEL_VIRTIO:
+ return 0;
+
case VIR_DOMAIN_IOMMU_MODEL_INTEL:
case VIR_DOMAIN_IOMMU_MODEL_SMMUV3:
case VIR_DOMAIN_IOMMU_MODEL_LAST:
@@ -2382,6 +2385,9 @@ qemuDomainAssignDevicePCISlots(virDomainDef *def,
virDomainIOMMUDef *iommu = def->iommu;
switch ((virDomainIOMMUModel) iommu->model) {
+ case VIR_DOMAIN_IOMMU_MODEL_VIRTIO:
+ break;
+
case VIR_DOMAIN_IOMMU_MODEL_INTEL:
case VIR_DOMAIN_IOMMU_MODEL_SMMUV3:
case VIR_DOMAIN_IOMMU_MODEL_LAST:
diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c
index e0708b8a76..f2548a31ae 100644
--- a/src/qemu/qemu_validate.c
+++ b/src/qemu/qemu_validate.c
@@ -4865,6 +4865,9 @@ qemuValidateDomainDeviceDefIOMMU(const virDomainIOMMUDef *iommu,
}
break;
+ case VIR_DOMAIN_IOMMU_MODEL_VIRTIO:
+ break;
+
case VIR_DOMAIN_IOMMU_MODEL_LAST:
default:
virReportEnumRangeError(virDomainIOMMUModel, iommu->model);
--
2.35.1