From nobody Thu May 15 04:07:08 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 151813125097571.13336090183543; Thu, 8 Feb 2018 15:07:30 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B02D68B101; Thu, 8 Feb 2018 23:07:28 +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 461A0608F7; Thu, 8 Feb 2018 23:07:28 +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 ABFBC18033DC; Thu, 8 Feb 2018 23:07:27 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w18N1sWv023549 for ; Thu, 8 Feb 2018 18:01:54 -0500 Received: by smtp.corp.redhat.com (Postfix) id ACC4F60C9C; Thu, 8 Feb 2018 23:01:54 +0000 (UTC) Received: from mx1.redhat.com (ext-mx04.extmail.prod.ext.phx2.redhat.com [10.5.110.28]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A432760CA2 for ; Thu, 8 Feb 2018 23:01:51 +0000 (UTC) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5B7608553C for ; Thu, 8 Feb 2018 23:01:50 +0000 (UTC) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 3A3AB20FBD; Thu, 8 Feb 2018 18:01:49 -0500 (EST) Received: from frontend1 ([10.202.2.160]) by compute7.internal (MEProxy); Thu, 08 Feb 2018 18:01:49 -0500 Received: from localhost.localdomain (ip5b40bfaa.dynamic.kabel-deutschland.de [91.64.191.170]) by mail.messagingengine.com (Postfix) with ESMTPA id 942AD7E3DF; Thu, 8 Feb 2018 18:01:48 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:in-reply-to :message-id:references:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; bh=8MmDrz2v1fcw3gD7g2uHiohLOSo1D ht1z8OAPCaFqxY=; b=ET/7odi1wbfMGhYLwlhXmh8JVwlqoC6i8IwYySzuUXmry LNjisa6Hr8deRgVGymRa+iS3Hd+8rm4ZE3DGXcENM+afZrJOs7wMplsAGzVxE1Nw rosCE0FxRBRuMchCDh4gjm/IRoLWMDM6hT/TGSL70cgSavJtcwRSZMlRx5exDzg1 dgNr13IZE69U375PZd/NmB/9sB9TYi60vDPh8tNsLb9uzfbNeMcptBtTetAWPn9k 7rOQXGwE+L3dszuBut7QMxfbzad8536kaMXsrxffdj2uUK5zQPYxUToZ+dNmHmtq 8Tc/7wIQN67TIckzqPdjKuLl/wuPRUe4GoNWzjrSg== X-ME-Sender: From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= To: libvir-list@redhat.com Date: Thu, 8 Feb 2018 23:58:56 +0100 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 207 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Thu, 08 Feb 2018 23:01:50 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Thu, 08 Feb 2018 23:01:50 +0000 (UTC) for IP:'66.111.4.26' DOMAIN:'out2-smtp.messagingengine.com' HELO:'out2-smtp.messagingengine.com' FROM:'marmarek@invisiblethingslab.com' RCPT:'' X-RedHat-Spam-Score: -0.72 (DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL) 66.111.4.26 out2-smtp.messagingengine.com 66.111.4.26 out2-smtp.messagingengine.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.28 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v4 3/8] libxl: error out on not supported CPU mode, instead of silently ignoring 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Thu, 08 Feb 2018 23:07:29 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This change make libvirt XML with plain element invalid for libxl, which affect not only upcoming CPUID support, but also NUMA. In fact, default mode 'custom' does not match what the driver actually does, so it was a bug. Adjust xenconfig driver accordingly. But nevertheless this commit break some configurations that were working before. --- Changes since v3: - fix vnuma tests (nested HVM implicitly enabled there) Changes since v2: - change separated from 'libxl: add support for CPUID features policy' --- src/libxl/libxl_conf.c | 10 ++++++++-- src/xenconfig/xen_xl.c | 1 +- tests/xlconfigdata/test-fullvirt-vnuma-autocomplete.cfg | 1 +- tests/xlconfigdata/test-fullvirt-vnuma-autocomplete.xml | 2 +- tests/xlconfigdata/test-fullvirt-vnuma-nodistances.cfg | 1 +- tests/xlconfigdata/test-fullvirt-vnuma-nodistances.xml | 2 +- tests/xlconfigdata/test-fullvirt-vnuma-partialdist.cfg | 1 +- tests/xlconfigdata/test-fullvirt-vnuma-partialdist.xml | 2 +- tests/xlconfigdata/test-fullvirt-vnuma.cfg | 1 +- tests/xlconfigdata/test-fullvirt-vnuma.xml | 2 +- 10 files changed, 17 insertions(+), 6 deletions(-) diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c index 8cced29..66956a7 100644 --- a/src/libxl/libxl_conf.c +++ b/src/libxl/libxl_conf.c @@ -355,11 +355,17 @@ libxlMakeDomBuildInfo(virDomainDefPtr def, def->features[VIR_DOMAIN_FEATURE_ACPI] =3D=3D VIR_TRISTATE_SWITCH_ON); =20 - if (caps && - def->cpu && def->cpu->mode =3D=3D (VIR_CPU_MODE_HOST_PASSTHROU= GH)) { + if (caps && def->cpu) { bool hasHwVirt =3D false; bool svm =3D false, vmx =3D false; =20 + if (def->cpu->mode !=3D VIR_CPU_MODE_HOST_PASSTHROUGH) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("unsupported cpu mode '%s'"), + virCPUModeTypeToString(def->cpu->mode)); + return -1; + } + if (ARCH_IS_X86(def->os.arch)) { vmx =3D virCPUCheckFeature(caps->host.arch, caps->host.cpu= , "vmx"); svm =3D virCPUCheckFeature(caps->host.arch, caps->host.cpu= , "svm"); diff --git a/src/xenconfig/xen_xl.c b/src/xenconfig/xen_xl.c index 2ef80eb..6cda305 100644 --- a/src/xenconfig/xen_xl.c +++ b/src/xenconfig/xen_xl.c @@ -494,6 +494,7 @@ xenParseXLVnuma(virConfPtr conf, goto cleanup; } =20 + cpu->mode =3D VIR_CPU_MODE_HOST_PASSTHROUGH; cpu->type =3D VIR_CPU_TYPE_GUEST; def->cpu =3D cpu; =20 diff --git a/tests/xlconfigdata/test-fullvirt-vnuma-autocomplete.cfg b/test= s/xlconfigdata/test-fullvirt-vnuma-autocomplete.cfg index edba69a..2c9de44 100644 --- a/tests/xlconfigdata/test-fullvirt-vnuma-autocomplete.cfg +++ b/tests/xlconfigdata/test-fullvirt-vnuma-autocomplete.cfg @@ -22,5 +22,6 @@ parallel =3D "none" serial =3D "none" builder =3D "hvm" boot =3D "d" +nestedhvm =3D 1 vnuma =3D [ [ "pnode=3D0", "size=3D2048", "vcpus=3D0,11", "vdistances=3D10= ,21,31,41,51,61" ], [ "pnode=3D1", "size=3D2048", "vcpus=3D1,10", "vdistanc= es=3D21,10,21,31,41,51" ], [ "pnode=3D2", "size=3D2048", "vcpus=3D2,9", "vd= istances=3D31,21,10,21,31,41" ], [ "pnode=3D3", "size=3D2048", "vcpus=3D3,8= ", "vdistances=3D41,31,21,10,21,31" ], [ "pnode=3D4", "size=3D2048", "vcpus= =3D4,7", "vdistances=3D51,41,31,21,10,21" ], [ "pnode=3D5", "size=3D2048", = "vcpus=3D5-6", "vdistances=3D61,51,41,31,21,10" ] ] disk =3D [ "format=3Draw,vdev=3Dhda,access=3Drw,backendtype=3Dphy,target= =3D/dev/HostVG/XenGuest2" ] diff --git a/tests/xlconfigdata/test-fullvirt-vnuma-autocomplete.xml b/test= s/xlconfigdata/test-fullvirt-vnuma-autocomplete.xml index e3639eb..3c486ad 100644 --- a/tests/xlconfigdata/test-fullvirt-vnuma-autocomplete.xml +++ b/tests/xlconfigdata/test-fullvirt-vnuma-autocomplete.xml @@ -14,7 +14,7 @@ - + diff --git a/tests/xlconfigdata/test-fullvirt-vnuma-nodistances.cfg b/tests= /xlconfigdata/test-fullvirt-vnuma-nodistances.cfg index 8186edf..ca8e5b0 100644 --- a/tests/xlconfigdata/test-fullvirt-vnuma-nodistances.cfg +++ b/tests/xlconfigdata/test-fullvirt-vnuma-nodistances.cfg @@ -22,5 +22,6 @@ parallel =3D "none" serial =3D "none" builder =3D "hvm" boot =3D "d" +nestedhvm =3D 1 vnuma =3D [ [ "pnode=3D0", "size=3D2048", "vcpus=3D0-1", "vdistances=3D10,= 20,20,20" ], [ "pnode=3D1", "size=3D2048", "vcpus=3D2-3", "vdistances=3D20,= 10,20,20" ], [ "pnode=3D2", "size=3D2048", "vcpus=3D4-5", "vdistances=3D20,= 20,10,20" ], [ "pnode=3D3", "size=3D2048", "vcpus=3D6-7", "vdistances=3D20,= 20,20,10" ] ] disk =3D [ "format=3Draw,vdev=3Dhda,access=3Drw,backendtype=3Dphy,target= =3D/dev/HostVG/XenGuest2" ] diff --git a/tests/xlconfigdata/test-fullvirt-vnuma-nodistances.xml b/tests= /xlconfigdata/test-fullvirt-vnuma-nodistances.xml index 9cab3ca..17c9ca5 100644 --- a/tests/xlconfigdata/test-fullvirt-vnuma-nodistances.xml +++ b/tests/xlconfigdata/test-fullvirt-vnuma-nodistances.xml @@ -14,7 +14,7 @@ - + diff --git a/tests/xlconfigdata/test-fullvirt-vnuma-partialdist.cfg b/tests= /xlconfigdata/test-fullvirt-vnuma-partialdist.cfg index 861a50e..46d5f90 100644 --- a/tests/xlconfigdata/test-fullvirt-vnuma-partialdist.cfg +++ b/tests/xlconfigdata/test-fullvirt-vnuma-partialdist.cfg @@ -22,5 +22,6 @@ parallel =3D "none" serial =3D "none" builder =3D "hvm" boot =3D "d" +nestedhvm =3D 1 vnuma =3D [ [ "pnode=3D0", "size=3D2048", "vcpus=3D0-1", "vdistances=3D10,= 21,31,41" ], [ "pnode=3D1", "size=3D2048", "vcpus=3D2-3", "vdistances=3D21,= 10,20,20" ], [ "pnode=3D2", "size=3D2048", "vcpus=3D4-5", "vdistances=3D31,= 20,10,20" ], [ "pnode=3D3", "size=3D2048", "vcpus=3D6-7", "vdistances=3D41,= 20,20,10" ] ] disk =3D [ "format=3Draw,vdev=3Dhda,access=3Drw,backendtype=3Dphy,target= =3D/dev/HostVG/XenGuest2" ] diff --git a/tests/xlconfigdata/test-fullvirt-vnuma-partialdist.xml b/tests= /xlconfigdata/test-fullvirt-vnuma-partialdist.xml index 084b889..291fc37 100644 --- a/tests/xlconfigdata/test-fullvirt-vnuma-partialdist.xml +++ b/tests/xlconfigdata/test-fullvirt-vnuma-partialdist.xml @@ -14,7 +14,7 @@ - + diff --git a/tests/xlconfigdata/test-fullvirt-vnuma.cfg b/tests/xlconfigdat= a/test-fullvirt-vnuma.cfg index 91e233a..813ad7f 100644 --- a/tests/xlconfigdata/test-fullvirt-vnuma.cfg +++ b/tests/xlconfigdata/test-fullvirt-vnuma.cfg @@ -22,5 +22,6 @@ parallel =3D "none" serial =3D "none" builder =3D "hvm" boot =3D "d" +nestedhvm =3D 1 vnuma =3D [ [ "pnode=3D0", "size=3D2048", "vcpus=3D0-1", "vdistances=3D10,= 21,31,41" ], [ "pnode=3D1", "size=3D2048", "vcpus=3D2-3", "vdistances=3D21,= 10,21,31" ], [ "pnode=3D2", "size=3D2048", "vcpus=3D4-5", "vdistances=3D31,= 21,10,21" ], [ "pnode=3D3", "size=3D2048", "vcpus=3D6-7", "vdistances=3D41,= 31,21,10" ] ] disk =3D [ "format=3Draw,vdev=3Dhda,access=3Drw,backendtype=3Dphy,target= =3D/dev/HostVG/XenGuest2" ] diff --git a/tests/xlconfigdata/test-fullvirt-vnuma.xml b/tests/xlconfigdat= a/test-fullvirt-vnuma.xml index 5368b0d..9a9f495 100644 --- a/tests/xlconfigdata/test-fullvirt-vnuma.xml +++ b/tests/xlconfigdata/test-fullvirt-vnuma.xml @@ -14,7 +14,7 @@ - + --=20 git-series 0.9.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list