Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
docs/schemas/domaincommon.rng | 1 +
src/conf/domain_conf.c | 1 +
src/conf/domain_conf.h | 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/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index ec5bd91740..2f30b15c48 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -5415,6 +5415,7 @@
<choice>
<value>intel</value>
<value>smmuv3</value>
+ <value>virtio</value>
</choice>
</attribute>
<optional>
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 6df981ad47..a2d155069f 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -1261,6 +1261,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 72db861105..21e069f42e 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -2696,6 +2696,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/qemu/qemu_command.c b/src/qemu/qemu_command.c
index bb743e3d84..ef5ebe6413 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -6238,6 +6238,9 @@ qemuBuildIOMMUCommandLine(virCommand *cmd,
virCommandAddArgBuffer(cmd, &opts);
break;
+ case VIR_DOMAIN_IOMMU_MODEL_VIRTIO:
+ break;
+
case VIR_DOMAIN_IOMMU_MODEL_SMMUV3:
/* There is no -device for SMMUv3, so nothing to be done here */
return 0;
@@ -6851,6 +6854,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 733fa35444..e23de3bb83 100644
--- a/src/qemu/qemu_domain_address.c
+++ b/src/qemu/qemu_domain_address.c
@@ -1003,6 +1003,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 c84508cb64..4646cd2af3 100644
--- a/src/qemu/qemu_validate.c
+++ b/src/qemu/qemu_validate.c
@@ -4797,6 +4797,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.31.1