From nobody Thu May 15 17:38:51 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1505400253334818.1420267643588; Thu, 14 Sep 2017 07:44:13 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4ADCF285C1; Thu, 14 Sep 2017 14:44:12 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2AF185885E; Thu, 14 Sep 2017 14:44:12 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id E7A10180610F; Thu, 14 Sep 2017 14:44:11 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v8EEN9nT002067 for ; Thu, 14 Sep 2017 10:23:09 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7B6A16DA8A; Thu, 14 Sep 2017 14:23:09 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.105]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4FEBF6CDD1 for ; Thu, 14 Sep 2017 14:23:05 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 2D4111002D6; Thu, 14 Sep 2017 16:23:04 +0200 (CEST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 4ADCF285C1 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=libvir-list-bounces@redhat.com From: Jiri Denemark To: libvir-list@redhat.com Date: Thu, 14 Sep 2017 16:23:02 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: Mail-Followup-To: libvir-list@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 3/4] cpu_s390: Implement virCPUValidateFeatures X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Thu, 14 Sep 2017 14:44:12 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" 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 --- src/cpu/cpu_s390.c | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/src/cpu/cpu_s390.c b/src/cpu/cpu_s390.c index 2ef03367d7..3d10f920ba 100644 --- a/src/cpu/cpu_s390.c +++ b/src/cpu/cpu_s390.c @@ -78,14 +78,6 @@ virCPUs390Update(virCPUDefPtr guest, goto cleanup; =20 for (i =3D 0; i < guest->nfeatures; i++) { - if (guest->features[i].policy =3D=3D 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, guest->features[i].name, guest->features[i].policy) < 0) @@ -102,6 +94,26 @@ virCPUs390Update(virCPUDefPtr guest, return ret; } =20 + +static int +virCPUs390ValidateFeatures(virCPUDefPtr cpu) +{ + size_t i; + + for (i =3D 0; i < cpu->nfeatures; i++) { + if (cpu->features[i].policy =3D=3D 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 =3D { .name =3D "s390", .arch =3D archs, @@ -111,4 +123,5 @@ struct cpuArchDriver cpuDriverS390 =3D { .encode =3D NULL, .baseline =3D NULL, .update =3D virCPUs390Update, + .validateFeatures =3D virCPUs390ValidateFeatures, }; --=20 2.14.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list