From 0a24331c6ede568a05468c53644396585ec6ba24 Mon Sep 17 00:00:00 2001 From: Jiri Denemark Date: Tue, 12 Nov 2019 15:27:45 +0100 Subject: [PATCH] cpu_s390: Don't check match attribute for host-model CPUs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The match attribute is only relevant for custom mode CPUs. Reporting failure when match == 'minimum' regardless on CPU mode can cause unexpected failures. We should only report the error for custom CPUs. In fact, calling virCPUs390Update on a custom mode CPU should always report an error as optional features are not supported on s390 either. Signed-off-by: Jiri Denemark Reviewed-by: Ján Tomko --- src/cpu/cpu_s390.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/cpu/cpu_s390.c b/src/cpu/cpu_s390.c index a4a381f4b8..dd030c5a11 100644 --- a/src/cpu/cpu_s390.c +++ b/src/cpu/cpu_s390.c @@ -49,15 +49,15 @@ virCPUs390Update(virCPUDefPtr guest, int ret = -1; size_t i; - if (guest->match == VIR_CPU_MATCH_MINIMUM) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("match mode %s not supported"), - virCPUMatchTypeToString(guest->match)); - goto cleanup; - } - - if (guest->mode != VIR_CPU_MODE_HOST_MODEL) { - ret = 0; + if (guest->mode == VIR_CPU_MODE_CUSTOM) { + if (guest->match == VIR_CPU_MATCH_MINIMUM) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("match mode %s not supported"), + virCPUMatchTypeToString(guest->match)); + } else { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("optional CPU features are not supported")); + } goto cleanup; } -- GitLab