libvirt/3a276c65-conf-iommu-def-stability-check.patch

50 lines
1.8 KiB
Diff
Raw Normal View History

commit 3a276c6524026b661ed7bee4539fc5387b963611
Author: Ján Tomko <jtomko@redhat.com>
Date: Fri May 12 16:59:09 2017 +0200
conf: split out virDomainIOMMUDefCheckABIStability
Index: libvirt-3.3.0/src/conf/domain_conf.c
===================================================================
--- libvirt-3.3.0.orig/src/conf/domain_conf.c
+++ libvirt-3.3.0/src/conf/domain_conf.c
@@ -19819,6 +19819,22 @@ virDomainMemoryDefCheckABIStability(virD
static bool
+virDomainIOMMUDefCheckABIStability(virDomainIOMMUDefPtr src,
+ virDomainIOMMUDefPtr dst)
+{
+ if (src->model != dst->model) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("Target domain IOMMU device model '%s' "
+ "does not match source '%s'"),
+ virDomainIOMMUModelTypeToString(dst->model),
+ virDomainIOMMUModelTypeToString(src->model));
+ return false;
+ }
+ return true;
+}
+
+
+static bool
virDomainDefVcpuCheckAbiStability(virDomainDefPtr src,
virDomainDefPtr dst)
{
@@ -20284,14 +20300,8 @@ virDomainDefCheckABIStabilityFlags(virDo
}
if (src->iommu &&
- src->iommu->model != dst->iommu->model) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("Target domain IOMMU device model '%s' "
- "does not match source '%s'"),
- virDomainIOMMUModelTypeToString(dst->iommu->model),
- virDomainIOMMUModelTypeToString(src->iommu->model));
+ !virDomainIOMMUDefCheckABIStability(src->iommu, dst->iommu))
goto error;
- }
/* Coverity is not very happy with this - all dead_error_condition */
#if !STATIC_ANALYSIS