1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-22 17:34:18 +03:00

qemu: validate machine virt ras feature

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Kristina Hanicova 2024-04-30 16:32:38 +02:00 committed by Ján Tomko
parent aaf4196843
commit a43007b3c4

View File

@ -69,6 +69,7 @@ qemuValidateDomainDefPSeriesFeature(const virDomainDef *def,
case VIR_DOMAIN_FEATURE_HTM:
case VIR_DOMAIN_FEATURE_NESTED_HV:
case VIR_DOMAIN_FEATURE_CCF_ASSIST:
case VIR_DOMAIN_FEATURE_RAS:
if (!virTristateSwitchTypeToString(def->features[feature])) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("Invalid setting for pseries feature '%1$s'"),
@ -227,6 +228,20 @@ qemuValidateDomainDefFeatures(const virDomainDef *def,
break;
case VIR_DOMAIN_FEATURE_RAS:
if (def->features[i] != VIR_TRISTATE_SWITCH_ABSENT &&
!qemuDomainIsARMVirt(def)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("ras feature is only supported with ARM Virt machines"));
return -1;
}
if (def->features[i] != VIR_TRISTATE_SWITCH_ABSENT &&
!virQEMUCapsGet(qemuCaps, QEMU_CAPS_MACHINE_VIRT_RAS)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("ras feature is not available with this QEMU binary"));
return -1;
}
break;
case VIR_DOMAIN_FEATURE_SMM:
case VIR_DOMAIN_FEATURE_KVM:
case VIR_DOMAIN_FEATURE_XEN: