From nobody Sun May 5 11:39:24 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1534421449673519.2599504232816; Thu, 16 Aug 2018 05:10:49 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F2C003169B2D; Thu, 16 Aug 2018 12:10:46 +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 B41765B68C; Thu, 16 Aug 2018 12:10:46 +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 5C71518363F4; Thu, 16 Aug 2018 12:10:46 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7GCAbs1026256 for ; Thu, 16 Aug 2018 08:10:37 -0400 Received: by smtp.corp.redhat.com (Postfix) id 03AA62166BB1; Thu, 16 Aug 2018 12:10:37 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-117-135.ams2.redhat.com [10.36.117.135]) by smtp.corp.redhat.com (Postfix) with ESMTP id 300FE2166BA0; Thu, 16 Aug 2018 12:10:35 +0000 (UTC) From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Thu, 16 Aug 2018 13:10:24 +0100 Message-Id: <20180816121031.10902-2-berrange@redhat.com> In-Reply-To: <20180816121031.10902-1-berrange@redhat.com> References: <20180816121031.10902-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 1/8] cpu: allow include files for CPU definition 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: , Content-Type: text/plain; charset="utf-8" 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Thu, 16 Aug 2018 12:10:47 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Allow for syntax to reference other files in the CPU database directory Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Jiri Denemark --- src/cpu/cpu_map.c | 87 +++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 84 insertions(+), 3 deletions(-) diff --git a/src/cpu/cpu_map.c b/src/cpu/cpu_map.c index d263eb8cdd..bcd3e55417 100644 --- a/src/cpu/cpu_map.c +++ b/src/cpu/cpu_map.c @@ -1,7 +1,7 @@ /* * cpu_map.c: internal functions for handling CPU mapping configuration * - * Copyright (C) 2009-2010 Red Hat, Inc. + * Copyright (C) 2009-2018 Red Hat, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -70,6 +70,84 @@ static int load(xmlXPathContextPtr ctxt, return ret; } =20 +static int +cpuMapLoadInclude(const char *filename, + cpuMapLoadCallback cb, + void *data) +{ + xmlDocPtr xml =3D NULL; + xmlXPathContextPtr ctxt =3D NULL; + int ret =3D -1; + int element; + char *mapfile; + + if (!(mapfile =3D virFileFindResource(filename, + abs_topsrcdir "/src/cpu", + PKGDATADIR))) + return -1; + + VIR_DEBUG("Loading CPU map include from %s", mapfile); + + if (!(xml =3D virXMLParseFileCtxt(mapfile, &ctxt))) + goto cleanup; + + ctxt->node =3D xmlDocGetRootElement(xml); + + for (element =3D 0; element < CPU_MAP_ELEMENT_LAST; element++) { + if (load(ctxt, element, cb, data) < 0) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("cannot parse CPU map '%s'"), mapfile); + goto cleanup; + } + } + + ret =3D 0; + + cleanup: + xmlXPathFreeContext(ctxt); + xmlFreeDoc(xml); + VIR_FREE(mapfile); + + return ret; +} + + +static int +loadIncludes(xmlXPathContextPtr ctxt, + cpuMapLoadCallback callback, + void *data) +{ + int ret =3D -1; + xmlNodePtr ctxt_node; + xmlNodePtr *nodes =3D NULL; + int n; + size_t i; + + ctxt_node =3D ctxt->node; + + n =3D virXPathNodeSet("include", ctxt, &nodes); + if (n < 0) + goto cleanup; + + for (i =3D 0; i < n; i++) { + char *filename =3D virXMLPropString(nodes[i], "filename"); + VIR_DEBUG("Finding CPU map include '%s'", filename); + if (cpuMapLoadInclude(filename, callback, data) < 0) { + VIR_FREE(filename); + goto cleanup; + } + VIR_FREE(filename); + } + + ret =3D 0; + + cleanup: + ctxt->node =3D ctxt_node; + VIR_FREE(nodes); + + return ret; +} + =20 int cpuMapLoad(const char *arch, cpuMapLoadCallback cb, @@ -88,7 +166,7 @@ int cpuMapLoad(const char *arch, PKGDATADIR))) return -1; =20 - VIR_DEBUG("Loading CPU map from %s", mapfile); + VIR_DEBUG("Loading '%s' CPU map from %s", NULLSTR(arch), mapfile); =20 if (arch =3D=3D NULL) { virReportError(VIR_ERR_INTERNAL_ERROR, @@ -122,11 +200,14 @@ int cpuMapLoad(const char *arch, for (element =3D 0; element < CPU_MAP_ELEMENT_LAST; element++) { if (load(ctxt, element, cb, data) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot parse CPU map for %s architecture"), = arch); + _("cannot parse CPU map '%s'"), mapfile); goto cleanup; } } =20 + if (loadIncludes(ctxt, cb, data) < 0) + goto cleanup; + ret =3D 0; =20 cleanup: --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 11:39:24 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1534421444247933.8945120552934; Thu, 16 Aug 2018 05:10:44 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E33E8C058CD8; Thu, 16 Aug 2018 12:10:41 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AD6965D96F; Thu, 16 Aug 2018 12:10:41 +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 60D827F1EA; Thu, 16 Aug 2018 12:10:41 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7GCAcbH026262 for ; Thu, 16 Aug 2018 08:10:38 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3AB832166BA5; Thu, 16 Aug 2018 12:10:38 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-117-135.ams2.redhat.com [10.36.117.135]) by smtp.corp.redhat.com (Postfix) with ESMTP id 71A152166BA0; Thu, 16 Aug 2018 12:10:37 +0000 (UTC) From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Thu, 16 Aug 2018 13:10:25 +0100 Message-Id: <20180816121031.10902-3-berrange@redhat.com> In-Reply-To: <20180816121031.10902-1-berrange@redhat.com> References: <20180816121031.10902-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 2/8] cpu: fix cleanup when signature parsing fails 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: , Content-Type: text/plain; charset="utf-8" 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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Thu, 16 Aug 2018 12:10:42 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Two pieces of code accidentally jumped to the wrong label when they failed causing incorrect cleanup, returning a partially initialized CPU model struct. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Jiri Denemark --- src/cpu/cpu_x86.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index 809da94117..a045a8280c 100644 --- a/src/cpu/cpu_x86.c +++ b/src/cpu/cpu_x86.c @@ -1242,7 +1242,7 @@ x86ModelParse(xmlXPathContextPtr ctxt, virReportError(VIR_ERR_INTERNAL_ERROR, _("Invalid CPU signature family in model %s"), model->name); - goto cleanup; + goto error; } =20 rc =3D virXPathUInt("string(./signature/@model)", ctxt, &sigModel); @@ -1250,7 +1250,7 @@ x86ModelParse(xmlXPathContextPtr ctxt, virReportError(VIR_ERR_INTERNAL_ERROR, _("Invalid CPU signature model in model %s"), model->name); - goto cleanup; + goto error; } =20 model->signature =3D x86MakeSignature(sigFamily, sigModel, 0); --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 11:39:24 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 15344214449821000.2063227024706; Thu, 16 Aug 2018 05:10:44 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EFF7E308403F; Thu, 16 Aug 2018 12:10:41 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AF4EC308BDC7; Thu, 16 Aug 2018 12:10:41 +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 5FBB07F1E9; Thu, 16 Aug 2018 12:10:41 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7GCAdrI026270 for ; Thu, 16 Aug 2018 08:10:39 -0400 Received: by smtp.corp.redhat.com (Postfix) id 790002166BB1; Thu, 16 Aug 2018 12:10:39 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-117-135.ams2.redhat.com [10.36.117.135]) by smtp.corp.redhat.com (Postfix) with ESMTP id 891472166BA0; Thu, 16 Aug 2018 12:10:38 +0000 (UTC) From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Thu, 16 Aug 2018 13:10:26 +0100 Message-Id: <20180816121031.10902-4-berrange@redhat.com> In-Reply-To: <20180816121031.10902-1-berrange@redhat.com> References: <20180816121031.10902-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 3/8] cpu: push more parsing logic into common code 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: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Thu, 16 Aug 2018 12:10:43 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 The x86 and ppc impls both duplicate some logic when parsing CPU features. Change the callback signature so that this duplication can be pushed up a level to common code. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Jiri Denemark --- src/cpu/cpu_map.c | 98 +++++++++++++--------- src/cpu/cpu_map.h | 22 ++--- src/cpu/cpu_ppc64.c | 112 ++++++------------------- src/cpu/cpu_x86.c | 196 +++++++++++++------------------------------- 4 files changed, 143 insertions(+), 285 deletions(-) diff --git a/src/cpu/cpu_map.c b/src/cpu/cpu_map.c index bcd3e55417..400e6f1427 100644 --- a/src/cpu/cpu_map.c +++ b/src/cpu/cpu_map.c @@ -35,31 +35,47 @@ =20 VIR_LOG_INIT("cpu.cpu_map"); =20 -VIR_ENUM_IMPL(cpuMapElement, CPU_MAP_ELEMENT_LAST, - "vendor", - "feature", - "model") - - -static int load(xmlXPathContextPtr ctxt, - cpuMapElement element, - cpuMapLoadCallback callback, - void *data) +static int +loadData(const char *mapfile, + xmlXPathContextPtr ctxt, + const char *element, + cpuMapLoadCallback callback, + void *data) { int ret =3D -1; xmlNodePtr ctxt_node; xmlNodePtr *nodes =3D NULL; int n; + size_t i; + int rv; =20 ctxt_node =3D ctxt->node; =20 - n =3D virXPathNodeSet(cpuMapElementTypeToString(element), ctxt, &nodes= ); - if (n < 0) + if ((n =3D virXPathNodeSet(element, ctxt, &nodes)) < 0) goto cleanup; =20 - if (n > 0 && - callback(element, ctxt, nodes, n, data) < 0) + if (n > 0 && !callback) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Unexpected element '%s' in CPU map '%s'"), eleme= nt, mapfile); goto cleanup; + } + + for (i =3D 0; i < n; i++) { + xmlNodePtr old =3D ctxt->node; + char *name =3D virXMLPropString(nodes[i], "name"); + if (!name) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("cannot find %s name in CPU map '%s'"), eleme= nt, mapfile); + goto cleanup; + } + VIR_DEBUG("Load %s name %s", element, name); + ctxt->node =3D nodes[i]; + rv =3D callback(ctxt, name, data); + ctxt->node =3D old; + VIR_FREE(name); + if (rv < 0) + goto cleanup; + } =20 ret =3D 0; =20 @@ -72,13 +88,14 @@ static int load(xmlXPathContextPtr ctxt, =20 static int cpuMapLoadInclude(const char *filename, - cpuMapLoadCallback cb, + cpuMapLoadCallback vendorCB, + cpuMapLoadCallback featureCB, + cpuMapLoadCallback modelCB, void *data) { xmlDocPtr xml =3D NULL; xmlXPathContextPtr ctxt =3D NULL; int ret =3D -1; - int element; char *mapfile; =20 if (!(mapfile =3D virFileFindResource(filename, @@ -93,13 +110,14 @@ cpuMapLoadInclude(const char *filename, =20 ctxt->node =3D xmlDocGetRootElement(xml); =20 - for (element =3D 0; element < CPU_MAP_ELEMENT_LAST; element++) { - if (load(ctxt, element, cb, data) < 0) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot parse CPU map '%s'"), mapfile); - goto cleanup; - } - } + if (loadData(mapfile, ctxt, "vendor", vendorCB, data) < 0) + goto cleanup; + + if (loadData(mapfile, ctxt, "feature", featureCB, data) < 0) + goto cleanup; + + if (loadData(mapfile, ctxt, "model", modelCB, data) < 0) + goto cleanup; =20 ret =3D 0; =20 @@ -114,7 +132,9 @@ cpuMapLoadInclude(const char *filename, =20 static int loadIncludes(xmlXPathContextPtr ctxt, - cpuMapLoadCallback callback, + cpuMapLoadCallback vendorCB, + cpuMapLoadCallback featureCB, + cpuMapLoadCallback modelCB, void *data) { int ret =3D -1; @@ -132,7 +152,7 @@ loadIncludes(xmlXPathContextPtr ctxt, for (i =3D 0; i < n; i++) { char *filename =3D virXMLPropString(nodes[i], "filename"); VIR_DEBUG("Finding CPU map include '%s'", filename); - if (cpuMapLoadInclude(filename, callback, data) < 0) { + if (cpuMapLoadInclude(filename, vendorCB, featureCB, modelCB, data= ) < 0) { VIR_FREE(filename); goto cleanup; } @@ -150,7 +170,9 @@ loadIncludes(xmlXPathContextPtr ctxt, =20 =20 int cpuMapLoad(const char *arch, - cpuMapLoadCallback cb, + cpuMapLoadCallback vendorCB, + cpuMapLoadCallback featureCB, + cpuMapLoadCallback modelCB, void *data) { xmlDocPtr xml =3D NULL; @@ -158,7 +180,6 @@ int cpuMapLoad(const char *arch, virBuffer buf =3D VIR_BUFFER_INITIALIZER; char *xpath =3D NULL; int ret =3D -1; - int element; char *mapfile; =20 if (!(mapfile =3D virFileFindResource("cpu_map.xml", @@ -174,12 +195,6 @@ int cpuMapLoad(const char *arch, goto cleanup; } =20 - if (cb =3D=3D NULL) { - virReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("no callback provided")); - goto cleanup; - } - if (!(xml =3D virXMLParseFileCtxt(mapfile, &ctxt))) goto cleanup; =20 @@ -197,15 +212,16 @@ int cpuMapLoad(const char *arch, goto cleanup; } =20 - for (element =3D 0; element < CPU_MAP_ELEMENT_LAST; element++) { - if (load(ctxt, element, cb, data) < 0) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot parse CPU map '%s'"), mapfile); - goto cleanup; - } - } + if (loadData(mapfile, ctxt, "vendor", vendorCB, data) < 0) + goto cleanup; + + if (loadData(mapfile, ctxt, "feature", featureCB, data) < 0) + goto cleanup; + + if (loadData(mapfile, ctxt, "model", modelCB, data) < 0) + goto cleanup; =20 - if (loadIncludes(ctxt, cb, data) < 0) + if (loadIncludes(ctxt, vendorCB, featureCB, modelCB, data) < 0) goto cleanup; =20 ret =3D 0; diff --git a/src/cpu/cpu_map.h b/src/cpu/cpu_map.h index 0c7507e98f..4596987150 100644 --- a/src/cpu/cpu_map.h +++ b/src/cpu/cpu_map.h @@ -26,28 +26,16 @@ =20 # include "virxml.h" =20 - -typedef enum { - CPU_MAP_ELEMENT_VENDOR, - CPU_MAP_ELEMENT_FEATURE, - CPU_MAP_ELEMENT_MODEL, - - CPU_MAP_ELEMENT_LAST -} cpuMapElement; - -VIR_ENUM_DECL(cpuMapElement) - - typedef int -(*cpuMapLoadCallback) (cpuMapElement element, - xmlXPathContextPtr ctxt, - xmlNodePtr *nodes, - int n, +(*cpuMapLoadCallback) (xmlXPathContextPtr ctxt, + const char *name, void *data); =20 int cpuMapLoad(const char *arch, - cpuMapLoadCallback cb, + cpuMapLoadCallback vendorCB, + cpuMapLoadCallback featureCB, + cpuMapLoadCallback modelCB, void *data); =20 #endif /* __VIR_CPU_MAP_H__ */ diff --git a/src/cpu/cpu_ppc64.c b/src/cpu/cpu_ppc64.c index d562677fa3..75da5b77d8 100644 --- a/src/cpu/cpu_ppc64.c +++ b/src/cpu/cpu_ppc64.c @@ -281,21 +281,19 @@ ppc64MapFree(struct ppc64_map *map) VIR_FREE(map); } =20 -static struct ppc64_vendor * -ppc64VendorParse(xmlXPathContextPtr ctxt, - struct ppc64_map *map) +static int +ppc64VendorParse(xmlXPathContextPtr ctxt ATTRIBUTE_UNUSED, + const char *name, + void *data) { + struct ppc64_map *map =3D data; struct ppc64_vendor *vendor; =20 if (VIR_ALLOC(vendor) < 0) - return NULL; + return -1; =20 - vendor->name =3D virXPathString("string(@name)", ctxt); - if (!vendor->name) { - virReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("Missing CPU vendor name")); + if (VIR_STRDUP(vendor->name, name) < 0) goto error; - } =20 if (ppc64VendorFind(map, vendor->name)) { virReportError(VIR_ERR_INTERNAL_ERROR, @@ -303,57 +301,36 @@ ppc64VendorParse(xmlXPathContextPtr ctxt, goto error; } =20 - return vendor; + if (VIR_APPEND_ELEMENT(map->vendors, map->nvendors, vendor) < 0) + goto error; + + return 0; =20 error: ppc64VendorFree(vendor); - return NULL; + return -1; } =20 =20 static int -ppc64VendorsLoad(struct ppc64_map *map, - xmlXPathContextPtr ctxt, - xmlNodePtr *nodes, - int n) -{ - struct ppc64_vendor *vendor; - size_t i; - - if (VIR_ALLOC_N(map->vendors, n) < 0) - return -1; - - for (i =3D 0; i < n; i++) { - ctxt->node =3D nodes[i]; - if (!(vendor =3D ppc64VendorParse(ctxt, map))) - return -1; - map->vendors[map->nvendors++] =3D vendor; - } - - return 0; -} - - -static struct ppc64_model * ppc64ModelParse(xmlXPathContextPtr ctxt, - struct ppc64_map *map) + const char *name, + void *data) { + struct ppc64_map *map =3D data; struct ppc64_model *model; xmlNodePtr *nodes =3D NULL; char *vendor =3D NULL; unsigned long pvr; size_t i; int n; + int ret =3D -1; =20 if (VIR_ALLOC(model) < 0) goto error; =20 - model->name =3D virXPathString("string(@name)", ctxt); - if (!model->name) { - virReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("Missing CPU model name")); + if (VIR_STRDUP(model->name, name) < 0) goto error; - } =20 if (ppc64ModelFind(map, model->name)) { virReportError(VIR_ERR_INTERNAL_ERROR, @@ -410,63 +387,22 @@ ppc64ModelParse(xmlXPathContextPtr ctxt, model->data.pvr[i].mask =3D pvr; } =20 + if (VIR_APPEND_ELEMENT(map->models, map->nmodels, model) < 0) + goto error; + + ret =3D 0; + cleanup: VIR_FREE(vendor); VIR_FREE(nodes); - return model; + return ret; =20 error: ppc64ModelFree(model); - model =3D NULL; goto cleanup; } =20 =20 -static int -ppc64ModelsLoad(struct ppc64_map *map, - xmlXPathContextPtr ctxt, - xmlNodePtr *nodes, - int n) -{ - struct ppc64_model *model; - size_t i; - - if (VIR_ALLOC_N(map->models, n) < 0) - return -1; - - for (i =3D 0; i < n; i++) { - ctxt->node =3D nodes[i]; - if (!(model =3D ppc64ModelParse(ctxt, map))) - return -1; - map->models[map->nmodels++] =3D model; - } - - return 0; -} - - -static int -ppc64MapLoadCallback(cpuMapElement element, - xmlXPathContextPtr ctxt, - xmlNodePtr *nodes, - int n, - void *data) -{ - struct ppc64_map *map =3D data; - - switch (element) { - case CPU_MAP_ELEMENT_VENDOR: - return ppc64VendorsLoad(map, ctxt, nodes, n); - case CPU_MAP_ELEMENT_MODEL: - return ppc64ModelsLoad(map, ctxt, nodes, n); - case CPU_MAP_ELEMENT_FEATURE: - case CPU_MAP_ELEMENT_LAST: - break; - } - - return 0; -} - static struct ppc64_map * ppc64LoadMap(void) { @@ -475,7 +411,7 @@ ppc64LoadMap(void) if (VIR_ALLOC(map) < 0) goto error; =20 - if (cpuMapLoad("ppc64", ppc64MapLoadCallback, map) < 0) + if (cpuMapLoad("ppc64", ppc64VendorParse, NULL, ppc64ModelParse, map) = < 0) goto error; =20 return map; diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index a045a8280c..73af9d0885 100644 --- a/src/cpu/cpu_x86.c +++ b/src/cpu/cpu_x86.c @@ -712,22 +712,21 @@ x86VendorFind(virCPUx86MapPtr map, } =20 =20 -static virCPUx86VendorPtr +static int x86VendorParse(xmlXPathContextPtr ctxt, - virCPUx86MapPtr map) + const char *name, + void *data) { + virCPUx86MapPtr map =3D data; virCPUx86VendorPtr vendor =3D NULL; char *string =3D NULL; + int ret =3D -1; =20 if (VIR_ALLOC(vendor) < 0) goto error; =20 - vendor->name =3D virXPathString("string(@name)", ctxt); - if (!vendor->name) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("Missing CPU vendor name")); + if (VIR_STRDUP(vendor->name, name) < 0) goto error; - } =20 if (x86VendorFind(map, vendor->name)) { virReportError(VIR_ERR_INTERNAL_ERROR, @@ -746,40 +745,21 @@ x86VendorParse(xmlXPathContextPtr ctxt, if (virCPUx86VendorToCPUID(string, &vendor->cpuid) < 0) goto error; =20 + if (VIR_APPEND_ELEMENT(map->vendors, map->nvendors, vendor) < 0) + goto error; + + ret =3D 0; + cleanup: VIR_FREE(string); - return vendor; + return ret; =20 error: x86VendorFree(vendor); - vendor =3D NULL; goto cleanup; } =20 =20 -static int -x86VendorsLoad(virCPUx86MapPtr map, - xmlXPathContextPtr ctxt, - xmlNodePtr *nodes, - int n) -{ - virCPUx86VendorPtr vendor; - size_t i; - - if (VIR_ALLOC_N(map->vendors, n) < 0) - return -1; - - for (i =3D 0; i < n; i++) { - ctxt->node =3D nodes[i]; - if (!(vendor =3D x86VendorParse(ctxt, map))) - return -1; - map->vendors[map->nvendors++] =3D vendor; - } - - return 0; -} - - static virCPUx86FeaturePtr x86FeatureNew(void) { @@ -901,27 +881,27 @@ x86ParseCPUID(xmlXPathContextPtr ctxt, } =20 =20 -static virCPUx86FeaturePtr +static int x86FeatureParse(xmlXPathContextPtr ctxt, - virCPUx86MapPtr map) + const char *name, + void *data) { + virCPUx86MapPtr map =3D data; xmlNodePtr *nodes =3D NULL; virCPUx86FeaturePtr feature; virCPUx86CPUID cpuid; size_t i; int n; char *str =3D NULL; + int ret =3D -1; =20 if (!(feature =3D x86FeatureNew())) goto error; =20 feature->migratable =3D true; - feature->name =3D virXPathString("string(@name)", ctxt); - if (!feature->name) { - virReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("Missing CPU feature name")); + + if (VIR_STRDUP(feature->name, name) < 0) goto error; - } =20 if (x86FeatureFind(map, feature->name)) { virReportError(VIR_ERR_INTERNAL_ERROR, @@ -949,46 +929,28 @@ x86FeatureParse(xmlXPathContextPtr ctxt, goto error; } =20 + if (!feature->migratable && + VIR_APPEND_ELEMENT_COPY(map->migrate_blockers, + map->nblockers, + feature) < 0) + goto error; + + if (VIR_APPEND_ELEMENT(map->features, map->nfeatures, feature) < 0) + goto error; + + ret =3D 0; + cleanup: VIR_FREE(nodes); VIR_FREE(str); - return feature; + return ret; =20 error: x86FeatureFree(feature); - feature =3D NULL; goto cleanup; } =20 =20 -static int -x86FeaturesLoad(virCPUx86MapPtr map, - xmlXPathContextPtr ctxt, - xmlNodePtr *nodes, - int n) -{ - virCPUx86FeaturePtr feature; - size_t i; - - if (VIR_ALLOC_N(map->features, n) < 0) - return -1; - - for (i =3D 0; i < n; i++) { - ctxt->node =3D nodes[i]; - if (!(feature =3D x86FeatureParse(ctxt, map))) - return -1; - map->features[map->nfeatures++] =3D feature; - if (!feature->migratable && - VIR_APPEND_ELEMENT(map->migrate_blockers, - map->nblockers, - feature) < 0) - return -1; - } - - return 0; -} - - static virCPUx86ModelPtr x86ModelNew(void) { @@ -1184,47 +1146,46 @@ x86ModelCompare(virCPUx86ModelPtr model1, } =20 =20 -static virCPUx86ModelPtr +static int x86ModelParse(xmlXPathContextPtr ctxt, - virCPUx86MapPtr map) + const char *name, + void *data) { + virCPUx86MapPtr map =3D data; xmlNodePtr *nodes =3D NULL; virCPUx86ModelPtr model; char *vendor =3D NULL; size_t i; int n; + int ret =3D -1; =20 if (!(model =3D x86ModelNew())) goto error; =20 - model->name =3D virXPathString("string(@name)", ctxt); - if (!model->name) { - virReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("Missing CPU model name")); + if (VIR_STRDUP(model->name, name) < 0) goto error; - } =20 if (virXPathNode("./model", ctxt)) { virCPUx86ModelPtr ancestor; - char *name; + char *anname; =20 - name =3D virXPathString("string(./model/@name)", ctxt); - if (!name) { + anname =3D virXPathString("string(./model/@name)", ctxt); + if (!anname) { virReportError(VIR_ERR_INTERNAL_ERROR, _("Missing ancestor's name in CPU model %s"), model->name); goto error; } =20 - if (!(ancestor =3D x86ModelFind(map, name))) { + if (!(ancestor =3D x86ModelFind(map, anname))) { virReportError(VIR_ERR_INTERNAL_ERROR, _("Ancestor model %s not found for CPU model %s= "), - name, model->name); - VIR_FREE(name); + anname, model->name); + VIR_FREE(anname); goto error; } =20 - VIR_FREE(name); + VIR_FREE(anname); =20 model->vendor =3D ancestor->vendor; model->signature =3D ancestor->signature; @@ -1279,62 +1240,43 @@ x86ModelParse(xmlXPathContextPtr ctxt, =20 for (i =3D 0; i < n; i++) { virCPUx86FeaturePtr feature; - char *name; + char *ftname; =20 - if (!(name =3D virXMLPropString(nodes[i], "name"))) { + if (!(ftname =3D virXMLPropString(nodes[i], "name"))) { virReportError(VIR_ERR_INTERNAL_ERROR, _("Missing feature name for CPU model %s"), mod= el->name); goto error; } =20 - if (!(feature =3D x86FeatureFind(map, name))) { + if (!(feature =3D x86FeatureFind(map, ftname))) { virReportError(VIR_ERR_INTERNAL_ERROR, _("Feature %s required by CPU model %s not foun= d"), - name, model->name); - VIR_FREE(name); + ftname, model->name); + VIR_FREE(ftname); goto error; } - VIR_FREE(name); + VIR_FREE(ftname); =20 if (x86DataAdd(&model->data, &feature->data)) goto error; } =20 + if (VIR_APPEND_ELEMENT(map->models, map->nmodels, model) < 0) + goto error; + + ret =3D 0; + cleanup: VIR_FREE(vendor); VIR_FREE(nodes); - return model; + return ret; =20 error: x86ModelFree(model); - model =3D NULL; goto cleanup; } =20 =20 -static int -x86ModelsLoad(virCPUx86MapPtr map, - xmlXPathContextPtr ctxt, - xmlNodePtr *nodes, - int n) -{ - virCPUx86ModelPtr model; - size_t i; - - if (VIR_ALLOC_N(map->models, n) < 0) - return -1; - - for (i =3D 0; i < n; i++) { - ctxt->node =3D nodes[i]; - if (!(model =3D x86ModelParse(ctxt, map))) - return -1; - map->models[map->nmodels++] =3D model; - } - - return 0; -} - - static void x86MapFree(virCPUx86MapPtr map) { @@ -1364,30 +1306,6 @@ x86MapFree(virCPUx86MapPtr map) } =20 =20 -static int -x86MapLoadCallback(cpuMapElement element, - xmlXPathContextPtr ctxt, - xmlNodePtr *nodes, - int n, - void *data) -{ - virCPUx86MapPtr map =3D data; - - switch (element) { - case CPU_MAP_ELEMENT_VENDOR: - return x86VendorsLoad(map, ctxt, nodes, n); - case CPU_MAP_ELEMENT_FEATURE: - return x86FeaturesLoad(map, ctxt, nodes, n); - case CPU_MAP_ELEMENT_MODEL: - return x86ModelsLoad(map, ctxt, nodes, n); - case CPU_MAP_ELEMENT_LAST: - break; - } - - return 0; -} - - static virCPUx86MapPtr virCPUx86LoadMap(void) { @@ -1396,7 +1314,7 @@ virCPUx86LoadMap(void) if (VIR_ALLOC(map) < 0) return NULL; =20 - if (cpuMapLoad("x86", x86MapLoadCallback, map) < 0) + if (cpuMapLoad("x86", x86VendorParse, x86FeatureParse, x86ModelParse, = map) < 0) goto error; =20 return map; --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 11:39:24 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1534421456007625.7892362154334; Thu, 16 Aug 2018 05:10:56 -0700 (PDT) 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 E5113C057F85; Thu, 16 Aug 2018 12:10:53 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 563542E09D; Thu, 16 Aug 2018 12:10:53 +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 0690A7F1EC; Thu, 16 Aug 2018 12:10:52 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7GCAeQt026277 for ; Thu, 16 Aug 2018 08:10:40 -0400 Received: by smtp.corp.redhat.com (Postfix) id 4BAEC2166BB1; Thu, 16 Aug 2018 12:10:40 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-117-135.ams2.redhat.com [10.36.117.135]) by smtp.corp.redhat.com (Postfix) with ESMTP id BB9932166BA0; Thu, 16 Aug 2018 12:10:39 +0000 (UTC) From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Thu, 16 Aug 2018 13:10:27 +0100 Message-Id: <20180816121031.10902-5-berrange@redhat.com> In-Reply-To: <20180816121031.10902-1-berrange@redhat.com> References: <20180816121031.10902-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 4/8] cpu: simplify failure cleanup paths 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: , Content-Type: text/plain; charset="utf-8" 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.32]); Thu, 16 Aug 2018 12:10:54 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Get rid of the separate 'error:' label, so all code paths jump straight to the 'cleanup:' label. Signed-off-by: Daniel P. Berrang=C3=A9 --- src/cpu/cpu_ppc64.c | 38 ++++++++++++------------ src/cpu/cpu_x86.c | 71 ++++++++++++++++++++------------------------- 2 files changed, 49 insertions(+), 60 deletions(-) diff --git a/src/cpu/cpu_ppc64.c b/src/cpu/cpu_ppc64.c index 75da5b77d8..fcba7e9b37 100644 --- a/src/cpu/cpu_ppc64.c +++ b/src/cpu/cpu_ppc64.c @@ -288,27 +288,28 @@ ppc64VendorParse(xmlXPathContextPtr ctxt ATTRIBUTE_UN= USED, { struct ppc64_map *map =3D data; struct ppc64_vendor *vendor; + int ret =3D -1; =20 if (VIR_ALLOC(vendor) < 0) return -1; =20 if (VIR_STRDUP(vendor->name, name) < 0) - goto error; + goto cleanup; =20 if (ppc64VendorFind(map, vendor->name)) { virReportError(VIR_ERR_INTERNAL_ERROR, _("CPU vendor %s already defined"), vendor->name); - goto error; + goto cleanup; } =20 if (VIR_APPEND_ELEMENT(map->vendors, map->nvendors, vendor) < 0) - goto error; + goto cleanup; =20 - return 0; + ret =3D 0; =20 - error: + cleanup: ppc64VendorFree(vendor); - return -1; + return ret; } =20 =20 @@ -327,15 +328,15 @@ ppc64ModelParse(xmlXPathContextPtr ctxt, int ret =3D -1; =20 if (VIR_ALLOC(model) < 0) - goto error; + goto cleanup; =20 if (VIR_STRDUP(model->name, name) < 0) - goto error; + goto cleanup; =20 if (ppc64ModelFind(map, model->name)) { virReportError(VIR_ERR_INTERNAL_ERROR, _("CPU model %s already defined"), model->name); - goto error; + goto cleanup; } =20 if (virXPathBoolean("boolean(./vendor)", ctxt)) { @@ -344,14 +345,14 @@ ppc64ModelParse(xmlXPathContextPtr ctxt, virReportError(VIR_ERR_INTERNAL_ERROR, _("Invalid vendor element in CPU model %s"), model->name); - goto error; + goto cleanup; } =20 if (!(model->vendor =3D ppc64VendorFind(map, vendor))) { virReportError(VIR_ERR_INTERNAL_ERROR, _("Unknown vendor %s referenced by CPU model %s= "), vendor, model->name); - goto error; + goto cleanup; } } =20 @@ -359,11 +360,11 @@ ppc64ModelParse(xmlXPathContextPtr ctxt, virReportError(VIR_ERR_INTERNAL_ERROR, _("Missing PVR information for CPU model %s"), model->name); - goto error; + goto cleanup; } =20 if (VIR_ALLOC_N(model->data.pvr, n) < 0) - goto error; + goto cleanup; =20 model->data.len =3D n; =20 @@ -374,7 +375,7 @@ ppc64ModelParse(xmlXPathContextPtr ctxt, virReportError(VIR_ERR_INTERNAL_ERROR, _("Missing or invalid PVR value in CPU model %s= "), model->name); - goto error; + goto cleanup; } model->data.pvr[i].value =3D pvr; =20 @@ -382,24 +383,21 @@ ppc64ModelParse(xmlXPathContextPtr ctxt, virReportError(VIR_ERR_INTERNAL_ERROR, _("Missing or invalid PVR mask in CPU model %s"= ), model->name); - goto error; + goto cleanup; } model->data.pvr[i].mask =3D pvr; } =20 if (VIR_APPEND_ELEMENT(map->models, map->nmodels, model) < 0) - goto error; + goto cleanup; =20 ret =3D 0; =20 cleanup: + ppc64ModelFree(model); VIR_FREE(vendor); VIR_FREE(nodes); return ret; - - error: - ppc64ModelFree(model); - goto cleanup; } =20 =20 diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index 73af9d0885..8e4a3d0f77 100644 --- a/src/cpu/cpu_x86.c +++ b/src/cpu/cpu_x86.c @@ -723,15 +723,15 @@ x86VendorParse(xmlXPathContextPtr ctxt, int ret =3D -1; =20 if (VIR_ALLOC(vendor) < 0) - goto error; + goto cleanup; =20 if (VIR_STRDUP(vendor->name, name) < 0) - goto error; + goto cleanup; =20 if (x86VendorFind(map, vendor->name)) { virReportError(VIR_ERR_INTERNAL_ERROR, _("CPU vendor %s already defined"), vendor->name); - goto error; + goto cleanup; } =20 string =3D virXPathString("string(@string)", ctxt); @@ -739,24 +739,21 @@ x86VendorParse(xmlXPathContextPtr ctxt, virReportError(VIR_ERR_INTERNAL_ERROR, _("Missing vendor string for CPU vendor %s"), vendor->name); - goto error; + goto cleanup; } =20 if (virCPUx86VendorToCPUID(string, &vendor->cpuid) < 0) - goto error; + goto cleanup; =20 if (VIR_APPEND_ELEMENT(map->vendors, map->nvendors, vendor) < 0) - goto error; + goto cleanup; =20 ret =3D 0; =20 cleanup: + x86VendorFree(vendor); VIR_FREE(string); return ret; - - error: - x86VendorFree(vendor); - goto cleanup; } =20 =20 @@ -896,17 +893,17 @@ x86FeatureParse(xmlXPathContextPtr ctxt, int ret =3D -1; =20 if (!(feature =3D x86FeatureNew())) - goto error; + goto cleanup; =20 feature->migratable =3D true; =20 if (VIR_STRDUP(feature->name, name) < 0) - goto error; + goto cleanup; =20 if (x86FeatureFind(map, feature->name)) { virReportError(VIR_ERR_INTERNAL_ERROR, _("CPU feature %s already defined"), feature->name); - goto error; + goto cleanup; } =20 str =3D virXPathString("string(@migratable)", ctxt); @@ -915,7 +912,7 @@ x86FeatureParse(xmlXPathContextPtr ctxt, =20 n =3D virXPathNodeSet("./cpuid", ctxt, &nodes); if (n < 0) - goto error; + goto cleanup; =20 for (i =3D 0; i < n; i++) { ctxt->node =3D nodes[i]; @@ -923,31 +920,28 @@ x86FeatureParse(xmlXPathContextPtr ctxt, virReportError(VIR_ERR_INTERNAL_ERROR, _("Invalid cpuid[%zu] in %s feature"), i, feature->name); - goto error; + goto cleanup; } if (virCPUx86DataAddCPUIDInt(&feature->data, &cpuid)) - goto error; + goto cleanup; } =20 if (!feature->migratable && VIR_APPEND_ELEMENT_COPY(map->migrate_blockers, map->nblockers, feature) < 0) - goto error; + goto cleanup; =20 if (VIR_APPEND_ELEMENT(map->features, map->nfeatures, feature) < 0) - goto error; + goto cleanup; =20 ret =3D 0; =20 cleanup: + x86FeatureFree(feature); VIR_FREE(nodes); VIR_FREE(str); return ret; - - error: - x86FeatureFree(feature); - goto cleanup; } =20 =20 @@ -1160,10 +1154,10 @@ x86ModelParse(xmlXPathContextPtr ctxt, int ret =3D -1; =20 if (!(model =3D x86ModelNew())) - goto error; + goto cleanup; =20 if (VIR_STRDUP(model->name, name) < 0) - goto error; + goto cleanup; =20 if (virXPathNode("./model", ctxt)) { virCPUx86ModelPtr ancestor; @@ -1174,7 +1168,7 @@ x86ModelParse(xmlXPathContextPtr ctxt, virReportError(VIR_ERR_INTERNAL_ERROR, _("Missing ancestor's name in CPU model %s"), model->name); - goto error; + goto cleanup; } =20 if (!(ancestor =3D x86ModelFind(map, anname))) { @@ -1182,7 +1176,7 @@ x86ModelParse(xmlXPathContextPtr ctxt, _("Ancestor model %s not found for CPU model %s= "), anname, model->name); VIR_FREE(anname); - goto error; + goto cleanup; } =20 VIR_FREE(anname); @@ -1190,7 +1184,7 @@ x86ModelParse(xmlXPathContextPtr ctxt, model->vendor =3D ancestor->vendor; model->signature =3D ancestor->signature; if (x86DataCopy(&model->data, &ancestor->data) < 0) - goto error; + goto cleanup; } =20 if (virXPathBoolean("boolean(./signature)", ctxt)) { @@ -1203,7 +1197,7 @@ x86ModelParse(xmlXPathContextPtr ctxt, virReportError(VIR_ERR_INTERNAL_ERROR, _("Invalid CPU signature family in model %s"), model->name); - goto error; + goto cleanup; } =20 rc =3D virXPathUInt("string(./signature/@model)", ctxt, &sigModel); @@ -1211,7 +1205,7 @@ x86ModelParse(xmlXPathContextPtr ctxt, virReportError(VIR_ERR_INTERNAL_ERROR, _("Invalid CPU signature model in model %s"), model->name); - goto error; + goto cleanup; } =20 model->signature =3D x86MakeSignature(sigFamily, sigModel, 0); @@ -1223,20 +1217,20 @@ x86ModelParse(xmlXPathContextPtr ctxt, virReportError(VIR_ERR_INTERNAL_ERROR, _("Invalid vendor element in CPU model %s"), model->name); - goto error; + goto cleanup; } =20 if (!(model->vendor =3D x86VendorFind(map, vendor))) { virReportError(VIR_ERR_INTERNAL_ERROR, _("Unknown vendor %s referenced by CPU model %s= "), vendor, model->name); - goto error; + goto cleanup; } } =20 n =3D virXPathNodeSet("./feature", ctxt, &nodes); if (n < 0) - goto error; + goto cleanup; =20 for (i =3D 0; i < n; i++) { virCPUx86FeaturePtr feature; @@ -1245,7 +1239,7 @@ x86ModelParse(xmlXPathContextPtr ctxt, if (!(ftname =3D virXMLPropString(nodes[i], "name"))) { virReportError(VIR_ERR_INTERNAL_ERROR, _("Missing feature name for CPU model %s"), mod= el->name); - goto error; + goto cleanup; } =20 if (!(feature =3D x86FeatureFind(map, ftname))) { @@ -1253,27 +1247,24 @@ x86ModelParse(xmlXPathContextPtr ctxt, _("Feature %s required by CPU model %s not foun= d"), ftname, model->name); VIR_FREE(ftname); - goto error; + goto cleanup; } VIR_FREE(ftname); =20 if (x86DataAdd(&model->data, &feature->data)) - goto error; + goto cleanup; } =20 if (VIR_APPEND_ELEMENT(map->models, map->nmodels, model) < 0) - goto error; + goto cleanup; =20 ret =3D 0; =20 cleanup: + x86ModelFree(model); VIR_FREE(vendor); VIR_FREE(nodes); return ret; - - error: - x86ModelFree(model); - goto cleanup; } =20 =20 --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 11:39:24 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1534421453239114.0777684472398; Thu, 16 Aug 2018 05:10:53 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BCB28308213D; Thu, 16 Aug 2018 12:10:48 +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 808C26017C; Thu, 16 Aug 2018 12:10:48 +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 335A718363F7; Thu, 16 Aug 2018 12:10:48 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7GCAfbD026285 for ; Thu, 16 Aug 2018 08:10:41 -0400 Received: by smtp.corp.redhat.com (Postfix) id 337B82166BB1; Thu, 16 Aug 2018 12:10:41 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-117-135.ams2.redhat.com [10.36.117.135]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8FC4F2166BA0; Thu, 16 Aug 2018 12:10:40 +0000 (UTC) From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Thu, 16 Aug 2018 13:10:28 +0100 Message-Id: <20180816121031.10902-6-berrange@redhat.com> In-Reply-To: <20180816121031.10902-1-berrange@redhat.com> References: <20180816121031.10902-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 5/8] cpu: move the CPU map data files into a src/cpu_map directory 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: , Content-Type: text/plain; charset="utf-8" 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Thu, 16 Aug 2018 12:10:51 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 In preparation for splitting up the CPU map data file, move it into a dedicated directory of its own. Signed-off-by: Daniel P. Berrang=C3=A9 --- libvirt.spec.in | 2 +- mingw-libvirt.spec.in | 4 ++-- src/Makefile.am | 7 +------ src/cpu/cpu_map.c | 10 +++++----- src/cpu_map/Makefile.inc.am | 7 +++++++ src/{cpu/cpu_map.xml =3D> cpu_map/index.xml} | 0 6 files changed, 16 insertions(+), 14 deletions(-) create mode 100644 src/cpu_map/Makefile.inc.am rename src/{cpu/cpu_map.xml =3D> cpu_map/index.xml} (100%) diff --git a/libvirt.spec.in b/libvirt.spec.in index 883c8a49e7..09f654b2ec 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -1854,7 +1854,7 @@ exit 0 %{_datadir}/libvirt/schemas/storagepool.rng %{_datadir}/libvirt/schemas/storagevol.rng =20 -%{_datadir}/libvirt/cpu_map.xml +%{_datadir}/libvirt/cpu_map/*.xml =20 %{_datadir}/libvirt/test-screenshot.png =20 diff --git a/mingw-libvirt.spec.in b/mingw-libvirt.spec.in index cc1e619927..b28e40f7f7 100644 --- a/mingw-libvirt.spec.in +++ b/mingw-libvirt.spec.in @@ -260,7 +260,7 @@ rm -rf $RPM_BUILD_ROOT%{mingw64_libexecdir}/libvirt-gue= sts.sh %{mingw32_datadir}/libvirt/api/libvirt-qemu-api.xml %{mingw32_datadir}/libvirt/api/libvirt-admin-api.xml =20 -%{mingw32_datadir}/libvirt/cpu_map.xml +%{mingw32_datadir}/libvirt/cpu_map/*.xml =20 %{mingw32_datadir}/libvirt/test-screenshot.png =20 @@ -347,7 +347,7 @@ rm -rf $RPM_BUILD_ROOT%{mingw64_libexecdir}/libvirt-gue= sts.sh %{mingw64_datadir}/libvirt/api/libvirt-qemu-api.xml %{mingw64_datadir}/libvirt/api/libvirt-admin-api.xml =20 -%{mingw64_datadir}/libvirt/cpu_map.xml +%{mingw64_datadir}/libvirt/cpu_map/*.xml =20 %{mingw64_datadir}/libvirt/test-screenshot.png =20 diff --git a/src/Makefile.am b/src/Makefile.am index db8c8ebd1a..2a3ed0d42d 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -100,6 +100,7 @@ man7_MANS =3D include util/Makefile.inc.am include conf/Makefile.inc.am include cpu/Makefile.inc.am +include cpu_map/Makefile.inc.am include security/Makefile.inc.am include access/Makefile.inc.am include logging/Makefile.inc.am @@ -364,12 +365,6 @@ check-local: check-protocol check-symfile check-symsor= ting \ .PHONY: check-protocol $(PROTOCOL_STRUCTS:structs=3Dstruct) =20 =20 - - -pkgdata_DATA =3D cpu/cpu_map.xml - -EXTRA_DIST +=3D $(pkgdata_DATA) - ######################### # # Build up list of libvirt.la source files based on configure conditions diff --git a/src/cpu/cpu_map.c b/src/cpu/cpu_map.c index 400e6f1427..2079767df8 100644 --- a/src/cpu/cpu_map.c +++ b/src/cpu/cpu_map.c @@ -99,8 +99,8 @@ cpuMapLoadInclude(const char *filename, char *mapfile; =20 if (!(mapfile =3D virFileFindResource(filename, - abs_topsrcdir "/src/cpu", - PKGDATADIR))) + abs_topsrcdir "/src/cpu_map", + PKGDATADIR "/cpu_map"))) return -1; =20 VIR_DEBUG("Loading CPU map include from %s", mapfile); @@ -182,9 +182,9 @@ int cpuMapLoad(const char *arch, int ret =3D -1; char *mapfile; =20 - if (!(mapfile =3D virFileFindResource("cpu_map.xml", - abs_topsrcdir "/src/cpu", - PKGDATADIR))) + if (!(mapfile =3D virFileFindResource("index.xml", + abs_topsrcdir "/src/cpu_map", + PKGDATADIR "/cpu_map"))) return -1; =20 VIR_DEBUG("Loading '%s' CPU map from %s", NULLSTR(arch), mapfile); diff --git a/src/cpu_map/Makefile.inc.am b/src/cpu_map/Makefile.inc.am new file mode 100644 index 0000000000..91728b9200 --- /dev/null +++ b/src/cpu_map/Makefile.inc.am @@ -0,0 +1,7 @@ + +cpumapdir =3D $(pkgdatadir)/cpu_map +cpumap_DATA =3D \ + cpu_map/index.xml \ + $(NULL) + +EXTRA_DIST +=3D $(cpumap_DATA) diff --git a/src/cpu/cpu_map.xml b/src/cpu_map/index.xml similarity index 100% rename from src/cpu/cpu_map.xml rename to src/cpu_map/index.xml --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 11:39:24 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1534421461330389.42474184179025; Thu, 16 Aug 2018 05:11:01 -0700 (PDT) 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 B1E303078AAA; Thu, 16 Aug 2018 12:10:58 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 67C3B2E09D; Thu, 16 Aug 2018 12:10:58 +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 B96657F210; Thu, 16 Aug 2018 12:10:57 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7GCAgqU026297 for ; Thu, 16 Aug 2018 08:10:42 -0400 Received: by smtp.corp.redhat.com (Postfix) id 37FA32166BA5; Thu, 16 Aug 2018 12:10:42 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-117-135.ams2.redhat.com [10.36.117.135]) by smtp.corp.redhat.com (Postfix) with ESMTP id 81A382166BA0; Thu, 16 Aug 2018 12:10:41 +0000 (UTC) From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Thu, 16 Aug 2018 13:10:29 +0100 Message-Id: <20180816121031.10902-7-berrange@redhat.com> In-Reply-To: <20180816121031.10902-1-berrange@redhat.com> References: <20180816121031.10902-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 6/8] cpu: split PPC64 map data into separate files 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: , Content-Type: text/plain; charset="utf-8" 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.48]); Thu, 16 Aug 2018 12:10:59 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Signed-off-by: Daniel P. Berrang=C3=A9 --- src/cpu_map/Makefile.inc.am | 7 +++++ src/cpu_map/index.xml | 41 +++++------------------------ src/cpu_map/ppc64_POWER6.xml | 6 +++++ src/cpu_map/ppc64_POWER7.xml | 7 +++++ src/cpu_map/ppc64_POWER8.xml | 8 ++++++ src/cpu_map/ppc64_POWER9.xml | 6 +++++ src/cpu_map/ppc64_POWERPC_e5500.xml | 6 +++++ src/cpu_map/ppc64_POWERPC_e6500.xml | 6 +++++ src/cpu_map/ppc64_vendors.xml | 4 +++ 9 files changed, 57 insertions(+), 34 deletions(-) create mode 100644 src/cpu_map/ppc64_POWER6.xml create mode 100644 src/cpu_map/ppc64_POWER7.xml create mode 100644 src/cpu_map/ppc64_POWER8.xml create mode 100644 src/cpu_map/ppc64_POWER9.xml create mode 100644 src/cpu_map/ppc64_POWERPC_e5500.xml create mode 100644 src/cpu_map/ppc64_POWERPC_e6500.xml create mode 100644 src/cpu_map/ppc64_vendors.xml diff --git a/src/cpu_map/Makefile.inc.am b/src/cpu_map/Makefile.inc.am index 91728b9200..64453cc384 100644 --- a/src/cpu_map/Makefile.inc.am +++ b/src/cpu_map/Makefile.inc.am @@ -2,6 +2,13 @@ cpumapdir =3D $(pkgdatadir)/cpu_map cpumap_DATA =3D \ cpu_map/index.xml \ + cpu_map/ppc64_vendors.xml \ + cpu_map/ppc64_POWER7.xml \ + cpu_map/ppc64_POWER9.xml \ + cpu_map/ppc64_POWERPC_e6500.xml \ + cpu_map/ppc64_POWER6.xml \ + cpu_map/ppc64_POWER8.xml \ + cpu_map/ppc64_POWERPC_e5500.xml \ $(NULL) =20 EXTRA_DIST +=3D $(cpumap_DATA) diff --git a/src/cpu_map/index.xml b/src/cpu_map/index.xml index 9af190a579..ce4f0204b0 100644 --- a/src/cpu_map/index.xml +++ b/src/cpu_map/index.xml @@ -2340,43 +2340,16 @@ =20 - - - + =20 - - - - - - - - - - - - - - - - - - - - - - + + + + =20 - - - - - - - - - + + diff --git a/src/cpu_map/ppc64_POWER6.xml b/src/cpu_map/ppc64_POWER6.xml new file mode 100644 index 0000000000..00e27495f4 --- /dev/null +++ b/src/cpu_map/ppc64_POWER6.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/cpu_map/ppc64_POWER7.xml b/src/cpu_map/ppc64_POWER7.xml new file mode 100644 index 0000000000..a071481805 --- /dev/null +++ b/src/cpu_map/ppc64_POWER7.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/src/cpu_map/ppc64_POWER8.xml b/src/cpu_map/ppc64_POWER8.xml new file mode 100644 index 0000000000..64d96fc4c4 --- /dev/null +++ b/src/cpu_map/ppc64_POWER8.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/src/cpu_map/ppc64_POWER9.xml b/src/cpu_map/ppc64_POWER9.xml new file mode 100644 index 0000000000..149fcde924 --- /dev/null +++ b/src/cpu_map/ppc64_POWER9.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/cpu_map/ppc64_POWERPC_e5500.xml b/src/cpu_map/ppc64_POWERP= C_e5500.xml new file mode 100644 index 0000000000..3d64c8926c --- /dev/null +++ b/src/cpu_map/ppc64_POWERPC_e5500.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/cpu_map/ppc64_POWERPC_e6500.xml b/src/cpu_map/ppc64_POWERP= C_e6500.xml new file mode 100644 index 0000000000..b0d1006076 --- /dev/null +++ b/src/cpu_map/ppc64_POWERPC_e6500.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/cpu_map/ppc64_vendors.xml b/src/cpu_map/ppc64_vendors.xml new file mode 100644 index 0000000000..52ad45c0bd --- /dev/null +++ b/src/cpu_map/ppc64_vendors.xml @@ -0,0 +1,4 @@ + + + + --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 11:39:24 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 15344214689171023.5986188818812; Thu, 16 Aug 2018 05:11:08 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C197F30B8F8B; Thu, 16 Aug 2018 12:11:05 +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 6D6D753B24; Thu, 16 Aug 2018 12:11:05 +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 CC3AA1841C4A; Thu, 16 Aug 2018 12:11:04 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7GCAh0p026305 for ; Thu, 16 Aug 2018 08:10:43 -0400 Received: by smtp.corp.redhat.com (Postfix) id A1A202166BB1; Thu, 16 Aug 2018 12:10:43 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-117-135.ams2.redhat.com [10.36.117.135]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8A4362166BA0; Thu, 16 Aug 2018 12:10:42 +0000 (UTC) From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Thu, 16 Aug 2018 13:10:30 +0100 Message-Id: <20180816121031.10902-8-berrange@redhat.com> In-Reply-To: <20180816121031.10902-1-berrange@redhat.com> References: <20180816121031.10902-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 7/8] cpu: split x86 map data into separate files 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: , Content-Type: text/plain; charset="utf-8" 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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Thu, 16 Aug 2018 12:11:07 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Signed-off-by: Daniel P. Berrang=C3=A9 --- src/cpu_map/Makefile.inc.am | 47 + src/cpu_map/index.xml | 2374 +--------------------- src/cpu_map/x86_486.xml | 7 + src/cpu_map/x86_Broadwell-IBRS.xml | 61 + src/cpu_map/x86_Broadwell-noTSX-IBRS.xml | 59 + src/cpu_map/x86_Broadwell-noTSX.xml | 58 + src/cpu_map/x86_Broadwell.xml | 60 + src/cpu_map/x86_Conroe.xml | 33 + src/cpu_map/x86_EPYC-IBRS.xml | 73 + src/cpu_map/x86_EPYC.xml | 72 + src/cpu_map/x86_Haswell-IBRS.xml | 57 + src/cpu_map/x86_Haswell-noTSX-IBRS.xml | 55 + src/cpu_map/x86_Haswell-noTSX.xml | 54 + src/cpu_map/x86_Haswell.xml | 56 + src/cpu_map/x86_IvyBridge-IBRS.xml | 51 + src/cpu_map/x86_IvyBridge.xml | 50 + src/cpu_map/x86_Nehalem-IBRS.xml | 38 + src/cpu_map/x86_Nehalem.xml | 37 + src/cpu_map/x86_Opteron_G1.xml | 31 + src/cpu_map/x86_Opteron_G2.xml | 35 + src/cpu_map/x86_Opteron_G3.xml | 40 + src/cpu_map/x86_Opteron_G4.xml | 50 + src/cpu_map/x86_Opteron_G5.xml | 53 + src/cpu_map/x86_Penryn.xml | 35 + src/cpu_map/x86_SandyBridge-IBRS.xml | 45 + src/cpu_map/x86_SandyBridge.xml | 44 + src/cpu_map/x86_Skylake-Client-IBRS.xml | 70 + src/cpu_map/x86_Skylake-Client.xml | 69 + src/cpu_map/x86_Skylake-Server-IBRS.xml | 77 + src/cpu_map/x86_Skylake-Server.xml | 76 + src/cpu_map/x86_Westmere-IBRS.xml | 39 + src/cpu_map/x86_Westmere.xml | 38 + src/cpu_map/x86_athlon.xml | 28 + src/cpu_map/x86_core2duo.xml | 33 + src/cpu_map/x86_coreduo.xml | 29 + src/cpu_map/x86_cpu64-rhel5.xml | 29 + src/cpu_map/x86_cpu64-rhel6.xml | 31 + src/cpu_map/x86_features.xml | 440 ++++ src/cpu_map/x86_kvm32.xml | 26 + src/cpu_map/x86_kvm64.xml | 30 + src/cpu_map/x86_n270.xml | 30 + src/cpu_map/x86_pentium.xml | 13 + src/cpu_map/x86_pentium2.xml | 22 + src/cpu_map/x86_pentium3.xml | 23 + src/cpu_map/x86_pentiumpro.xml | 21 + src/cpu_map/x86_phenom.xml | 36 + src/cpu_map/x86_qemu32.xml | 22 + src/cpu_map/x86_qemu64.xml | 40 + src/cpu_map/x86_vendors.xml | 4 + 49 files changed, 2474 insertions(+), 2327 deletions(-) create mode 100644 src/cpu_map/x86_486.xml create mode 100644 src/cpu_map/x86_Broadwell-IBRS.xml create mode 100644 src/cpu_map/x86_Broadwell-noTSX-IBRS.xml create mode 100644 src/cpu_map/x86_Broadwell-noTSX.xml create mode 100644 src/cpu_map/x86_Broadwell.xml create mode 100644 src/cpu_map/x86_Conroe.xml create mode 100644 src/cpu_map/x86_EPYC-IBRS.xml create mode 100644 src/cpu_map/x86_EPYC.xml create mode 100644 src/cpu_map/x86_Haswell-IBRS.xml create mode 100644 src/cpu_map/x86_Haswell-noTSX-IBRS.xml create mode 100644 src/cpu_map/x86_Haswell-noTSX.xml create mode 100644 src/cpu_map/x86_Haswell.xml create mode 100644 src/cpu_map/x86_IvyBridge-IBRS.xml create mode 100644 src/cpu_map/x86_IvyBridge.xml create mode 100644 src/cpu_map/x86_Nehalem-IBRS.xml create mode 100644 src/cpu_map/x86_Nehalem.xml create mode 100644 src/cpu_map/x86_Opteron_G1.xml create mode 100644 src/cpu_map/x86_Opteron_G2.xml create mode 100644 src/cpu_map/x86_Opteron_G3.xml create mode 100644 src/cpu_map/x86_Opteron_G4.xml create mode 100644 src/cpu_map/x86_Opteron_G5.xml create mode 100644 src/cpu_map/x86_Penryn.xml create mode 100644 src/cpu_map/x86_SandyBridge-IBRS.xml create mode 100644 src/cpu_map/x86_SandyBridge.xml create mode 100644 src/cpu_map/x86_Skylake-Client-IBRS.xml create mode 100644 src/cpu_map/x86_Skylake-Client.xml create mode 100644 src/cpu_map/x86_Skylake-Server-IBRS.xml create mode 100644 src/cpu_map/x86_Skylake-Server.xml create mode 100644 src/cpu_map/x86_Westmere-IBRS.xml create mode 100644 src/cpu_map/x86_Westmere.xml create mode 100644 src/cpu_map/x86_athlon.xml create mode 100644 src/cpu_map/x86_core2duo.xml create mode 100644 src/cpu_map/x86_coreduo.xml create mode 100644 src/cpu_map/x86_cpu64-rhel5.xml create mode 100644 src/cpu_map/x86_cpu64-rhel6.xml create mode 100644 src/cpu_map/x86_features.xml create mode 100644 src/cpu_map/x86_kvm32.xml create mode 100644 src/cpu_map/x86_kvm64.xml create mode 100644 src/cpu_map/x86_n270.xml create mode 100644 src/cpu_map/x86_pentium.xml create mode 100644 src/cpu_map/x86_pentium2.xml create mode 100644 src/cpu_map/x86_pentium3.xml create mode 100644 src/cpu_map/x86_pentiumpro.xml create mode 100644 src/cpu_map/x86_phenom.xml create mode 100644 src/cpu_map/x86_qemu32.xml create mode 100644 src/cpu_map/x86_qemu64.xml create mode 100644 src/cpu_map/x86_vendors.xml diff --git a/src/cpu_map/Makefile.inc.am b/src/cpu_map/Makefile.inc.am index 64453cc384..4b93841bd6 100644 --- a/src/cpu_map/Makefile.inc.am +++ b/src/cpu_map/Makefile.inc.am @@ -9,6 +9,53 @@ cpumap_DATA =3D \ cpu_map/ppc64_POWER6.xml \ cpu_map/ppc64_POWER8.xml \ cpu_map/ppc64_POWERPC_e5500.xml \ + cpu_map/x86_features.xml \ + cpu_map/x86_vendors.xml \ + cpu_map/x86_486.xml \ + cpu_map/x86_athlon.xml \ + cpu_map/x86_Broadwell.xml \ + cpu_map/x86_Broadwell-IBRS.xml \ + cpu_map/x86_Broadwell-noTSX.xml \ + cpu_map/x86_Broadwell-noTSX-IBRS.xml \ + cpu_map/x86_Conroe.xml \ + cpu_map/x86_core2duo.xml \ + cpu_map/x86_coreduo.xml \ + cpu_map/x86_cpu64-rhel5.xml \ + cpu_map/x86_cpu64-rhel6.xml \ + cpu_map/x86_EPYC.xml \ + cpu_map/x86_EPYC-IBRS.xml \ + cpu_map/x86_Haswell.xml \ + cpu_map/x86_Haswell-IBRS.xml \ + cpu_map/x86_Haswell-noTSX.xml \ + cpu_map/x86_Haswell-noTSX-IBRS.xml \ + cpu_map/x86_IvyBridge.xml \ + cpu_map/x86_IvyBridge-IBRS.xml \ + cpu_map/x86_kvm32.xml \ + cpu_map/x86_kvm64.xml \ + cpu_map/x86_n270.xml \ + cpu_map/x86_Nehalem.xml \ + cpu_map/x86_Nehalem-IBRS.xml \ + cpu_map/x86_Opteron_G1.xml \ + cpu_map/x86_Opteron_G2.xml \ + cpu_map/x86_Opteron_G3.xml \ + cpu_map/x86_Opteron_G4.xml \ + cpu_map/x86_Opteron_G5.xml \ + cpu_map/x86_Penryn.xml \ + cpu_map/x86_pentium.xml \ + cpu_map/x86_pentium2.xml \ + cpu_map/x86_pentium3.xml \ + cpu_map/x86_pentiumpro.xml \ + cpu_map/x86_phenom.xml \ + cpu_map/x86_qemu32.xml \ + cpu_map/x86_qemu64.xml \ + cpu_map/x86_SandyBridge.xml \ + cpu_map/x86_SandyBridge-IBRS.xml \ + cpu_map/x86_Skylake-Client.xml \ + cpu_map/x86_Skylake-Client-IBRS.xml \ + cpu_map/x86_Skylake-Server.xml \ + cpu_map/x86_Skylake-Server-IBRS.xml \ + cpu_map/x86_Westmere.xml \ + cpu_map/x86_Westmere-IBRS.xml \ $(NULL) =20 EXTRA_DIST +=3D $(cpumap_DATA) diff --git a/src/cpu_map/index.xml b/src/cpu_map/index.xml index ce4f0204b0..db82980dd4 100644 --- a/src/cpu_map/index.xml +++ b/src/cpu_map/index.xml @@ -1,2342 +1,62 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + =20 - - - - - + =20 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + =20 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + =20 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + =20 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + =20 diff --git a/src/cpu_map/x86_486.xml b/src/cpu_map/x86_486.xml new file mode 100644 index 0000000000..61fa3797e8 --- /dev/null +++ b/src/cpu_map/x86_486.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/src/cpu_map/x86_Broadwell-IBRS.xml b/src/cpu_map/x86_Broadwell= -IBRS.xml new file mode 100644 index 0000000000..fc7a3371a5 --- /dev/null +++ b/src/cpu_map/x86_Broadwell-IBRS.xml @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/cpu_map/x86_Broadwell-noTSX-IBRS.xml b/src/cpu_map/x86_Bro= adwell-noTSX-IBRS.xml new file mode 100644 index 0000000000..19949cb6ca --- /dev/null +++ b/src/cpu_map/x86_Broadwell-noTSX-IBRS.xml @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/cpu_map/x86_Broadwell-noTSX.xml b/src/cpu_map/x86_Broadwel= l-noTSX.xml new file mode 100644 index 0000000000..6219bd4102 --- /dev/null +++ b/src/cpu_map/x86_Broadwell-noTSX.xml @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/cpu_map/x86_Broadwell.xml b/src/cpu_map/x86_Broadwell.xml new file mode 100644 index 0000000000..1511394f0b --- /dev/null +++ b/src/cpu_map/x86_Broadwell.xml @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/cpu_map/x86_Conroe.xml b/src/cpu_map/x86_Conroe.xml new file mode 100644 index 0000000000..ebcab7be31 --- /dev/null +++ b/src/cpu_map/x86_Conroe.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/cpu_map/x86_EPYC-IBRS.xml b/src/cpu_map/x86_EPYC-IBRS.xml new file mode 100644 index 0000000000..219ead70df --- /dev/null +++ b/src/cpu_map/x86_EPYC-IBRS.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/cpu_map/x86_EPYC.xml b/src/cpu_map/x86_EPYC.xml new file mode 100644 index 0000000000..6458dc820c --- /dev/null +++ b/src/cpu_map/x86_EPYC.xml @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/cpu_map/x86_Haswell-IBRS.xml b/src/cpu_map/x86_Haswell-IBR= S.xml new file mode 100644 index 0000000000..01bab7b803 --- /dev/null +++ b/src/cpu_map/x86_Haswell-IBRS.xml @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/cpu_map/x86_Haswell-noTSX-IBRS.xml b/src/cpu_map/x86_Haswe= ll-noTSX-IBRS.xml new file mode 100644 index 0000000000..7b53b7be29 --- /dev/null +++ b/src/cpu_map/x86_Haswell-noTSX-IBRS.xml @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/cpu_map/x86_Haswell-noTSX.xml b/src/cpu_map/x86_Haswell-no= TSX.xml new file mode 100644 index 0000000000..10b460818a --- /dev/null +++ b/src/cpu_map/x86_Haswell-noTSX.xml @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/cpu_map/x86_Haswell.xml b/src/cpu_map/x86_Haswell.xml new file mode 100644 index 0000000000..84275b1bdf --- /dev/null +++ b/src/cpu_map/x86_Haswell.xml @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/cpu_map/x86_IvyBridge-IBRS.xml b/src/cpu_map/x86_IvyBridge= -IBRS.xml new file mode 100644 index 0000000000..27eb120a8a --- /dev/null +++ b/src/cpu_map/x86_IvyBridge-IBRS.xml @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/cpu_map/x86_IvyBridge.xml b/src/cpu_map/x86_IvyBridge.xml new file mode 100644 index 0000000000..54f5f55a51 --- /dev/null +++ b/src/cpu_map/x86_IvyBridge.xml @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/cpu_map/x86_Nehalem-IBRS.xml b/src/cpu_map/x86_Nehalem-IBR= S.xml new file mode 100644 index 0000000000..f2230ffa89 --- /dev/null +++ b/src/cpu_map/x86_Nehalem-IBRS.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/cpu_map/x86_Nehalem.xml b/src/cpu_map/x86_Nehalem.xml new file mode 100644 index 0000000000..8e0fd5dc49 --- /dev/null +++ b/src/cpu_map/x86_Nehalem.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/cpu_map/x86_Opteron_G1.xml b/src/cpu_map/x86_Opteron_G1.xml new file mode 100644 index 0000000000..8d043fe889 --- /dev/null +++ b/src/cpu_map/x86_Opteron_G1.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/cpu_map/x86_Opteron_G2.xml b/src/cpu_map/x86_Opteron_G2.xml new file mode 100644 index 0000000000..774e86462f --- /dev/null +++ b/src/cpu_map/x86_Opteron_G2.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/cpu_map/x86_Opteron_G3.xml b/src/cpu_map/x86_Opteron_G3.xml new file mode 100644 index 0000000000..5d27e635dc --- /dev/null +++ b/src/cpu_map/x86_Opteron_G3.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/cpu_map/x86_Opteron_G4.xml b/src/cpu_map/x86_Opteron_G4.xml new file mode 100644 index 0000000000..d77cc286ff --- /dev/null +++ b/src/cpu_map/x86_Opteron_G4.xml @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/cpu_map/x86_Opteron_G5.xml b/src/cpu_map/x86_Opteron_G5.xml new file mode 100644 index 0000000000..9a5ecbd4da --- /dev/null +++ b/src/cpu_map/x86_Opteron_G5.xml @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/cpu_map/x86_Penryn.xml b/src/cpu_map/x86_Penryn.xml new file mode 100644 index 0000000000..9b0c0cfd0e --- /dev/null +++ b/src/cpu_map/x86_Penryn.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/cpu_map/x86_SandyBridge-IBRS.xml b/src/cpu_map/x86_SandyBr= idge-IBRS.xml new file mode 100644 index 0000000000..1f56b4bc81 --- /dev/null +++ b/src/cpu_map/x86_SandyBridge-IBRS.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/cpu_map/x86_SandyBridge.xml b/src/cpu_map/x86_SandyBridge.= xml new file mode 100644 index 0000000000..eea85fc3f3 --- /dev/null +++ b/src/cpu_map/x86_SandyBridge.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/cpu_map/x86_Skylake-Client-IBRS.xml b/src/cpu_map/x86_Skyl= ake-Client-IBRS.xml new file mode 100644 index 0000000000..1603bb8c13 --- /dev/null +++ b/src/cpu_map/x86_Skylake-Client-IBRS.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/cpu_map/x86_Skylake-Client.xml b/src/cpu_map/x86_Skylake-C= lient.xml new file mode 100644 index 0000000000..c0286b9fa5 --- /dev/null +++ b/src/cpu_map/x86_Skylake-Client.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/cpu_map/x86_Skylake-Server-IBRS.xml b/src/cpu_map/x86_Skyl= ake-Server-IBRS.xml new file mode 100644 index 0000000000..45350792a0 --- /dev/null +++ b/src/cpu_map/x86_Skylake-Server-IBRS.xml @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/cpu_map/x86_Skylake-Server.xml b/src/cpu_map/x86_Skylake-S= erver.xml new file mode 100644 index 0000000000..0119428357 --- /dev/null +++ b/src/cpu_map/x86_Skylake-Server.xml @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/cpu_map/x86_Westmere-IBRS.xml b/src/cpu_map/x86_Westmere-I= BRS.xml new file mode 100644 index 0000000000..dea7a73dcd --- /dev/null +++ b/src/cpu_map/x86_Westmere-IBRS.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/cpu_map/x86_Westmere.xml b/src/cpu_map/x86_Westmere.xml new file mode 100644 index 0000000000..f5c31449e0 --- /dev/null +++ b/src/cpu_map/x86_Westmere.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/cpu_map/x86_athlon.xml b/src/cpu_map/x86_athlon.xml new file mode 100644 index 0000000000..0d44508e20 --- /dev/null +++ b/src/cpu_map/x86_athlon.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/cpu_map/x86_core2duo.xml b/src/cpu_map/x86_core2duo.xml new file mode 100644 index 0000000000..3c9a148f3c --- /dev/null +++ b/src/cpu_map/x86_core2duo.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/cpu_map/x86_coreduo.xml b/src/cpu_map/x86_coreduo.xml new file mode 100644 index 0000000000..676e846920 --- /dev/null +++ b/src/cpu_map/x86_coreduo.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/cpu_map/x86_cpu64-rhel5.xml b/src/cpu_map/x86_cpu64-rhel5.= xml new file mode 100644 index 0000000000..670a92f274 --- /dev/null +++ b/src/cpu_map/x86_cpu64-rhel5.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/cpu_map/x86_cpu64-rhel6.xml b/src/cpu_map/x86_cpu64-rhel6.= xml new file mode 100644 index 0000000000..3cae0f00c2 --- /dev/null +++ b/src/cpu_map/x86_cpu64-rhel6.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/cpu_map/x86_features.xml b/src/cpu_map/x86_features.xml new file mode 100644 index 0000000000..109c653dbc --- /dev/null +++ b/src/cpu_map/x86_features.xml @@ -0,0 +1,440 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/cpu_map/x86_kvm32.xml b/src/cpu_map/x86_kvm32.xml new file mode 100644 index 0000000000..5f08a5e7fc --- /dev/null +++ b/src/cpu_map/x86_kvm32.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/cpu_map/x86_kvm64.xml b/src/cpu_map/x86_kvm64.xml new file mode 100644 index 0000000000..80b24e2a49 --- /dev/null +++ b/src/cpu_map/x86_kvm64.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/cpu_map/x86_n270.xml b/src/cpu_map/x86_n270.xml new file mode 100644 index 0000000000..cb359d968e --- /dev/null +++ b/src/cpu_map/x86_n270.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/cpu_map/x86_pentium.xml b/src/cpu_map/x86_pentium.xml new file mode 100644 index 0000000000..d44c1399b0 --- /dev/null +++ b/src/cpu_map/x86_pentium.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/src/cpu_map/x86_pentium2.xml b/src/cpu_map/x86_pentium2.xml new file mode 100644 index 0000000000..0d772bad2f --- /dev/null +++ b/src/cpu_map/x86_pentium2.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/cpu_map/x86_pentium3.xml b/src/cpu_map/x86_pentium3.xml new file mode 100644 index 0000000000..24eb227c28 --- /dev/null +++ b/src/cpu_map/x86_pentium3.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/cpu_map/x86_pentiumpro.xml b/src/cpu_map/x86_pentiumpro.xml new file mode 100644 index 0000000000..9f7a610a87 --- /dev/null +++ b/src/cpu_map/x86_pentiumpro.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/src/cpu_map/x86_phenom.xml b/src/cpu_map/x86_phenom.xml new file mode 100644 index 0000000000..71f004057b --- /dev/null +++ b/src/cpu_map/x86_phenom.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/cpu_map/x86_qemu32.xml b/src/cpu_map/x86_qemu32.xml new file mode 100644 index 0000000000..3c9cdec981 --- /dev/null +++ b/src/cpu_map/x86_qemu32.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/cpu_map/x86_qemu64.xml b/src/cpu_map/x86_qemu64.xml new file mode 100644 index 0000000000..ed3b8d54e2 --- /dev/null +++ b/src/cpu_map/x86_qemu64.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/cpu_map/x86_vendors.xml b/src/cpu_map/x86_vendors.xml new file mode 100644 index 0000000000..418712af21 --- /dev/null +++ b/src/cpu_map/x86_vendors.xml @@ -0,0 +1,4 @@ + + + + --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 11:39:25 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1534421473693657.7870496524099; Thu, 16 Aug 2018 05:11:13 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0CD3B30832DD; Thu, 16 Aug 2018 12:11:11 +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 C82CA5D755; Thu, 16 Aug 2018 12:11:10 +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 6359D1841C5B; Thu, 16 Aug 2018 12:11:10 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7GCAiTD026318 for ; Thu, 16 Aug 2018 08:10:44 -0400 Received: by smtp.corp.redhat.com (Postfix) id A8BA92166BA5; Thu, 16 Aug 2018 12:10:44 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-117-135.ams2.redhat.com [10.36.117.135]) by smtp.corp.redhat.com (Postfix) with ESMTP id EE9262166BA0; Thu, 16 Aug 2018 12:10:43 +0000 (UTC) From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Thu, 16 Aug 2018 13:10:31 +0100 Message-Id: <20180816121031.10902-9-berrange@redhat.com> In-Reply-To: <20180816121031.10902-1-berrange@redhat.com> References: <20180816121031.10902-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 8/8] xml: report the filename (if any) when parsing files 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: , Content-Type: text/plain; charset="utf-8" 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Thu, 16 Aug 2018 12:11:12 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 A generic "failed to parse xml document" message without telling us which XML file failed is quite unhelpful. Signed-off-by: Daniel P. Berrang=C3=A9 --- src/util/virxml.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/util/virxml.c b/src/util/virxml.c index a03a747e60..d1926f4605 100644 --- a/src/util/virxml.c +++ b/src/util/virxml.c @@ -847,7 +847,8 @@ virXMLParseHelper(int domcode, =20 if (virGetLastErrorCode() =3D=3D VIR_ERR_OK) { virGenericReportError(domcode, VIR_ERR_XML_ERROR, - "%s", _("failed to parse xml document")); + _("failed to parse xml document '%s'"), + filename ? filename : "[inline data]"); } goto cleanup; } --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list