[libvirt] [PATCH 4/4] conf: validate IOMMU interrupt remapping setting

Ján Tomko jtomko at redhat.com
Tue Aug 29 16:48:16 UTC 2017


This option requires:
  <ioapic driver='qemu'/>
Report an error in case someone tries to combine
it with different ioapic setting.

Setting 'eim' on without enabling 'intremap' does not make sense.

https://bugzilla.redhat.com/show_bug.cgi?id=1457610
---
 src/conf/domain_conf.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index a26731e75..fd236f5d2 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -5551,6 +5551,24 @@ virDomainDefValidateInternal(const virDomainDef *def)
     if (virDomainDefGetVcpusTopology(def, NULL) < 0)
         return -1;
 
+    if (def->iommu &&
+        def->iommu->intremap == VIR_TRISTATE_SWITCH_ON &&
+        (def->features[VIR_DOMAIN_FEATURE_IOAPIC] != VIR_TRISTATE_SWITCH_ON ||
+         def->ioapic != VIR_DOMAIN_IOAPIC_QEMU)) {
+        virReportError(VIR_ERR_XML_ERROR, "%s",
+                       _("IOMMU interrupt remapping requires split I/O APIC "
+                         "(ioapic driver='qemu')"));
+        return -1;
+    }
+
+    if (def->iommu &&
+        def->iommu->eim == VIR_TRISTATE_SWITCH_ON &&
+        def->iommu->intremap != VIR_TRISTATE_SWITCH_ON) {
+        virReportError(VIR_ERR_XML_ERROR, "%s",
+                       _("IOMMU eim requires interrupt remapping to be enabled"));
+        return -1;
+    }
+
     return 0;
 }
 
-- 
2.13.0




More information about the libvir-list mailing list