From nobody Sun Feb 8 23:37:18 2026 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 1551778960669285.80729817453687; Tue, 5 Mar 2019 01:42:40 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0531F88312; Tue, 5 Mar 2019 09:42:39 +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 C878760A9A; Tue, 5 Mar 2019 09:42:38 +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 8C2C6181A12C; Tue, 5 Mar 2019 09:42:38 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x259erTP026304 for ; Tue, 5 Mar 2019 04:40:53 -0500 Received: by smtp.corp.redhat.com (Postfix) id 356725D978; Tue, 5 Mar 2019 09:40:53 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 09E6C5BBC9 for ; Tue, 5 Mar 2019 09:40:52 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 3857A106FB8; Tue, 5 Mar 2019 10:40:47 +0100 (CET) From: Jiri Denemark To: libvir-list@redhat.com Date: Tue, 5 Mar 2019 10:40:28 +0100 Message-Id: <7aadf1e9d876c342dde78d897e3e0879a37d4ecb.1551778706.git.jdenemar@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 12/30] cpu_x86: Add x86ModelCopySignatures helper 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-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 05 Mar 2019 09:42:39 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Introduce a helper for copying CPU signature between two CPU models. It's not very useful until the way we store signatures is changed in the next patch. Signed-off-by: Jiri Denemark Reviewed-by: J=C3=A1n Tomko --- Notes: Version 2: - separated from 11/26 cpu_x86: Allow multiple signatures for a CPU mod= el src/cpu/cpu_x86.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index 4dd10fb561..0be1b12cdb 100644 --- a/src/cpu/cpu_x86.c +++ b/src/cpu/cpu_x86.c @@ -979,6 +979,16 @@ x86ModelFree(virCPUx86ModelPtr model) } =20 =20 +static int +x86ModelCopySignatures(virCPUx86ModelPtr dst, + virCPUx86ModelPtr src) +{ + dst->signature =3D src->signature; + + return 0; +} + + static virCPUx86ModelPtr x86ModelCopy(virCPUx86ModelPtr model) { @@ -986,13 +996,13 @@ x86ModelCopy(virCPUx86ModelPtr model) =20 if (VIR_ALLOC(copy) < 0 || VIR_STRDUP(copy->name, model->name) < 0 || + x86ModelCopySignatures(copy, model) < 0 || x86DataCopy(©->data, &model->data) < 0) { x86ModelFree(copy); return NULL; } =20 copy->vendor =3D model->vendor; - copy->signature =3D model->signature; =20 return copy; } @@ -1178,8 +1188,8 @@ x86ModelParseAncestor(virCPUx86ModelPtr model, } =20 model->vendor =3D ancestor->vendor; - model->signature =3D ancestor->signature; - if (x86DataCopy(&model->data, &ancestor->data) < 0) + if (x86ModelCopySignatures(model, ancestor) < 0 || + x86DataCopy(&model->data, &ancestor->data) < 0) return -1; =20 return 0; --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list