mirror of https://gitee.com/openkylin/libvirt.git
conf: Validate VIR_DOMAIN_FEATURE_CAPABILITIES properly
Unlike most other features, VIR_DOMAIN_FEATURE_CAPABILITIES is of type virDomainCapabilitiesPolicy instead of virTristateSwitch, so we need to handle it separately for the error message to make sense. Signed-off-by: Andrea Bolognani <abologna@redhat.com> Reviewed-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
parent
a975c95967
commit
5307206474
|
@ -21336,7 +21336,6 @@ virDomainDefFeaturesCheckABIStability(virDomainDefPtr src,
|
|||
case VIR_DOMAIN_FEATURE_HYPERV:
|
||||
case VIR_DOMAIN_FEATURE_KVM:
|
||||
case VIR_DOMAIN_FEATURE_PVSPINLOCK:
|
||||
case VIR_DOMAIN_FEATURE_CAPABILITIES:
|
||||
case VIR_DOMAIN_FEATURE_PMU:
|
||||
case VIR_DOMAIN_FEATURE_VMPORT:
|
||||
case VIR_DOMAIN_FEATURE_GIC:
|
||||
|
@ -21355,6 +21354,20 @@ virDomainDefFeaturesCheckABIStability(virDomainDefPtr src,
|
|||
}
|
||||
break;
|
||||
|
||||
case VIR_DOMAIN_FEATURE_CAPABILITIES:
|
||||
if (src->features[i] != dst->features[i]) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("State of feature '%s' differs: "
|
||||
"source: '%s=%s', destination: '%s=%s'"),
|
||||
featureName,
|
||||
"policy",
|
||||
virDomainCapabilitiesPolicyTypeToString(src->features[i]),
|
||||
"policy",
|
||||
virDomainCapabilitiesPolicyTypeToString(dst->features[i]));
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
||||
case VIR_DOMAIN_FEATURE_LAST:
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue