提交 90cd99a4 编写于 作者: J Ján Tomko

conf: validate IOMMU interrupt remapping setting

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
上级 190a5bc1
......@@ -5575,6 +5575,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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册