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 26990c4d6d..4d6bf906fb 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 15228d1e38..5102857d5e 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -1267,6 +1267,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 4624bad1f7..486f2f7a2e 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -2703,6 +2703,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 74e5bac7a2..41e487d056 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -6564,6 +6564,9 @@ qemuBuildIOMMUCommandLine(virCommand *cmd,
return 0;
+ 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;
@@ -7159,6 +7162,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 3045e4b64b..bd4c7b2cd7 100644
--- a/src/qemu/qemu_validate.c
+++ b/src/qemu/qemu_validate.c
@@ -4869,6 +4869,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