From nobody Wed May 1 06:45:55 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.37 as permitted sender) client-ip=209.132.183.37; envelope-from=libvir-list-bounces@redhat.com; helo=mx5-phx2.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.37 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx5-phx2.redhat.com (mx5-phx2.redhat.com [209.132.183.37]) by mx.zohomail.com with SMTPS id 1488981012019945.7485480005771; Wed, 8 Mar 2017 05:50:12 -0800 (PST) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx5-phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v28DkWQA013869; Wed, 8 Mar 2017 08:46:32 -0500 Received: from smtp.corp.redhat.com (int-mx16.intmail.prod.int.phx2.redhat.com [10.5.11.28]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v28DkVAD029133 for ; Wed, 8 Mar 2017 08:46:31 -0500 Received: by smtp.corp.redhat.com (Postfix) id 4585B660C0; Wed, 8 Mar 2017 13:46:31 +0000 (UTC) Received: from virval.usersys.redhat.com (dhcp129-92.brq.redhat.com [10.34.129.92]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A604D660CA for ; Wed, 8 Mar 2017 13:46:30 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 595D1100079; Wed, 8 Mar 2017 14:46:29 +0100 (CET) From: Jiri Denemark To: libvir-list@redhat.com Date: Wed, 8 Mar 2017 14:46:22 +0100 Message-Id: <5f689d0ab0a4d61ee4533d630d9e498f12859ee1.1488980728.git.jdenemar@redhat.com> In-Reply-To: References: In-Reply-To: References: Mail-Followup-To: libvir-list@redhat.com X-Scanned-By: MIMEDefang 2.74 on 10.5.11.28 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/7] Do not format in guest CPU XML 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-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This element is only allowed for host CPUs. Signed-off-by: Jiri Denemark --- src/conf/cpu_conf.c | 2 +- tests/cputestdata/x86_64-cpuid-A10-5800K-guest.xml | 1 - tests/cputestdata/x86_64-cpuid-A10-5800K-json.xml | 1 - tests/cputestdata/x86_64-cpuid-Atom-D510-guest.xml | 1 - tests/cputestdata/x86_64-cpuid-Atom-N450-guest.xml | 1 - tests/cputestdata/x86_64-cpuid-Core-i5-2500-guest.xml | 1 - tests/cputestdata/x86_64-cpuid-Core-i5-2500-json.xml | 1 - tests/cputestdata/x86_64-cpuid-Core-i5-2540M-guest.xml | 1 - tests/cputestdata/x86_64-cpuid-Core-i5-2540M-json.xml | 1 - tests/cputestdata/x86_64-cpuid-Core-i5-4670T-guest.xml | 1 - tests/cputestdata/x86_64-cpuid-Core-i5-4670T-json.xml | 1 - tests/cputestdata/x86_64-cpuid-Core-i5-6600-guest.xml | 1 - tests/cputestdata/x86_64-cpuid-Core-i5-6600-json.xml | 1 - tests/cputestdata/x86_64-cpuid-Core-i7-2600-guest.xml | 1 - tests/cputestdata/x86_64-cpuid-Core-i7-2600-json.xml | 1 - tests/cputestdata/x86_64-cpuid-Core-i7-3520M-guest.xml | 1 - tests/cputestdata/x86_64-cpuid-Core-i7-3740QM-guest.xml | 1 - tests/cputestdata/x86_64-cpuid-Core-i7-3740QM-json.xml | 1 - tests/cputestdata/x86_64-cpuid-Core-i7-3770-guest.xml | 1 - tests/cputestdata/x86_64-cpuid-Core-i7-3770-json.xml | 1 - tests/cputestdata/x86_64-cpuid-Core-i7-4600U-guest.xml | 1 - tests/cputestdata/x86_64-cpuid-Core-i7-4600U-json.xml | 1 - tests/cputestdata/x86_64-cpuid-Core-i7-5600U-guest.xml | 1 - tests/cputestdata/x86_64-cpuid-Core-i7-5600U-json.xml | 1 - tests/cputestdata/x86_64-cpuid-Core2-E6850-guest.xml | 1 - tests/cputestdata/x86_64-cpuid-Core2-E6850-json.xml | 1 - tests/cputestdata/x86_64-cpuid-Core2-Q9500-guest.xml | 1 - tests/cputestdata/x86_64-cpuid-FX-8150-guest.xml | 1 - tests/cputestdata/x86_64-cpuid-Opteron-1352-guest.xml | 1 - tests/cputestdata/x86_64-cpuid-Opteron-2350-guest.xml | 1 - tests/cputestdata/x86_64-cpuid-Opteron-2350-json.xml | 1 - tests/cputestdata/x86_64-cpuid-Opteron-6234-guest.xml | 1 - tests/cputestdata/x86_64-cpuid-Opteron-6234-json.xml | 1 - tests/cputestdata/x86_64-cpuid-Opteron-6282-guest.xml | 1 - tests/cputestdata/x86_64-cpuid-Pentium-P6100-guest.xml | 1 - tests/cputestdata/x86_64-cpuid-Phenom-B95-guest.xml | 1 - tests/cputestdata/x86_64-cpuid-Phenom-B95-json.xml | 1 - tests/cputestdata/x86_64-cpuid-Xeon-5110-guest.xml | 1 - tests/cputestdata/x86_64-cpuid-Xeon-E3-1245-guest.xml | 1 - tests/cputestdata/x86_64-cpuid-Xeon-E3-1245-json.xml | 1 - tests/cputestdata/x86_64-cpuid-Xeon-E5-2630-guest.xml | 1 - tests/cputestdata/x86_64-cpuid-Xeon-E5-2630-json.xml | 1 - tests/cputestdata/x86_64-cpuid-Xeon-E5-2650-guest.xml | 1 - tests/cputestdata/x86_64-cpuid-Xeon-E5-2650-json.xml | 1 - tests/cputestdata/x86_64-cpuid-Xeon-E7-4820-guest.xml | 1 - tests/cputestdata/x86_64-cpuid-Xeon-E7-4820-json.xml | 1 - tests/cputestdata/x86_64-cpuid-Xeon-E7-8890-guest.xml | 1 - tests/cputestdata/x86_64-cpuid-Xeon-W3520-guest.xml | 1 - tests/cputestdata/x86_64-cpuid-Xeon-W3520-json.xml | 1 - tests/cputestdata/x86_64-cpuid-Xeon-X5460-guest.xml | 1 - 50 files changed, 1 insertion(+), 50 deletions(-) diff --git a/src/conf/cpu_conf.c b/src/conf/cpu_conf.c index 1bcceeda4..2724fa30a 100644 --- a/src/conf/cpu_conf.c +++ b/src/conf/cpu_conf.c @@ -536,7 +536,7 @@ virCPUDefFormatBufFull(virBufferPtr buf, =20 /* Format children */ virBufferAdjustIndent(&childrenBuf, indent + 2); - if (def->arch) + if (def->type =3D=3D VIR_CPU_TYPE_HOST && def->arch) virBufferAsprintf(&childrenBuf, "%s\n", virArchToString(def->arch)); if (virCPUDefFormatBuf(&childrenBuf, def, updateCPU) < 0) diff --git a/tests/cputestdata/x86_64-cpuid-A10-5800K-guest.xml b/tests/cpu= testdata/x86_64-cpuid-A10-5800K-guest.xml index dacf1d0eb..98a95e1c4 100644 --- a/tests/cputestdata/x86_64-cpuid-A10-5800K-guest.xml +++ b/tests/cputestdata/x86_64-cpuid-A10-5800K-guest.xml @@ -1,5 +1,4 @@ - x86_64 Opteron_G5 AMD diff --git a/tests/cputestdata/x86_64-cpuid-A10-5800K-json.xml b/tests/cput= estdata/x86_64-cpuid-A10-5800K-json.xml index c021fcddf..fa61b7b60 100644 --- a/tests/cputestdata/x86_64-cpuid-A10-5800K-json.xml +++ b/tests/cputestdata/x86_64-cpuid-A10-5800K-json.xml @@ -1,5 +1,4 @@ - x86_64 Opteron_G5 AMD diff --git a/tests/cputestdata/x86_64-cpuid-Atom-D510-guest.xml b/tests/cpu= testdata/x86_64-cpuid-Atom-D510-guest.xml index 5e9efc7c0..caa0bfd53 100644 --- a/tests/cputestdata/x86_64-cpuid-Atom-D510-guest.xml +++ b/tests/cputestdata/x86_64-cpuid-Atom-D510-guest.xml @@ -1,5 +1,4 @@ - x86_64 core2duo Intel diff --git a/tests/cputestdata/x86_64-cpuid-Atom-N450-guest.xml b/tests/cpu= testdata/x86_64-cpuid-Atom-N450-guest.xml index be11b887d..e8f5c9388 100644 --- a/tests/cputestdata/x86_64-cpuid-Atom-N450-guest.xml +++ b/tests/cputestdata/x86_64-cpuid-Atom-N450-guest.xml @@ -1,5 +1,4 @@ - x86_64 core2duo Intel diff --git a/tests/cputestdata/x86_64-cpuid-Core-i5-2500-guest.xml b/tests/= cputestdata/x86_64-cpuid-Core-i5-2500-guest.xml index 4c249eb0c..22b5cf31f 100644 --- a/tests/cputestdata/x86_64-cpuid-Core-i5-2500-guest.xml +++ b/tests/cputestdata/x86_64-cpuid-Core-i5-2500-guest.xml @@ -1,5 +1,4 @@ - x86_64 SandyBridge Intel diff --git a/tests/cputestdata/x86_64-cpuid-Core-i5-2500-json.xml b/tests/c= putestdata/x86_64-cpuid-Core-i5-2500-json.xml index 2e2430e78..c9ae65192 100644 --- a/tests/cputestdata/x86_64-cpuid-Core-i5-2500-json.xml +++ b/tests/cputestdata/x86_64-cpuid-Core-i5-2500-json.xml @@ -1,5 +1,4 @@ - x86_64 SandyBridge Intel diff --git a/tests/cputestdata/x86_64-cpuid-Core-i5-2540M-guest.xml b/tests= /cputestdata/x86_64-cpuid-Core-i5-2540M-guest.xml index 4c249eb0c..22b5cf31f 100644 --- a/tests/cputestdata/x86_64-cpuid-Core-i5-2540M-guest.xml +++ b/tests/cputestdata/x86_64-cpuid-Core-i5-2540M-guest.xml @@ -1,5 +1,4 @@ - x86_64 SandyBridge Intel diff --git a/tests/cputestdata/x86_64-cpuid-Core-i5-2540M-json.xml b/tests/= cputestdata/x86_64-cpuid-Core-i5-2540M-json.xml index 2e2430e78..c9ae65192 100644 --- a/tests/cputestdata/x86_64-cpuid-Core-i5-2540M-json.xml +++ b/tests/cputestdata/x86_64-cpuid-Core-i5-2540M-json.xml @@ -1,5 +1,4 @@ - x86_64 SandyBridge Intel diff --git a/tests/cputestdata/x86_64-cpuid-Core-i5-4670T-guest.xml b/tests= /cputestdata/x86_64-cpuid-Core-i5-4670T-guest.xml index 70d13282b..0ccbcd062 100644 --- a/tests/cputestdata/x86_64-cpuid-Core-i5-4670T-guest.xml +++ b/tests/cputestdata/x86_64-cpuid-Core-i5-4670T-guest.xml @@ -1,5 +1,4 @@ - x86_64 Haswell-noTSX Intel diff --git a/tests/cputestdata/x86_64-cpuid-Core-i5-4670T-json.xml b/tests/= cputestdata/x86_64-cpuid-Core-i5-4670T-json.xml index 8d3a0b618..489de49fb 100644 --- a/tests/cputestdata/x86_64-cpuid-Core-i5-4670T-json.xml +++ b/tests/cputestdata/x86_64-cpuid-Core-i5-4670T-json.xml @@ -1,5 +1,4 @@ - x86_64 Haswell-noTSX Intel diff --git a/tests/cputestdata/x86_64-cpuid-Core-i5-6600-guest.xml b/tests/= cputestdata/x86_64-cpuid-Core-i5-6600-guest.xml index 0ab5a7a7b..c3561d597 100644 --- a/tests/cputestdata/x86_64-cpuid-Core-i5-6600-guest.xml +++ b/tests/cputestdata/x86_64-cpuid-Core-i5-6600-guest.xml @@ -1,5 +1,4 @@ - x86_64 Skylake-Client Intel diff --git a/tests/cputestdata/x86_64-cpuid-Core-i5-6600-json.xml b/tests/c= putestdata/x86_64-cpuid-Core-i5-6600-json.xml index e768aa674..61a52212a 100644 --- a/tests/cputestdata/x86_64-cpuid-Core-i5-6600-json.xml +++ b/tests/cputestdata/x86_64-cpuid-Core-i5-6600-json.xml @@ -1,5 +1,4 @@ - x86_64 Skylake-Client Intel diff --git a/tests/cputestdata/x86_64-cpuid-Core-i7-2600-guest.xml b/tests/= cputestdata/x86_64-cpuid-Core-i7-2600-guest.xml index 4c249eb0c..22b5cf31f 100644 --- a/tests/cputestdata/x86_64-cpuid-Core-i7-2600-guest.xml +++ b/tests/cputestdata/x86_64-cpuid-Core-i7-2600-guest.xml @@ -1,5 +1,4 @@ - x86_64 SandyBridge Intel diff --git a/tests/cputestdata/x86_64-cpuid-Core-i7-2600-json.xml b/tests/c= putestdata/x86_64-cpuid-Core-i7-2600-json.xml index 4e721aba4..25c87e164 100644 --- a/tests/cputestdata/x86_64-cpuid-Core-i7-2600-json.xml +++ b/tests/cputestdata/x86_64-cpuid-Core-i7-2600-json.xml @@ -1,5 +1,4 @@ - x86_64 SandyBridge Intel diff --git a/tests/cputestdata/x86_64-cpuid-Core-i7-3520M-guest.xml b/tests= /cputestdata/x86_64-cpuid-Core-i7-3520M-guest.xml index 776001ff4..fa1a43a8a 100644 --- a/tests/cputestdata/x86_64-cpuid-Core-i7-3520M-guest.xml +++ b/tests/cputestdata/x86_64-cpuid-Core-i7-3520M-guest.xml @@ -1,5 +1,4 @@ - x86_64 IvyBridge Intel diff --git a/tests/cputestdata/x86_64-cpuid-Core-i7-3740QM-guest.xml b/test= s/cputestdata/x86_64-cpuid-Core-i7-3740QM-guest.xml index 90957e99d..d52f49d30 100644 --- a/tests/cputestdata/x86_64-cpuid-Core-i7-3740QM-guest.xml +++ b/tests/cputestdata/x86_64-cpuid-Core-i7-3740QM-guest.xml @@ -1,5 +1,4 @@ - x86_64 IvyBridge Intel diff --git a/tests/cputestdata/x86_64-cpuid-Core-i7-3740QM-json.xml b/tests= /cputestdata/x86_64-cpuid-Core-i7-3740QM-json.xml index 03c22de4b..60086b8b1 100644 --- a/tests/cputestdata/x86_64-cpuid-Core-i7-3740QM-json.xml +++ b/tests/cputestdata/x86_64-cpuid-Core-i7-3740QM-json.xml @@ -1,5 +1,4 @@ - x86_64 IvyBridge Intel diff --git a/tests/cputestdata/x86_64-cpuid-Core-i7-3770-guest.xml b/tests/= cputestdata/x86_64-cpuid-Core-i7-3770-guest.xml index 776001ff4..fa1a43a8a 100644 --- a/tests/cputestdata/x86_64-cpuid-Core-i7-3770-guest.xml +++ b/tests/cputestdata/x86_64-cpuid-Core-i7-3770-guest.xml @@ -1,5 +1,4 @@ - x86_64 IvyBridge Intel diff --git a/tests/cputestdata/x86_64-cpuid-Core-i7-3770-json.xml b/tests/c= putestdata/x86_64-cpuid-Core-i7-3770-json.xml index c1544afd3..1dc866dba 100644 --- a/tests/cputestdata/x86_64-cpuid-Core-i7-3770-json.xml +++ b/tests/cputestdata/x86_64-cpuid-Core-i7-3770-json.xml @@ -1,5 +1,4 @@ - x86_64 IvyBridge Intel diff --git a/tests/cputestdata/x86_64-cpuid-Core-i7-4600U-guest.xml b/tests= /cputestdata/x86_64-cpuid-Core-i7-4600U-guest.xml index b2aac64b2..42e7c9011 100644 --- a/tests/cputestdata/x86_64-cpuid-Core-i7-4600U-guest.xml +++ b/tests/cputestdata/x86_64-cpuid-Core-i7-4600U-guest.xml @@ -1,5 +1,4 @@ - x86_64 Haswell-noTSX Intel diff --git a/tests/cputestdata/x86_64-cpuid-Core-i7-4600U-json.xml b/tests/= cputestdata/x86_64-cpuid-Core-i7-4600U-json.xml index 8e4e9d96a..3ca3b0f24 100644 --- a/tests/cputestdata/x86_64-cpuid-Core-i7-4600U-json.xml +++ b/tests/cputestdata/x86_64-cpuid-Core-i7-4600U-json.xml @@ -1,5 +1,4 @@ - x86_64 Haswell-noTSX Intel diff --git a/tests/cputestdata/x86_64-cpuid-Core-i7-5600U-guest.xml b/tests= /cputestdata/x86_64-cpuid-Core-i7-5600U-guest.xml index cd7b4bb8e..877895cf1 100644 --- a/tests/cputestdata/x86_64-cpuid-Core-i7-5600U-guest.xml +++ b/tests/cputestdata/x86_64-cpuid-Core-i7-5600U-guest.xml @@ -1,5 +1,4 @@ - x86_64 Broadwell Intel diff --git a/tests/cputestdata/x86_64-cpuid-Core-i7-5600U-json.xml b/tests/= cputestdata/x86_64-cpuid-Core-i7-5600U-json.xml index be11fa061..a736cdfb0 100644 --- a/tests/cputestdata/x86_64-cpuid-Core-i7-5600U-json.xml +++ b/tests/cputestdata/x86_64-cpuid-Core-i7-5600U-json.xml @@ -1,5 +1,4 @@ - x86_64 Broadwell Intel diff --git a/tests/cputestdata/x86_64-cpuid-Core2-E6850-guest.xml b/tests/c= putestdata/x86_64-cpuid-Core2-E6850-guest.xml index dfcbe24da..2392de6ce 100644 --- a/tests/cputestdata/x86_64-cpuid-Core2-E6850-guest.xml +++ b/tests/cputestdata/x86_64-cpuid-Core2-E6850-guest.xml @@ -1,5 +1,4 @@ - x86_64 Conroe Intel diff --git a/tests/cputestdata/x86_64-cpuid-Core2-E6850-json.xml b/tests/cp= utestdata/x86_64-cpuid-Core2-E6850-json.xml index 8950119a1..e4117c293 100644 --- a/tests/cputestdata/x86_64-cpuid-Core2-E6850-json.xml +++ b/tests/cputestdata/x86_64-cpuid-Core2-E6850-json.xml @@ -1,5 +1,4 @@ - x86_64 Conroe Intel diff --git a/tests/cputestdata/x86_64-cpuid-Core2-Q9500-guest.xml b/tests/c= putestdata/x86_64-cpuid-Core2-Q9500-guest.xml index 37feefa9c..aa151bc54 100644 --- a/tests/cputestdata/x86_64-cpuid-Core2-Q9500-guest.xml +++ b/tests/cputestdata/x86_64-cpuid-Core2-Q9500-guest.xml @@ -1,5 +1,4 @@ - x86_64 Penryn Intel diff --git a/tests/cputestdata/x86_64-cpuid-FX-8150-guest.xml b/tests/cpute= stdata/x86_64-cpuid-FX-8150-guest.xml index 9858ee4e2..6bd032bbc 100644 --- a/tests/cputestdata/x86_64-cpuid-FX-8150-guest.xml +++ b/tests/cputestdata/x86_64-cpuid-FX-8150-guest.xml @@ -1,5 +1,4 @@ - x86_64 Opteron_G4 AMD diff --git a/tests/cputestdata/x86_64-cpuid-Opteron-1352-guest.xml b/tests/= cputestdata/x86_64-cpuid-Opteron-1352-guest.xml index 828a14271..652f1e433 100644 --- a/tests/cputestdata/x86_64-cpuid-Opteron-1352-guest.xml +++ b/tests/cputestdata/x86_64-cpuid-Opteron-1352-guest.xml @@ -1,5 +1,4 @@ - x86_64 Opteron_G3 AMD diff --git a/tests/cputestdata/x86_64-cpuid-Opteron-2350-guest.xml b/tests/= cputestdata/x86_64-cpuid-Opteron-2350-guest.xml index 828a14271..652f1e433 100644 --- a/tests/cputestdata/x86_64-cpuid-Opteron-2350-guest.xml +++ b/tests/cputestdata/x86_64-cpuid-Opteron-2350-guest.xml @@ -1,5 +1,4 @@ - x86_64 Opteron_G3 AMD diff --git a/tests/cputestdata/x86_64-cpuid-Opteron-2350-json.xml b/tests/c= putestdata/x86_64-cpuid-Opteron-2350-json.xml index 302d6562c..741757aeb 100644 --- a/tests/cputestdata/x86_64-cpuid-Opteron-2350-json.xml +++ b/tests/cputestdata/x86_64-cpuid-Opteron-2350-json.xml @@ -1,5 +1,4 @@ - x86_64 Opteron_G3 AMD diff --git a/tests/cputestdata/x86_64-cpuid-Opteron-6234-guest.xml b/tests/= cputestdata/x86_64-cpuid-Opteron-6234-guest.xml index 9858ee4e2..6bd032bbc 100644 --- a/tests/cputestdata/x86_64-cpuid-Opteron-6234-guest.xml +++ b/tests/cputestdata/x86_64-cpuid-Opteron-6234-guest.xml @@ -1,5 +1,4 @@ - x86_64 Opteron_G4 AMD diff --git a/tests/cputestdata/x86_64-cpuid-Opteron-6234-json.xml b/tests/c= putestdata/x86_64-cpuid-Opteron-6234-json.xml index cc8918661..2ad3c98a5 100644 --- a/tests/cputestdata/x86_64-cpuid-Opteron-6234-json.xml +++ b/tests/cputestdata/x86_64-cpuid-Opteron-6234-json.xml @@ -1,5 +1,4 @@ - x86_64 Opteron_G4 AMD diff --git a/tests/cputestdata/x86_64-cpuid-Opteron-6282-guest.xml b/tests/= cputestdata/x86_64-cpuid-Opteron-6282-guest.xml index 9858ee4e2..6bd032bbc 100644 --- a/tests/cputestdata/x86_64-cpuid-Opteron-6282-guest.xml +++ b/tests/cputestdata/x86_64-cpuid-Opteron-6282-guest.xml @@ -1,5 +1,4 @@ - x86_64 Opteron_G4 AMD diff --git a/tests/cputestdata/x86_64-cpuid-Pentium-P6100-guest.xml b/tests= /cputestdata/x86_64-cpuid-Pentium-P6100-guest.xml index f893f9f23..db5e0ae6a 100644 --- a/tests/cputestdata/x86_64-cpuid-Pentium-P6100-guest.xml +++ b/tests/cputestdata/x86_64-cpuid-Pentium-P6100-guest.xml @@ -1,5 +1,4 @@ - x86_64 core2duo Intel diff --git a/tests/cputestdata/x86_64-cpuid-Phenom-B95-guest.xml b/tests/cp= utestdata/x86_64-cpuid-Phenom-B95-guest.xml index 60ba9c1eb..d7a06108b 100644 --- a/tests/cputestdata/x86_64-cpuid-Phenom-B95-guest.xml +++ b/tests/cputestdata/x86_64-cpuid-Phenom-B95-guest.xml @@ -1,5 +1,4 @@ - x86_64 Opteron_G3 AMD diff --git a/tests/cputestdata/x86_64-cpuid-Phenom-B95-json.xml b/tests/cpu= testdata/x86_64-cpuid-Phenom-B95-json.xml index d4605263b..7ce56ac8e 100644 --- a/tests/cputestdata/x86_64-cpuid-Phenom-B95-json.xml +++ b/tests/cputestdata/x86_64-cpuid-Phenom-B95-json.xml @@ -1,5 +1,4 @@ - x86_64 Opteron_G3 AMD diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-5110-guest.xml b/tests/cpu= testdata/x86_64-cpuid-Xeon-5110-guest.xml index 28d112b34..d1b442d33 100644 --- a/tests/cputestdata/x86_64-cpuid-Xeon-5110-guest.xml +++ b/tests/cputestdata/x86_64-cpuid-Xeon-5110-guest.xml @@ -1,5 +1,4 @@ - x86_64 Conroe Intel diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-E3-1245-guest.xml b/tests/= cputestdata/x86_64-cpuid-Xeon-E3-1245-guest.xml index 0ab5a7a7b..c3561d597 100644 --- a/tests/cputestdata/x86_64-cpuid-Xeon-E3-1245-guest.xml +++ b/tests/cputestdata/x86_64-cpuid-Xeon-E3-1245-guest.xml @@ -1,5 +1,4 @@ - x86_64 Skylake-Client Intel diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-E3-1245-json.xml b/tests/c= putestdata/x86_64-cpuid-Xeon-E3-1245-json.xml index e0e060691..7af75509e 100644 --- a/tests/cputestdata/x86_64-cpuid-Xeon-E3-1245-json.xml +++ b/tests/cputestdata/x86_64-cpuid-Xeon-E3-1245-json.xml @@ -1,5 +1,4 @@ - x86_64 Skylake-Client Intel diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-E5-2630-guest.xml b/tests/= cputestdata/x86_64-cpuid-Xeon-E5-2630-guest.xml index b02d963c1..980af0789 100644 --- a/tests/cputestdata/x86_64-cpuid-Xeon-E5-2630-guest.xml +++ b/tests/cputestdata/x86_64-cpuid-Xeon-E5-2630-guest.xml @@ -1,5 +1,4 @@ - x86_64 Haswell-noTSX Intel diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-E5-2630-json.xml b/tests/c= putestdata/x86_64-cpuid-Xeon-E5-2630-json.xml index ec5f56205..78b8be111 100644 --- a/tests/cputestdata/x86_64-cpuid-Xeon-E5-2630-json.xml +++ b/tests/cputestdata/x86_64-cpuid-Xeon-E5-2630-json.xml @@ -1,5 +1,4 @@ - x86_64 Haswell-noTSX Intel diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-E5-2650-guest.xml b/tests/= cputestdata/x86_64-cpuid-Xeon-E5-2650-guest.xml index b02d963c1..980af0789 100644 --- a/tests/cputestdata/x86_64-cpuid-Xeon-E5-2650-guest.xml +++ b/tests/cputestdata/x86_64-cpuid-Xeon-E5-2650-guest.xml @@ -1,5 +1,4 @@ - x86_64 Haswell-noTSX Intel diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-E5-2650-json.xml b/tests/c= putestdata/x86_64-cpuid-Xeon-E5-2650-json.xml index 6e4aff07a..2227ed003 100644 --- a/tests/cputestdata/x86_64-cpuid-Xeon-E5-2650-json.xml +++ b/tests/cputestdata/x86_64-cpuid-Xeon-E5-2650-json.xml @@ -1,5 +1,4 @@ - x86_64 Haswell-noTSX Intel diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-E7-4820-guest.xml b/tests/= cputestdata/x86_64-cpuid-Xeon-E7-4820-guest.xml index 81bf8c8c2..dbf8580a0 100644 --- a/tests/cputestdata/x86_64-cpuid-Xeon-E7-4820-guest.xml +++ b/tests/cputestdata/x86_64-cpuid-Xeon-E7-4820-guest.xml @@ -1,5 +1,4 @@ - x86_64 SandyBridge Intel diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-E7-4820-json.xml b/tests/c= putestdata/x86_64-cpuid-Xeon-E7-4820-json.xml index cb69ff56f..d94a330f3 100644 --- a/tests/cputestdata/x86_64-cpuid-Xeon-E7-4820-json.xml +++ b/tests/cputestdata/x86_64-cpuid-Xeon-E7-4820-json.xml @@ -1,5 +1,4 @@ - x86_64 SandyBridge Intel diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-E7-8890-guest.xml b/tests/= cputestdata/x86_64-cpuid-Xeon-E7-8890-guest.xml index c62e36a3a..16d333aa2 100644 --- a/tests/cputestdata/x86_64-cpuid-Xeon-E7-8890-guest.xml +++ b/tests/cputestdata/x86_64-cpuid-Xeon-E7-8890-guest.xml @@ -1,5 +1,4 @@ - x86_64 Haswell Intel diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-W3520-guest.xml b/tests/cp= utestdata/x86_64-cpuid-Xeon-W3520-guest.xml index 4037fa60c..9c975c679 100644 --- a/tests/cputestdata/x86_64-cpuid-Xeon-W3520-guest.xml +++ b/tests/cputestdata/x86_64-cpuid-Xeon-W3520-guest.xml @@ -1,5 +1,4 @@ - x86_64 Nehalem Intel diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-W3520-json.xml b/tests/cpu= testdata/x86_64-cpuid-Xeon-W3520-json.xml index 348bef829..038c98e1d 100644 --- a/tests/cputestdata/x86_64-cpuid-Xeon-W3520-json.xml +++ b/tests/cputestdata/x86_64-cpuid-Xeon-W3520-json.xml @@ -1,5 +1,4 @@ - x86_64 Nehalem Intel diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-X5460-guest.xml b/tests/cp= utestdata/x86_64-cpuid-Xeon-X5460-guest.xml index 9e21934b4..a97efc565 100644 --- a/tests/cputestdata/x86_64-cpuid-Xeon-X5460-guest.xml +++ b/tests/cputestdata/x86_64-cpuid-Xeon-X5460-guest.xml @@ -1,5 +1,4 @@ - x86_64 Penryn Intel --=20 2.12.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed May 1 06:45:55 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.39 as permitted sender) client-ip=209.132.183.39; envelope-from=libvir-list-bounces@redhat.com; helo=mx6-phx2.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.39 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx6-phx2.redhat.com (mx6-phx2.redhat.com [209.132.183.39]) by mx.zohomail.com with SMTPS id 1488981043123435.5673354728581; Wed, 8 Mar 2017 05:50:43 -0800 (PST) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx6-phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v28Dl9HW020212; Wed, 8 Mar 2017 08:47:09 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v28DkV43029128 for ; Wed, 8 Mar 2017 08:46:31 -0500 Received: from virval.usersys.redhat.com (dhcp129-92.brq.redhat.com [10.34.129.92]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v28DkTqE021592 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Wed, 8 Mar 2017 08:46:30 -0500 Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 5C1C8102C12; Wed, 8 Mar 2017 14:46:29 +0100 (CET) From: Jiri Denemark To: libvir-list@redhat.com Date: Wed, 8 Mar 2017 14:46:23 +0100 Message-Id: In-Reply-To: References: In-Reply-To: References: Mail-Followup-To: libvir-list@redhat.com X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/7] cpu: Replace cpuNodeData with virCPUGetHost 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-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" cpuNodeData has always been followed by cpuDecode as no hypervisor driver is really interested in raw CPUID data for a host CPU. Let's create a new CPU driver API which returns virCPUDefPtr directly. Signed-off-by: Jiri Denemark --- src/bhyve/bhyve_capabilities.c | 34 ++++--------------------- src/cpu/cpu.c | 58 ++++++++++++++++++++++++++++++++++----= ---- src/cpu/cpu.h | 11 ++++---- src/cpu/cpu_arm.c | 1 - src/cpu/cpu_ppc64.c | 28 ++++++++++---------- src/cpu/cpu_s390.c | 1 - src/cpu/cpu_x86.c | 27 +++++++++----------- src/libvirt_private.syms | 2 +- src/qemu/qemu_capabilities.c | 32 +++-------------------- src/vmware/vmware_conf.c | 19 +++----------- src/vz/vz_driver.c | 21 ++------------- 11 files changed, 95 insertions(+), 139 deletions(-) diff --git a/src/bhyve/bhyve_capabilities.c b/src/bhyve/bhyve_capabilities.c index 52d6ca782..c2c9303d7 100644 --- a/src/bhyve/bhyve_capabilities.c +++ b/src/bhyve/bhyve_capabilities.c @@ -40,41 +40,17 @@ VIR_LOG_INIT("bhyve.bhyve_capabilities"); =20 static int virBhyveCapsInitCPU(virCapsPtr caps, - virArch arch) + virArch arch) { - virCPUDefPtr cpu =3D NULL; - virCPUDataPtr data =3D NULL; virNodeInfo nodeinfo; - int ret =3D -1; - - if (VIR_ALLOC(cpu) < 0) - goto error; - - cpu->arch =3D arch; =20 if (nodeGetInfo(&nodeinfo)) - goto error; + return -1; =20 - cpu->type =3D VIR_CPU_TYPE_HOST; - cpu->sockets =3D nodeinfo.sockets; - cpu->cores =3D nodeinfo.cores; - cpu->threads =3D nodeinfo.threads; - caps->host.cpu =3D cpu; + if (!(caps->host.cpu =3D virCPUGetHost(arch, &nodeinfo))) + return -1; =20 - if (!(data =3D cpuNodeData(arch)) || - cpuDecode(cpu, data, NULL, 0, NULL) < 0) - goto cleanup; - - ret =3D 0; - - cleanup: - virCPUDataFree(data); - - return ret; - - error: - virCPUDefFree(cpu); - goto cleanup; + return 0; } =20 virCapsPtr diff --git a/src/cpu/cpu.c b/src/cpu/cpu.c index 051a58040..c1666ed3b 100644 --- a/src/cpu/cpu.c +++ b/src/cpu/cpu.c @@ -357,30 +357,66 @@ virCPUDataFree(virCPUDataPtr data) =20 =20 /** - * cpuNodeData: + * virCPUGetHost: * * @arch: CPU architecture + * @nodeInfo: simplified CPU topology (optional) * - * Returns CPU data for host CPU or NULL on error. + * Create CPU definition describing the host's CPU. If @nodeInfo is not NU= LL, + * the CPU definition will have topology (sockets, cores, threads) filled = in + * according to the content of @nodeInfo. The function fails only if @node= Info + * was not passed in and the assigned CPU driver was not able to detect the + * host CPU model. In other words, a CPU definition containing just the + * topology is a successful result even if detecting the host CPU model fa= ils. + * + * Returns host CPU definition or NULL on error. */ -virCPUDataPtr -cpuNodeData(virArch arch) +virCPUDefPtr +virCPUGetHost(virArch arch, + virNodeInfoPtr nodeInfo) { struct cpuArchDriver *driver; + virCPUDefPtr cpu =3D NULL; =20 - VIR_DEBUG("arch=3D%s", virArchToString(arch)); + VIR_DEBUG("arch=3D%s, nodeInfo=3D%p", + virArchToString(arch), nodeInfo); =20 - if ((driver =3D cpuGetSubDriver(arch)) =3D=3D NULL) + if (!(driver =3D cpuGetSubDriver(arch))) return NULL; =20 - if (driver->nodeData =3D=3D NULL) { - virReportError(VIR_ERR_NO_SUPPORT, - _("cannot get node CPU data for %s architecture"), - virArchToString(arch)); + if (VIR_ALLOC(cpu) < 0) return NULL; + + cpu->arch =3D arch; + cpu->type =3D VIR_CPU_TYPE_HOST; + + if (nodeInfo) { + cpu->sockets =3D nodeInfo->sockets; + cpu->cores =3D nodeInfo->cores; + cpu->threads =3D nodeInfo->threads; } =20 - return driver->nodeData(arch); + /* Try to get the host CPU model, but don't really fail if nodeInfo is + * filled in. + */ + if (driver->getHost) { + if (driver->getHost(cpu) < 0 && !nodeInfo) + goto error; + } else if (nodeInfo) { + VIR_DEBUG("cannot detect host CPU model for %s architecture", + virArchToString(arch)); + } else { + virReportError(VIR_ERR_NO_SUPPORT, + _("cannot detect host CPU model for %s architecture= "), + virArchToString(arch)); + goto error; + } + + return cpu; + + error: + virCPUDefFree(cpu); + return NULL; } =20 =20 diff --git a/src/cpu/cpu.h b/src/cpu/cpu.h index 0324284b9..cbbb45223 100644 --- a/src/cpu/cpu.h +++ b/src/cpu/cpu.h @@ -70,8 +70,8 @@ typedef int typedef void (*cpuArchDataFree) (virCPUDataPtr data); =20 -typedef virCPUDataPtr -(*cpuArchNodeData) (virArch arch); +typedef int +(*virCPUArchGetHost)(virCPUDefPtr cpu); =20 typedef virCPUDefPtr (*cpuArchBaseline) (virCPUDefPtr *cpus, @@ -117,7 +117,7 @@ struct cpuArchDriver { cpuArchDecode decode; cpuArchEncode encode; cpuArchDataFree dataFree; - cpuArchNodeData nodeData; + virCPUArchGetHost getHost; cpuArchBaseline baseline; virCPUArchUpdate update; virCPUArchCheckFeature checkFeature; @@ -168,8 +168,9 @@ virCPUDataNew(virArch arch); void virCPUDataFree(virCPUDataPtr data); =20 -virCPUDataPtr -cpuNodeData (virArch arch); +virCPUDefPtr +virCPUGetHost(virArch arch, + virNodeInfoPtr nodeInfo); =20 char * cpuBaselineXML(const char **xmlCPUs, diff --git a/src/cpu/cpu_arm.c b/src/cpu/cpu_arm.c index 3a0ee2b14..a1aba2554 100644 --- a/src/cpu/cpu_arm.c +++ b/src/cpu/cpu_arm.c @@ -111,7 +111,6 @@ struct cpuArchDriver cpuDriverArm =3D { .compare =3D virCPUarmCompare, .decode =3D NULL, .encode =3D NULL, - .nodeData =3D NULL, .baseline =3D armBaseline, .update =3D virCPUarmUpdate, }; diff --git a/src/cpu/cpu_ppc64.c b/src/cpu/cpu_ppc64.c index a7c8545db..bb715546b 100644 --- a/src/cpu/cpu_ppc64.c +++ b/src/cpu/cpu_ppc64.c @@ -714,19 +714,21 @@ virCPUppc64DataFree(virCPUDataPtr data) VIR_FREE(data); } =20 -static virCPUDataPtr -ppc64DriverNodeData(virArch arch) + +static int +virCPUppc64GetHost(virCPUDefPtr cpu) { - virCPUDataPtr nodeData; + virCPUDataPtr cpuData =3D NULL; virCPUppc64Data *data; + int ret =3D -1; =20 - if (VIR_ALLOC(nodeData) < 0) - goto error; + if (!(cpuData =3D virCPUDataNew(archs[0]))) + goto cleanup; =20 - data =3D &nodeData->data.ppc64; + data =3D &cpuData->data.ppc64; =20 if (VIR_ALLOC_N(data->pvr, 1) < 0) - goto error; + goto cleanup; =20 data->len =3D 1; =20 @@ -736,13 +738,11 @@ ppc64DriverNodeData(virArch arch) #endif data->pvr[0].mask =3D 0xfffffffful; =20 - nodeData->arch =3D arch; + ret =3D ppc64DriverDecode(cpu, cpuData, NULL, 0, NULL, 0); =20 - return nodeData; - - error: - virCPUppc64DataFree(nodeData); - return NULL; + cleanup: + virCPUppc64DataFree(cpuData); + return ret; } =20 =20 @@ -902,7 +902,7 @@ struct cpuArchDriver cpuDriverPPC64 =3D { .decode =3D ppc64DriverDecode, .encode =3D NULL, .dataFree =3D virCPUppc64DataFree, - .nodeData =3D ppc64DriverNodeData, + .getHost =3D virCPUppc64GetHost, .baseline =3D ppc64DriverBaseline, .update =3D virCPUppc64Update, .getModels =3D virCPUppc64DriverGetModels, diff --git a/src/cpu/cpu_s390.c b/src/cpu/cpu_s390.c index 9503e8e2b..c08a24a53 100644 --- a/src/cpu/cpu_s390.c +++ b/src/cpu/cpu_s390.c @@ -109,7 +109,6 @@ struct cpuArchDriver cpuDriverS390 =3D { .compare =3D virCPUs390Compare, .decode =3D NULL, .encode =3D NULL, - .nodeData =3D NULL, .baseline =3D NULL, .update =3D virCPUs390Update, }; diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index bcf50cb9e..bddb169ba 100644 --- a/src/cpu/cpu_x86.c +++ b/src/cpu/cpu_x86.c @@ -2437,25 +2437,24 @@ cpuidSet(uint32_t base, virCPUDataPtr data) } =20 =20 -static virCPUDataPtr -x86NodeData(virArch arch) +static int +virCPUx86GetHost(virCPUDefPtr cpu) { virCPUDataPtr cpuData =3D NULL; + int ret =3D -1; =20 - if (!(cpuData =3D virCPUDataNew(arch))) - goto error; + if (!(cpuData =3D virCPUDataNew(archs[0]))) + goto cleanup; =20 - if (cpuidSet(CPUX86_BASIC, cpuData) < 0) - goto error; + if (cpuidSet(CPUX86_BASIC, cpuData) < 0 || + cpuidSet(CPUX86_EXTENDED, cpuData) < 0) + goto cleanup; =20 - if (cpuidSet(CPUX86_EXTENDED, cpuData) < 0) - goto error; + ret =3D x86DecodeCPUData(cpu, cpuData, NULL, 0, NULL, 0); =20 - return cpuData; - - error: + cleanup: virCPUx86DataFree(cpuData); - return NULL; + return ret; } #endif =20 @@ -2849,9 +2848,7 @@ struct cpuArchDriver cpuDriverX86 =3D { .encode =3D x86Encode, .dataFree =3D virCPUx86DataFree, #if defined(__i386__) || defined(__x86_64__) - .nodeData =3D x86NodeData, -#else - .nodeData =3D NULL, + .getHost =3D virCPUx86GetHost, #endif .baseline =3D x86Baseline, .update =3D virCPUx86Update, diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 6c89d44e2..4efea0098 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -996,7 +996,6 @@ cpuBaseline; cpuBaselineXML; cpuDecode; cpuEncode; -cpuNodeData; virCPUCheckFeature; virCPUCompare; virCPUCompareXML; @@ -1006,6 +1005,7 @@ virCPUDataFormat; virCPUDataFree; virCPUDataNew; virCPUDataParse; +virCPUGetHost; virCPUGetModels; virCPUTranslate; virCPUUpdate; diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 5a3b4ac50..b0a4861c3 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -1065,39 +1065,15 @@ static int virQEMUCapsInitCPU(virCapsPtr caps, virArch arch) { - virCPUDefPtr cpu =3D NULL; - virCPUDataPtr data =3D NULL; virNodeInfo nodeinfo; - int ret =3D -1; - - if (VIR_ALLOC(cpu) < 0) - goto error; - - cpu->arch =3D arch; =20 if (nodeGetInfo(&nodeinfo)) - goto error; + return -1; =20 - cpu->type =3D VIR_CPU_TYPE_HOST; - cpu->sockets =3D nodeinfo.sockets; - cpu->cores =3D nodeinfo.cores; - cpu->threads =3D nodeinfo.threads; - caps->host.cpu =3D cpu; + if (!(caps->host.cpu =3D virCPUGetHost(arch, &nodeinfo))) + return -1; =20 - if (!(data =3D cpuNodeData(arch)) - || cpuDecode(cpu, data, NULL, 0, NULL) < 0) - goto cleanup; - - ret =3D 0; - - cleanup: - virCPUDataFree(data); - - return ret; - - error: - virCPUDefFree(cpu); - goto cleanup; + return 0; } =20 =20 diff --git a/src/vmware/vmware_conf.c b/src/vmware/vmware_conf.c index 5b1b5f5fd..d1444e462 100644 --- a/src/vmware/vmware_conf.c +++ b/src/vmware/vmware_conf.c @@ -62,7 +62,6 @@ vmwareCapsInit(void) virCapsPtr caps =3D NULL; virCapsGuestPtr guest =3D NULL; virCPUDefPtr cpu =3D NULL; - virCPUDataPtr data =3D NULL; =20 if ((caps =3D virCapabilitiesNew(virArchFromHost(), false, false)) =3D=3D NULL) @@ -83,26 +82,18 @@ vmwareCapsInit(void) NULL, NULL, 0, NULL) =3D=3D NULL) goto error; =20 - if (VIR_ALLOC(cpu) < 0) + if (!(cpu =3D virCPUGetHost(caps->host.arch, NULL))) goto error; =20 - cpu->arch =3D caps->host.arch; - cpu->type =3D VIR_CPU_TYPE_HOST; - - if (!(data =3D cpuNodeData(cpu->arch)) - || cpuDecode(cpu, data, NULL, 0, NULL) < 0) { - goto error; - } - /* x86_64 guests are supported if * - Host arch is x86_64 * Or * - Host CPU is x86_64 with virtualization extensions */ if (caps->host.arch =3D=3D VIR_ARCH_X86_64 || - (virCPUDataCheckFeature(data, "lm") && - (virCPUDataCheckFeature(data, "vmx") || - virCPUDataCheckFeature(data, "svm")))) { + (virCPUCheckFeature(cpu->arch, cpu, "lm") && + (virCPUCheckFeature(cpu->arch, cpu, "vmx") || + virCPUCheckFeature(cpu->arch, cpu, "svm")))) { =20 if ((guest =3D virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_HVM, @@ -118,8 +109,6 @@ vmwareCapsInit(void) =20 cleanup: virCPUDefFree(cpu); - virCPUDataFree(data); - return caps; =20 error: diff --git a/src/vz/vz_driver.c b/src/vz/vz_driver.c index 1ca9fd726..f97a2045b 100644 --- a/src/vz/vz_driver.c +++ b/src/vz/vz_driver.c @@ -99,8 +99,6 @@ static virCapsPtr vzBuildCapabilities(void) { virCapsPtr caps =3D NULL; - virCPUDefPtr cpu =3D NULL; - virCPUDataPtr data =3D NULL; virNodeInfo nodeinfo; virDomainOSType ostypes[] =3D { VIR_DOMAIN_OSTYPE_HVM, @@ -131,32 +129,17 @@ vzBuildCapabilities(void) if (nodeGetInfo(&nodeinfo)) goto error; =20 - if (VIR_ALLOC(cpu) < 0) + if (!(caps->host.cpu =3D virCPUGetHost(caps->host.arch, &nodeinfo))) goto error; =20 - cpu->arch =3D caps->host.arch; - cpu->type =3D VIR_CPU_TYPE_HOST; - cpu->sockets =3D nodeinfo.sockets; - cpu->cores =3D nodeinfo.cores; - cpu->threads =3D nodeinfo.threads; - - caps->host.cpu =3D cpu; - if (virCapabilitiesAddHostMigrateTransport(caps, "vzmigr") < 0) goto error; =20 - if (!(data =3D cpuNodeData(cpu->arch)) - || cpuDecode(cpu, data, NULL, 0, NULL) < 0) { - goto cleanup; - } - - cleanup: - virCPUDataFree(data); return caps; =20 error: virObjectUnref(caps); - goto cleanup; + return NULL; } =20 static void vzDriverDispose(void * obj) --=20 2.12.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed May 1 06:45:55 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.37 as permitted sender) client-ip=209.132.183.37; envelope-from=libvir-list-bounces@redhat.com; helo=mx5-phx2.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.37 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx5-phx2.redhat.com (mx5-phx2.redhat.com [209.132.183.37]) by mx.zohomail.com with SMTPS id 1488981010982807.1160723206648; Wed, 8 Mar 2017 05:50:10 -0800 (PST) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx5-phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v28DkXOs013872; Wed, 8 Mar 2017 08:46:33 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v28DkVl9029119 for ; Wed, 8 Mar 2017 08:46:31 -0500 Received: from virval.usersys.redhat.com (dhcp129-92.brq.redhat.com [10.34.129.92]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v28DkTv2021594 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Wed, 8 Mar 2017 08:46:30 -0500 Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 5D749102C13; Wed, 8 Mar 2017 14:46:29 +0100 (CET) From: Jiri Denemark To: libvir-list@redhat.com Date: Wed, 8 Mar 2017 14:46:24 +0100 Message-Id: <92118d7813f0bcb37ab1b842e4d3ba90bdac4914.1488980728.git.jdenemar@redhat.com> In-Reply-To: References: In-Reply-To: References: Mail-Followup-To: libvir-list@redhat.com X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 3/7] cpu: Add virCPUType parameter to virCPUGetHost 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-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The parameter can be used to request either VIR_CPU_TYPE_HOST (which has been assumed so far) or VIR_CPU_TYPE_GUEST definition. Signed-off-by: Jiri Denemark --- src/bhyve/bhyve_capabilities.c | 2 +- src/cpu/cpu.c | 41 ++++++++++++++++++++++++++++++++++++--= --- src/cpu/cpu.h | 1 + src/qemu/qemu_capabilities.c | 2 +- src/vmware/vmware_conf.c | 2 +- src/vz/vz_driver.c | 3 ++- 6 files changed, 42 insertions(+), 9 deletions(-) diff --git a/src/bhyve/bhyve_capabilities.c b/src/bhyve/bhyve_capabilities.c index c2c9303d7..33e670c5c 100644 --- a/src/bhyve/bhyve_capabilities.c +++ b/src/bhyve/bhyve_capabilities.c @@ -47,7 +47,7 @@ virBhyveCapsInitCPU(virCapsPtr caps, if (nodeGetInfo(&nodeinfo)) return -1; =20 - if (!(caps->host.cpu =3D virCPUGetHost(arch, &nodeinfo))) + if (!(caps->host.cpu =3D virCPUGetHost(arch, VIR_CPU_TYPE_HOST, &nodei= nfo))) return -1; =20 return 0; diff --git a/src/cpu/cpu.c b/src/cpu/cpu.c index c1666ed3b..110bb240c 100644 --- a/src/cpu/cpu.c +++ b/src/cpu/cpu.c @@ -360,9 +360,18 @@ virCPUDataFree(virCPUDataPtr data) * virCPUGetHost: * * @arch: CPU architecture + * @type: requested type of the CPU * @nodeInfo: simplified CPU topology (optional) * - * Create CPU definition describing the host's CPU. If @nodeInfo is not NU= LL, + * Create CPU definition describing the host's CPU. + * + * The @type (either VIR_CPU_TYPE_HOST or VIR_CPU_TYPE_GUEST) specifies wh= at + * type of CPU definition should be created. Specifically, VIR_CPU_TYPE_HO= ST + * CPUs may contain only features without any policy attribute. Requesting + * VIR_CPU_TYPE_GUEST provides better results because the CPU is allowed to + * contain disabled features. + * + * If @nodeInfo is not NULL (which is only allowed for VIR_CPU_TYPE_HOST C= PUs), * the CPU definition will have topology (sockets, cores, threads) filled = in * according to the content of @nodeInfo. The function fails only if @node= Info * was not passed in and the assigned CPU driver was not able to detect the @@ -373,13 +382,14 @@ virCPUDataFree(virCPUDataPtr data) */ virCPUDefPtr virCPUGetHost(virArch arch, + virCPUType type, virNodeInfoPtr nodeInfo) { struct cpuArchDriver *driver; virCPUDefPtr cpu =3D NULL; =20 - VIR_DEBUG("arch=3D%s, nodeInfo=3D%p", - virArchToString(arch), nodeInfo); + VIR_DEBUG("arch=3D%s, type=3D%s, nodeInfo=3D%p", + virArchToString(arch), virCPUTypeToString(type), nodeInfo); =20 if (!(driver =3D cpuGetSubDriver(arch))) return NULL; @@ -387,8 +397,29 @@ virCPUGetHost(virArch arch, if (VIR_ALLOC(cpu) < 0) return NULL; =20 - cpu->arch =3D arch; - cpu->type =3D VIR_CPU_TYPE_HOST; + switch (type) { + case VIR_CPU_TYPE_HOST: + cpu->arch =3D arch; + cpu->type =3D type; + break; + + case VIR_CPU_TYPE_GUEST: + if (nodeInfo) { + virReportError(VIR_ERR_INVALID_ARG, + _("cannot set topology for CPU type '%s'"), + virCPUTypeToString(type)); + goto error; + } + cpu->type =3D type; + break; + + case VIR_CPU_TYPE_AUTO: + case VIR_CPU_TYPE_LAST: + virReportError(VIR_ERR_INVALID_ARG, + _("unsupported CPU type: %s"), + virCPUTypeToString(type)); + goto error; + } =20 if (nodeInfo) { cpu->sockets =3D nodeInfo->sockets; diff --git a/src/cpu/cpu.h b/src/cpu/cpu.h index cbbb45223..e5eca08c3 100644 --- a/src/cpu/cpu.h +++ b/src/cpu/cpu.h @@ -170,6 +170,7 @@ virCPUDataFree(virCPUDataPtr data); =20 virCPUDefPtr virCPUGetHost(virArch arch, + virCPUType type, virNodeInfoPtr nodeInfo); =20 char * diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index b0a4861c3..b39014224 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -1070,7 +1070,7 @@ virQEMUCapsInitCPU(virCapsPtr caps, if (nodeGetInfo(&nodeinfo)) return -1; =20 - if (!(caps->host.cpu =3D virCPUGetHost(arch, &nodeinfo))) + if (!(caps->host.cpu =3D virCPUGetHost(arch, VIR_CPU_TYPE_HOST, &nodei= nfo))) return -1; =20 return 0; diff --git a/src/vmware/vmware_conf.c b/src/vmware/vmware_conf.c index d1444e462..cb6d60724 100644 --- a/src/vmware/vmware_conf.c +++ b/src/vmware/vmware_conf.c @@ -82,7 +82,7 @@ vmwareCapsInit(void) NULL, NULL, 0, NULL) =3D=3D NULL) goto error; =20 - if (!(cpu =3D virCPUGetHost(caps->host.arch, NULL))) + if (!(cpu =3D virCPUGetHost(caps->host.arch, VIR_CPU_TYPE_HOST, NULL))) goto error; =20 /* x86_64 guests are supported if diff --git a/src/vz/vz_driver.c b/src/vz/vz_driver.c index f97a2045b..67ec2727b 100644 --- a/src/vz/vz_driver.c +++ b/src/vz/vz_driver.c @@ -129,7 +129,8 @@ vzBuildCapabilities(void) if (nodeGetInfo(&nodeinfo)) goto error; =20 - if (!(caps->host.cpu =3D virCPUGetHost(caps->host.arch, &nodeinfo))) + if (!(caps->host.cpu =3D virCPUGetHost(caps->host.arch, VIR_CPU_TYPE_H= OST, + &nodeinfo))) goto error; =20 if (virCapabilitiesAddHostMigrateTransport(caps, "vzmigr") < 0) --=20 2.12.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed May 1 06:45:55 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.39 as permitted sender) client-ip=209.132.183.39; envelope-from=libvir-list-bounces@redhat.com; helo=mx6-phx2.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.39 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx6-phx2.redhat.com (mx6-phx2.redhat.com [209.132.183.39]) by mx.zohomail.com with SMTPS id 1488981046869763.4261239470978; Wed, 8 Mar 2017 05:50:46 -0800 (PST) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx6-phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v28Dl9UR020215; Wed, 8 Mar 2017 08:47:09 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v28DkWEv029138 for ; Wed, 8 Mar 2017 08:46:32 -0500 Received: from virval.usersys.redhat.com (dhcp129-92.brq.redhat.com [10.34.129.92]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v28DkTuS029958 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Wed, 8 Mar 2017 08:46:31 -0500 Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 5F7D3102C14; Wed, 8 Mar 2017 14:46:29 +0100 (CET) From: Jiri Denemark To: libvir-list@redhat.com Date: Wed, 8 Mar 2017 14:46:25 +0100 Message-Id: In-Reply-To: References: In-Reply-To: References: Mail-Followup-To: libvir-list@redhat.com X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 4/7] cpu: Add list of allowed CPU models to virCPUGetHost 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-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" When creating host CPU definition usable with a given emulator, the CPU should not be defined using an unsupported CPU model. The new @models and @nmodels parameters can be used to limit CPU models which can be used in the result. Signed-off-by: Jiri Denemark --- src/bhyve/bhyve_capabilities.c | 3 ++- src/cpu/cpu.c | 19 +++++++++++++++---- src/cpu/cpu.h | 8 ++++++-- src/cpu/cpu_ppc64.c | 6 ++++-- src/cpu/cpu_x86.c | 6 ++++-- src/qemu/qemu_capabilities.c | 3 ++- src/vmware/vmware_conf.c | 3 ++- src/vz/vz_driver.c | 2 +- 8 files changed, 36 insertions(+), 14 deletions(-) diff --git a/src/bhyve/bhyve_capabilities.c b/src/bhyve/bhyve_capabilities.c index 33e670c5c..60db0b791 100644 --- a/src/bhyve/bhyve_capabilities.c +++ b/src/bhyve/bhyve_capabilities.c @@ -47,7 +47,8 @@ virBhyveCapsInitCPU(virCapsPtr caps, if (nodeGetInfo(&nodeinfo)) return -1; =20 - if (!(caps->host.cpu =3D virCPUGetHost(arch, VIR_CPU_TYPE_HOST, &nodei= nfo))) + if (!(caps->host.cpu =3D virCPUGetHost(arch, VIR_CPU_TYPE_HOST, + &nodeinfo, NULL, 0))) return -1; =20 return 0; diff --git a/src/cpu/cpu.c b/src/cpu/cpu.c index 110bb240c..5b1940b47 100644 --- a/src/cpu/cpu.c +++ b/src/cpu/cpu.c @@ -362,6 +362,8 @@ virCPUDataFree(virCPUDataPtr data) * @arch: CPU architecture * @type: requested type of the CPU * @nodeInfo: simplified CPU topology (optional) + * @models: list of CPU models that can be considered for host CPU + * @nmodels: number of CPU models in @models * * Create CPU definition describing the host's CPU. * @@ -378,18 +380,26 @@ virCPUDataFree(virCPUDataPtr data) * host CPU model. In other words, a CPU definition containing just the * topology is a successful result even if detecting the host CPU model fa= ils. * + * It possible to limit the CPU model which may appear in the created CPU + * definition by passing non-NULL @models list. This is useful when reques= ting + * a CPU model usable on a specific hypervisor. If @models is NULL, any CPU + * model known to libvirt may appear in the result. + * * Returns host CPU definition or NULL on error. */ virCPUDefPtr virCPUGetHost(virArch arch, virCPUType type, - virNodeInfoPtr nodeInfo) + virNodeInfoPtr nodeInfo, + const char **models, + unsigned int nmodels) { struct cpuArchDriver *driver; virCPUDefPtr cpu =3D NULL; =20 - VIR_DEBUG("arch=3D%s, type=3D%s, nodeInfo=3D%p", - virArchToString(arch), virCPUTypeToString(type), nodeInfo); + VIR_DEBUG("arch=3D%s, type=3D%s, nodeInfo=3D%p, models=3D%p, nmodels= =3D%u", + virArchToString(arch), virCPUTypeToString(type), nodeInfo, + models, nmodels); =20 if (!(driver =3D cpuGetSubDriver(arch))) return NULL; @@ -431,7 +441,8 @@ virCPUGetHost(virArch arch, * filled in. */ if (driver->getHost) { - if (driver->getHost(cpu) < 0 && !nodeInfo) + if (driver->getHost(cpu, models, nmodels) < 0 && + !nodeInfo) goto error; } else if (nodeInfo) { VIR_DEBUG("cannot detect host CPU model for %s architecture", diff --git a/src/cpu/cpu.h b/src/cpu/cpu.h index e5eca08c3..c329eb134 100644 --- a/src/cpu/cpu.h +++ b/src/cpu/cpu.h @@ -71,7 +71,9 @@ typedef void (*cpuArchDataFree) (virCPUDataPtr data); =20 typedef int -(*virCPUArchGetHost)(virCPUDefPtr cpu); +(*virCPUArchGetHost)(virCPUDefPtr cpu, + const char **models, + unsigned int nmodels); =20 typedef virCPUDefPtr (*cpuArchBaseline) (virCPUDefPtr *cpus, @@ -171,7 +173,9 @@ virCPUDataFree(virCPUDataPtr data); virCPUDefPtr virCPUGetHost(virArch arch, virCPUType type, - virNodeInfoPtr nodeInfo); + virNodeInfoPtr nodeInfo, + const char **models, + unsigned int nmodels); =20 char * cpuBaselineXML(const char **xmlCPUs, diff --git a/src/cpu/cpu_ppc64.c b/src/cpu/cpu_ppc64.c index bb715546b..6e16ffd13 100644 --- a/src/cpu/cpu_ppc64.c +++ b/src/cpu/cpu_ppc64.c @@ -716,7 +716,9 @@ virCPUppc64DataFree(virCPUDataPtr data) =20 =20 static int -virCPUppc64GetHost(virCPUDefPtr cpu) +virCPUppc64GetHost(virCPUDefPtr cpu, + const char **models, + unsigned int nmodels) { virCPUDataPtr cpuData =3D NULL; virCPUppc64Data *data; @@ -738,7 +740,7 @@ virCPUppc64GetHost(virCPUDefPtr cpu) #endif data->pvr[0].mask =3D 0xfffffffful; =20 - ret =3D ppc64DriverDecode(cpu, cpuData, NULL, 0, NULL, 0); + ret =3D ppc64DriverDecode(cpu, cpuData, models, nmodels, NULL, 0); =20 cleanup: virCPUppc64DataFree(cpuData); diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index bddb169ba..6719acee2 100644 --- a/src/cpu/cpu_x86.c +++ b/src/cpu/cpu_x86.c @@ -2438,7 +2438,9 @@ cpuidSet(uint32_t base, virCPUDataPtr data) =20 =20 static int -virCPUx86GetHost(virCPUDefPtr cpu) +virCPUx86GetHost(virCPUDefPtr cpu, + const char **models, + unsigned int nmodels) { virCPUDataPtr cpuData =3D NULL; int ret =3D -1; @@ -2450,7 +2452,7 @@ virCPUx86GetHost(virCPUDefPtr cpu) cpuidSet(CPUX86_EXTENDED, cpuData) < 0) goto cleanup; =20 - ret =3D x86DecodeCPUData(cpu, cpuData, NULL, 0, NULL, 0); + ret =3D x86DecodeCPUData(cpu, cpuData, models, nmodels, NULL, 0); =20 cleanup: virCPUx86DataFree(cpuData); diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index b39014224..319600c30 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -1070,7 +1070,8 @@ virQEMUCapsInitCPU(virCapsPtr caps, if (nodeGetInfo(&nodeinfo)) return -1; =20 - if (!(caps->host.cpu =3D virCPUGetHost(arch, VIR_CPU_TYPE_HOST, &nodei= nfo))) + if (!(caps->host.cpu =3D virCPUGetHost(arch, VIR_CPU_TYPE_HOST, + &nodeinfo, NULL, 0))) return -1; =20 return 0; diff --git a/src/vmware/vmware_conf.c b/src/vmware/vmware_conf.c index cb6d60724..659c4737a 100644 --- a/src/vmware/vmware_conf.c +++ b/src/vmware/vmware_conf.c @@ -82,7 +82,8 @@ vmwareCapsInit(void) NULL, NULL, 0, NULL) =3D=3D NULL) goto error; =20 - if (!(cpu =3D virCPUGetHost(caps->host.arch, VIR_CPU_TYPE_HOST, NULL))) + if (!(cpu =3D virCPUGetHost(caps->host.arch, VIR_CPU_TYPE_HOST, + NULL, NULL, 0))) goto error; =20 /* x86_64 guests are supported if diff --git a/src/vz/vz_driver.c b/src/vz/vz_driver.c index 67ec2727b..b5d2964f3 100644 --- a/src/vz/vz_driver.c +++ b/src/vz/vz_driver.c @@ -130,7 +130,7 @@ vzBuildCapabilities(void) goto error; =20 if (!(caps->host.cpu =3D virCPUGetHost(caps->host.arch, VIR_CPU_TYPE_H= OST, - &nodeinfo))) + &nodeinfo, NULL, 0))) goto error; =20 if (virCapabilitiesAddHostMigrateTransport(caps, "vzmigr") < 0) --=20 2.12.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed May 1 06:45:55 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.24 as permitted sender) client-ip=209.132.183.24; envelope-from=libvir-list-bounces@redhat.com; helo=mx3-phx2.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.24 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx3-phx2.redhat.com (mx3-phx2.redhat.com [209.132.183.24]) by mx.zohomail.com with SMTPS id 1488981024447904.1353245454322; Wed, 8 Mar 2017 05:50:24 -0800 (PST) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx3-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v28DlBWh005236; Wed, 8 Mar 2017 08:47:11 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v28DkWxR029143 for ; Wed, 8 Mar 2017 08:46:32 -0500 Received: from virval.usersys.redhat.com (dhcp129-92.brq.redhat.com [10.34.129.92]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v28DkVUR029968 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Wed, 8 Mar 2017 08:46:32 -0500 Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 617CE102C15; Wed, 8 Mar 2017 14:46:29 +0100 (CET) From: Jiri Denemark To: libvir-list@redhat.com Date: Wed, 8 Mar 2017 14:46:26 +0100 Message-Id: In-Reply-To: References: In-Reply-To: References: Mail-Followup-To: libvir-list@redhat.com X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 5/7] qemu: Refactor virQEMUCapsInitCPU 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-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The function is now called virQEMUCapsProbeHostCPU. Both the refactoring and the change of the name is done for consistency with a new function which will be introduced in the following commit. Signed-off-by: Jiri Denemark --- src/qemu/qemu_capabilities.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 319600c30..08c66b088 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -1061,20 +1061,16 @@ virQEMUCapsInitGuestFromBinary(virCapsPtr caps, } =20 =20 -static int -virQEMUCapsInitCPU(virCapsPtr caps, - virArch arch) +static virCPUDefPtr +virQEMUCapsProbeHostCPU(virCapsPtr caps) { virNodeInfo nodeinfo; =20 if (nodeGetInfo(&nodeinfo)) - return -1; + return NULL; =20 - if (!(caps->host.cpu =3D virCPUGetHost(arch, VIR_CPU_TYPE_HOST, - &nodeinfo, NULL, 0))) - return -1; - - return 0; + return virCPUGetHost(caps->host.arch, VIR_CPU_TYPE_HOST, + &nodeinfo, NULL, 0); } =20 =20 @@ -1120,7 +1116,7 @@ virCapsPtr virQEMUCapsInit(virQEMUCapsCachePtr cache) VIR_WARN("Failed to query host NUMA topology, disabling NUMA capab= ilities"); } =20 - if (virQEMUCapsInitCPU(caps, hostarch) < 0) + if (!(caps->host.cpu =3D virQEMUCapsProbeHostCPU(caps))) VIR_WARN("Failed to get host CPU"); =20 /* Add the power management features of the host */ --=20 2.12.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed May 1 06:45:55 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.39 as permitted sender) client-ip=209.132.183.39; envelope-from=libvir-list-bounces@redhat.com; helo=mx6-phx2.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.39 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx6-phx2.redhat.com (mx6-phx2.redhat.com [209.132.183.39]) by mx.zohomail.com with SMTPS id 1488981042716561.3191914600418; Wed, 8 Mar 2017 05:50:42 -0800 (PST) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx6-phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v28DlCbX020237; Wed, 8 Mar 2017 08:47:12 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v28DkW27029148 for ; Wed, 8 Mar 2017 08:46:32 -0500 Received: from virval.usersys.redhat.com (dhcp129-92.brq.redhat.com [10.34.129.92]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v28DkV7t029967 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Wed, 8 Mar 2017 08:46:32 -0500 Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 63D10102C16; Wed, 8 Mar 2017 14:46:29 +0100 (CET) From: Jiri Denemark To: libvir-list@redhat.com Date: Wed, 8 Mar 2017 14:46:27 +0100 Message-Id: <43aa335e844ef1c683f9b068f9aa6925b2fedaf4.1488980728.git.jdenemar@redhat.com> In-Reply-To: References: In-Reply-To: References: Mail-Followup-To: libvir-list@redhat.com X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 6/7] qemu: Report better host-model CPUs in domain caps 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-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" One of the main reasons for introducing host-model CPU definition in a domain capabilities XML was the inability to express disabled features in a host capabilities XML. That is, when a host CPU is, e.g., Haswell without x2apic support, host capabilities XML will have to report it as Westmere + a bunch of additional features., but we really want to use Haswell - x2apic when creating a host-model CPU. Unfortunately, I somehow forgot to do the last step and the code would just copy the CPU definition found in the host capabilities XML. This changed recently for new QEMU versions which allow us to query host CPU, but any slightly older QEMU will not benefit from any change I did. This patch makes sure the right CPU model is filled in the domain capabilities even with old QEMU. The issue was reported in https://bugzilla.redhat.com/show_bug.cgi?id=3D1426456 Signed-off-by: Jiri Denemark --- src/qemu/qemu_capabilities.c | 32 ++++++++++++++++++++++++++++---- src/qemu/qemu_capspriv.h | 5 +++++ tests/Makefile.am | 11 +++++++++-- tests/domaincapstest.c | 6 ++++++ tests/qemucpumock.c | 35 +++++++++++++++++++++++++++++++++++ tests/qemuxml2argvtest.c | 6 ++++-- 6 files changed, 87 insertions(+), 8 deletions(-) create mode 100644 tests/qemucpumock.c diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 08c66b088..70f9ed777 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -1074,6 +1074,26 @@ virQEMUCapsProbeHostCPU(virCapsPtr caps) } =20 =20 +virCPUDefPtr +virQEMUCapsProbeHostCPUForEmulator(virCapsPtr caps, + virQEMUCapsPtr qemuCaps, + virDomainVirtType type) +{ + size_t nmodels; + char **models; + virCPUDefPtr cpu; + + if (virQEMUCapsGetCPUDefinitions(qemuCaps, type, &models, &nmodels) < = 0) + return NULL; + + cpu =3D virCPUGetHost(caps->host.arch, VIR_CPU_TYPE_GUEST, NULL, + (const char **) models, nmodels); + + virStringListFreeCount(models, nmodels); + return cpu; +} + + static int virQEMUCapsInitPages(virCapsPtr caps) { @@ -3207,6 +3227,7 @@ virQEMUCapsInitHostCPUModel(virQEMUCapsPtr qemuCaps, virDomainVirtType type) { virCPUDefPtr cpu =3D NULL; + virCPUDefPtr hostCPU =3D NULL; int rc; =20 if (!caps || !virQEMUCapsGuestIsNative(caps->host.arch, qemuCaps->arch= )) @@ -3223,11 +3244,11 @@ virQEMUCapsInitHostCPUModel(virQEMUCapsPtr qemuCaps, if ((rc =3D virQEMUCapsInitCPUModel(qemuCaps, type, cpu)) < 0) { goto error; } else if (rc =3D=3D 1) { - VIR_DEBUG("No host CPU model info from QEMU; using host capabiliti= es"); - if (!caps->host.cpu || !caps->host.cpu->model) - goto error; + VIR_DEBUG("No host CPU model info from QEMU; probing host CPU dire= ctly"); =20 - if (virCPUDefCopyModelFilter(cpu, caps->host.cpu, true, + hostCPU =3D virQEMUCapsProbeHostCPUForEmulator(caps, qemuCaps, typ= e); + if (!hostCPU || + virCPUDefCopyModelFilter(cpu, hostCPU, true, virQEMUCapsCPUFilterFeatures, qemuCaps) < 0) goto error; @@ -3238,11 +3259,14 @@ virQEMUCapsInitHostCPUModel(virQEMUCapsPtr qemuCaps, else qemuCaps->tcgCPUModel =3D cpu; =20 + cleanup: + virCPUDefFree(hostCPU); return; =20 error: virCPUDefFree(cpu); virResetLastError(); + goto cleanup; } =20 =20 diff --git a/src/qemu/qemu_capspriv.h b/src/qemu/qemu_capspriv.h index e0544f273..ee29b8bba 100644 --- a/src/qemu/qemu_capspriv.h +++ b/src/qemu/qemu_capspriv.h @@ -87,4 +87,9 @@ void virQEMUCapsSetCPUModelInfo(virQEMUCapsPtr qemuCaps, virDomainVirtType type, qemuMonitorCPUModelInfoPtr modelInfo); + +virCPUDefPtr +virQEMUCapsProbeHostCPUForEmulator(virCapsPtr caps, + virQEMUCapsPtr qemuCaps, + virDomainVirtType type); #endif diff --git a/tests/Makefile.am b/tests/Makefile.am index 35e82abf5..af69a3a84 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -284,6 +284,7 @@ test_libraries +=3D libqemumonitortestutils.la \ qemuxml2xmlmock.la \ qemucaps2xmlmock.la \ qemucapsprobemock.la \ + qemucpumock.la \ $(NULL) endif WITH_QEMU =20 @@ -549,10 +550,16 @@ libqemutestdriver_la_SOURCES =3D libqemutestdriver_la_LDFLAGS =3D $(QEMULIB_LDFLAGS) libqemutestdriver_la_LIBADD =3D $(qemu_LDADDS) =20 +qemucpumock_la_SOURCES =3D \ + qemucpumock.c +qemucpumock_la_CFLAGS =3D $(AM_CFLAGS) +qemucpumock_la_LDFLAGS =3D $(MOCKLIBS_LDFLAGS) +qemucpumock_la_LIBADD =3D $(MOCKLIBS_LIBS) + qemuxml2argvtest_SOURCES =3D \ qemuxml2argvtest.c testutilsqemu.c testutilsqemu.h \ testutils.c testutils.h -qemuxml2argvtest_LDADD =3D $(qemu_LDADDS) $(LDADDS) $(LIBXML_LIBS) +qemuxml2argvtest_LDADD =3D libqemutestdriver.la $(LDADDS) $(LIBXML_LIBS) =20 qemuxml2argvmock_la_SOURCES =3D \ qemuxml2argvmock.c @@ -949,7 +956,7 @@ domaincapstest_LDADD =3D $(LDADDS) =20 if WITH_QEMU domaincapstest_SOURCES +=3D testutilsqemu.c testutilsqemu.h -domaincapstest_LDADD +=3D $(qemu_LDADDS) $(GNULIB_LIBS) +domaincapstest_LDADD +=3D libqemutestdriver.la $(GNULIB_LIBS) endif WITH_QEMU =20 if WITH_LIBXL diff --git a/tests/domaincapstest.c b/tests/domaincapstest.c index 9b64f2c18..a4bc8d6d0 100644 --- a/tests/domaincapstest.c +++ b/tests/domaincapstest.c @@ -491,4 +491,10 @@ mymain(void) return ret; } =20 +#if WITH_QEMU +VIRT_TEST_MAIN_PRELOAD(mymain, + abs_builddir "/.libs/domaincapsmock.so", + abs_builddir "/.libs/qemucpumock.so") +#else VIRT_TEST_MAIN_PRELOAD(mymain, abs_builddir "/.libs/domaincapsmock.so") +#endif diff --git a/tests/qemucpumock.c b/tests/qemucpumock.c new file mode 100644 index 000000000..2c1d24dd4 --- /dev/null +++ b/tests/qemucpumock.c @@ -0,0 +1,35 @@ +/* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see + * . + */ + +#include + +#include "internal.h" +#include "qemu/qemu_capabilities.h" +#define __QEMU_CAPSRIV_H_ALLOW__ +#include "qemu/qemu_capspriv.h" +#undef __QEMU_CAPSRIV_H_ALLOW__ + + +virCPUDefPtr +virQEMUCapsProbeHostCPUForEmulator(virCapsPtr caps, + virQEMUCapsPtr qemuCaps ATTRIBUTE_UNUSE= D, + virDomainVirtType type ATTRIBUTE_UNUSED) +{ + if (!caps || !caps->host.cpu || !caps->host.cpu->model) + return NULL; + + return virCPUDefCopy(caps->host.cpu); +} diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index d2d267fce..018b176c4 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -2476,8 +2476,10 @@ mymain(void) return ret =3D=3D 0 ? EXIT_SUCCESS : EXIT_FAILURE; } =20 -VIRT_TEST_MAIN_PRELOAD(mymain, abs_builddir "/.libs/qemuxml2argvmock.so", - abs_builddir "/.libs/virrandommock.so") +VIRT_TEST_MAIN_PRELOAD(mymain, + abs_builddir "/.libs/qemuxml2argvmock.so", + abs_builddir "/.libs/virrandommock.so", + abs_builddir "/.libs/qemucpumock.so") =20 #else =20 --=20 2.12.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed May 1 06:45:55 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.39 as permitted sender) client-ip=209.132.183.39; envelope-from=libvir-list-bounces@redhat.com; helo=mx6-phx2.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.39 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx6-phx2.redhat.com (mx6-phx2.redhat.com [209.132.183.39]) by mx.zohomail.com with SMTPS id 1488981049932246.95721247606264; Wed, 8 Mar 2017 05:50:49 -0800 (PST) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx6-phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v28DlEkY020248; Wed, 8 Mar 2017 08:47:14 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v28DkXS1029156 for ; Wed, 8 Mar 2017 08:46:33 -0500 Received: from virval.usersys.redhat.com (dhcp129-92.brq.redhat.com [10.34.129.92]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v28DkVqH015456 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Wed, 8 Mar 2017 08:46:32 -0500 Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 65D1B102C17; Wed, 8 Mar 2017 14:46:29 +0100 (CET) From: Jiri Denemark To: libvir-list@redhat.com Date: Wed, 8 Mar 2017 14:46:28 +0100 Message-Id: <3a8b533e1781764b8020a09bb4521cd4d89ff44a.1488980728.git.jdenemar@redhat.com> In-Reply-To: References: In-Reply-To: References: Mail-Followup-To: libvir-list@redhat.com X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 7/7] cputest: New test for Intel Core i7-4510U 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-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Jiri Denemark --- Notes: This is the host CPU which allowed me to find the missing functionality, but I haven't quite figured out how to test this stuff all the way up to domain capabilities XML. Let's just add it to the low level tests for now. tests/cputest.c | 1 + .../x86_64-cpuid-Core-i7-4510U-guest.xml | 29 +++ .../x86_64-cpuid-Core-i7-4510U-host.xml | 44 +++++ .../x86_64-cpuid-Core-i7-4510U-json.xml | 15 ++ tests/cputestdata/x86_64-cpuid-Core-i7-4510U.json | 203 +++++++++++++++++= ++++ tests/cputestdata/x86_64-cpuid-Core-i7-4510U.xml | 34 ++++ 6 files changed, 326 insertions(+) create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i7-4510U-guest.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i7-4510U-host.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i7-4510U-json.xml create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i7-4510U.json create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i7-4510U.xml diff --git a/tests/cputest.c b/tests/cputest.c index 685aca152..5e205c501 100644 --- a/tests/cputest.c +++ b/tests/cputest.c @@ -827,6 +827,7 @@ mymain(void) DO_TEST_CPUID(VIR_ARCH_X86_64, "Core-i7-3740QM", true); DO_TEST_CPUID(VIR_ARCH_X86_64, "Core-i7-3770", true); DO_TEST_CPUID(VIR_ARCH_X86_64, "Core-i7-4600U", true); + DO_TEST_CPUID(VIR_ARCH_X86_64, "Core-i7-4510U", true); DO_TEST_CPUID(VIR_ARCH_X86_64, "Core-i7-5600U", true); DO_TEST_CPUID(VIR_ARCH_X86_64, "Core2-E6850", true); DO_TEST_CPUID(VIR_ARCH_X86_64, "Core2-Q9500", false); diff --git a/tests/cputestdata/x86_64-cpuid-Core-i7-4510U-guest.xml b/tests= /cputestdata/x86_64-cpuid-Core-i7-4510U-guest.xml new file mode 100644 index 000000000..bcce4ece1 --- /dev/null +++ b/tests/cputestdata/x86_64-cpuid-Core-i7-4510U-guest.xml @@ -0,0 +1,29 @@ + + Haswell-noTSX + Intel + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/cputestdata/x86_64-cpuid-Core-i7-4510U-host.xml b/tests/= cputestdata/x86_64-cpuid-Core-i7-4510U-host.xml new file mode 100644 index 000000000..61bcefbfc --- /dev/null +++ b/tests/cputestdata/x86_64-cpuid-Core-i7-4510U-host.xml @@ -0,0 +1,44 @@ + + x86_64 + Westmere + Intel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/cputestdata/x86_64-cpuid-Core-i7-4510U-json.xml b/tests/= cputestdata/x86_64-cpuid-Core-i7-4510U-json.xml new file mode 100644 index 000000000..3ca3b0f24 --- /dev/null +++ b/tests/cputestdata/x86_64-cpuid-Core-i7-4510U-json.xml @@ -0,0 +1,15 @@ + + Haswell-noTSX + Intel + + + + + + + + + + + + diff --git a/tests/cputestdata/x86_64-cpuid-Core-i7-4510U.json b/tests/cput= estdata/x86_64-cpuid-Core-i7-4510U.json new file mode 100644 index 000000000..3cbcdff5c --- /dev/null +++ b/tests/cputestdata/x86_64-cpuid-Core-i7-4510U.json @@ -0,0 +1,203 @@ +{ + "return": { + "model": { + "name": "base", + "props": { + "pfthreshold": false, + "pku": false, + "rtm": false, + "tsc_adjust": true, + "tsc-deadline": true, + "xstore-en": false, + "tsc-scale": false, + "sse": true, + "smap": false, + "stepping": 1, + "tce": false, + "kvm_steal_time": true, + "smep": true, + "rdpid": false, + "xcrypt": false, + "sse4_2": true, + "monitor": false, + "sse4_1": true, + "kvm-mmu": false, + "flushbyasid": false, + "kvm-steal-time": true, + "lm": true, + "tsc": true, + "adx": false, + "fxsr": true, + "sha-ni": false, + "tm": false, + "pclmuldq": true, + "xgetbv1": false, + "xstore": false, + "vmcb_clean": false, + "vme": true, + "vendor": "GenuineIntel", + "arat": true, + "ffxsr": false, + "de": true, + "avx512f": false, + "pse": true, + "ds-cpl": false, + "tbm": false, + "ia64": false, + "phe-en": false, + "f16c": true, + "ds": false, + "mpx": false, + "tsc-adjust": true, + "aes": true, + "avx2": true, + "pbe": false, + "cx16": true, + "ds_cpl": false, + "movbe": true, + "perfctr-nb": false, + "nrip_save": false, + "kvm_mmu": false, + "ospke": false, + "avx512ifma": false, + "vmx": true, + "sep": true, + "xsaveopt": true, + "sse4a": false, + "avx512dq": false, + "i64": true, + "avx512-4vnniw": false, + "xsave": true, + "erms": true, + "hle": false, + "nodeid_msr": false, + "est": false, + "svm_lock": false, + "xop": false, + "model-id": "Intel(R) Core(TM) i7-4510U CPU @ 2.00GHz", + "abm": true, + "avx512er": false, + "sse4.1": true, + "sse4.2": true, + "pause-filter": false, + "lahf-lm": true, + "kvm-nopiodelay": true, + "cmp_legacy": false, + "acpi": false, + "fma4": false, + "popcnt": true, + "mmx": true, + "osxsave": false, + "pcommit": false, + "avx512pf": false, + "clwb": false, + "dca": false, + "pdcm": false, + "xcrypt-en": false, + "3dnow": false, + "invtsc": false, + "tm2": false, + "hypervisor": true, + "kvmclock-stable-bit": true, + "fxsr-opt": false, + "pcid": true, + "sse4-1": true, + "sse4-2": true, + "avx512-vpopcntdq": false, + "avx512-4fmaps": false, + "pause_filter": false, + "svm-lock": false, + "rdrand": true, + "nrip-save": false, + "avx512vl": false, + "x2apic": true, + "kvmclock": true, + "pge": true, + "family": 6, + "dtes64": false, + "xd": true, + "kvm_pv_eoi": true, + "ace2": false, + "kvm_pv_unhalt": true, + "xtpr": false, + "perfctr_nb": false, + "avx512bw": false, + "nx": true, + "lwp": false, + "msr": true, + "ace2-en": false, + "decodeassists": false, + "perfctr-core": false, + "pn": false, + "fma": true, + "nodeid-msr": false, + "kvm_asyncpf": true, + "clflush": true, + "cx8": true, + "mce": true, + "avx512cd": false, + "cr8legacy": false, + "mca": true, + "pni": true, + "rdseed": false, + "apic": true, + "fsgsbase": true, + "cmp-legacy": false, + "kvm-pv-unhalt": true, + "rdtscp": true, + "mmxext": false, + "cid": false, + "ssse3": true, + "extapic": false, + "pse36": true, + "mtrr": true, + "ibs": false, + "la57": false, + "avx": true, + "syscall": true, + "umip": false, + "invpcid": true, + "avx512vbmi": false, + "kvm-asyncpf": true, + "vmcb-clean": false, + "pmm": false, + "cmov": true, + "perfctr_core": false, + "misalignsse": false, + "clflushopt": false, + "pat": true, + "lbrv": false, + "3dnowprefetch": false, + "fpu": true, + "pae": true, + "wdt": false, + "tsc_scale": false, + "skinit": false, + "fxsr_opt": false, + "kvm_nopiodelay": true, + "pmm-en": false, + "phe": false, + "3dnowext": false, + "osvw": false, + "ht": false, + "pdpe1gb": true, + "kvm-pv-eoi": true, + "npt": false, + "xsavec": false, + "lahf_lm": true, + "pclmulqdq": true, + "svm": false, + "sse3": true, + "sse2": true, + "ss": true, + "topoext": false, + "smx": false, + "bmi1": true, + "bmi2": true, + "xsaves": false, + "model": 69 + } + } + }, + "id": "model-expansion" +} diff --git a/tests/cputestdata/x86_64-cpuid-Core-i7-4510U.xml b/tests/cpute= stdata/x86_64-cpuid-Core-i7-4510U.xml new file mode 100644 index 000000000..3ab114775 --- /dev/null +++ b/tests/cputestdata/x86_64-cpuid-Core-i7-4510U.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + --=20 2.12.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list