mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-25 22:15:20 +00:00
cpu_s390: Implement virCPUValidateFeatures
Only feature policy is checked on s390, which was previously done in virCPUUpdate, but that's not the correct place for the check once we have virCPUValidateFeatures. Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
This commit is contained in:
parent
3f0193f7e5
commit
20edbad776
@ -78,14 +78,6 @@ virCPUs390Update(virCPUDefPtr guest,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
for (i = 0; i < guest->nfeatures; i++) {
|
for (i = 0; i < guest->nfeatures; i++) {
|
||||||
if (guest->features[i].policy == VIR_CPU_FEATURE_OPTIONAL) {
|
|
||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
|
||||||
_("only cpu feature policies 'require' and "
|
|
||||||
"'disable' are supported for %s"),
|
|
||||||
guest->features[i].name);
|
|
||||||
goto cleanup;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (virCPUDefUpdateFeature(updated,
|
if (virCPUDefUpdateFeature(updated,
|
||||||
guest->features[i].name,
|
guest->features[i].name,
|
||||||
guest->features[i].policy) < 0)
|
guest->features[i].policy) < 0)
|
||||||
@ -102,6 +94,26 @@ virCPUs390Update(virCPUDefPtr guest,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static int
|
||||||
|
virCPUs390ValidateFeatures(virCPUDefPtr cpu)
|
||||||
|
{
|
||||||
|
size_t i;
|
||||||
|
|
||||||
|
for (i = 0; i < cpu->nfeatures; i++) {
|
||||||
|
if (cpu->features[i].policy == VIR_CPU_FEATURE_OPTIONAL) {
|
||||||
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||||
|
_("only cpu feature policies 'require' and "
|
||||||
|
"'disable' are supported for %s"),
|
||||||
|
cpu->features[i].name);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
struct cpuArchDriver cpuDriverS390 = {
|
struct cpuArchDriver cpuDriverS390 = {
|
||||||
.name = "s390",
|
.name = "s390",
|
||||||
.arch = archs,
|
.arch = archs,
|
||||||
@ -111,4 +123,5 @@ struct cpuArchDriver cpuDriverS390 = {
|
|||||||
.encode = NULL,
|
.encode = NULL,
|
||||||
.baseline = NULL,
|
.baseline = NULL,
|
||||||
.update = virCPUs390Update,
|
.update = virCPUs390Update,
|
||||||
|
.validateFeatures = virCPUs390ValidateFeatures,
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user