From nobody Sun Feb 8 12:19:14 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.74 as permitted sender) client-ip=216.205.24.74; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-74.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.74 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1585316725; cv=none; d=zohomail.com; s=zohoarc; b=D2cAoGpSOWhKXvxdzyr5LPk5niMJHkEj/I7y7lH/g4to9GlNoJ4AC3nDi0SJbPiKBxs0L2uza3gNyFSOU22+oBzeq1kXJi2Ah8UTIX63+n/ivpmUv+vXE5SradQ1ZHHVH91ao97KTXG16Remzv/gPLU9rqYy0p2HWH2oS6Qdlr4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585316725; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=4W2+jY5ncw73XshEmfT6UFdAiU0a77neXnZ+dFYtChs=; b=BN8+VjcSi2Lz6Fv2Yw/yQ6j8zuruAqkfMnmpAn/+S1KssigXQvwBC5v1TODJPreUG79UUZ/IwuSR1bSXBwekXql6NCpFP5y/TcVv9BpjruymzyAMxkobsghUn6B/0vt55Ytch6JOYQdeOZ3cdMH2gn4j/rLbr5K9VLOrVD0+G2M= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.74 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-74.mimecast.com (us-smtp-delivery-74.mimecast.com [216.205.24.74]) by mx.zohomail.com with SMTPS id 1585316725680974.968802108281; Fri, 27 Mar 2020 06:45:25 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-199-setJw8xnP3aRDz26CeOd9A-1; Fri, 27 Mar 2020 09:45:22 -0400 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id BF442107B281; Fri, 27 Mar 2020 13:45:15 +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 8A1A360C87; Fri, 27 Mar 2020 13:45:15 +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 08E08944C2; Fri, 27 Mar 2020 13:45:15 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 02RDiRiP006492 for ; Fri, 27 Mar 2020 09:44:27 -0400 Received: by smtp.corp.redhat.com (Postfix) id 11BCB5C219; Fri, 27 Mar 2020 13:44:27 +0000 (UTC) Received: from rein.int.mamuti.net (unknown [10.40.192.72]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D7A315C1D8 for ; Fri, 27 Mar 2020 13:44:24 +0000 (UTC) Received: by rein.int.mamuti.net (Postfix, from userid 500) id 1ED7218F8BA; Fri, 27 Mar 2020 14:44:11 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1585316724; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=4W2+jY5ncw73XshEmfT6UFdAiU0a77neXnZ+dFYtChs=; b=ZyIh31w8vxx+xzBk0SVwAh77XFxVDQR3a53XP7KRMzXV5DNS1ABnVpRWPinH1a06Al7BfX LW7OKs5WtOVPsJhqC8e2249CZtPJRqcvA20wjZlJBsyZpUPn2YcOXx5j70jbSLgieLeZgu w7jXYU1m6gzNv2jw1zjKfPRbatJSdD4= X-MC-Unique: setJw8xnP3aRDz26CeOd9A-1 From: Jiri Denemark To: libvir-list@redhat.com Subject: [libvirt PATCH 29/39] cpu_x86: Move and rename x86ModelCopySignatures Date: Fri, 27 Mar 2020 14:43:58 +0100 Message-Id: <6828d8ead3cd85e47b3a3df62ccbfb1fe50ee553.1585316580.git.jdenemar@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com 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: , 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-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Later in this series the function will work on a newly introduced virCPUx86Signatures structure. Let's move it to the place were all related functions will be added and rename the function as virCPUx86SignaturesCopy for easier review of the virCPUx86Signatures patch. Signed-off-by: Jiri Denemark Reviewed-by: J=C3=A1n Tomko --- src/cpu/cpu_x86.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index 16e73b5b98..4b6eaf8060 100644 --- a/src/cpu/cpu_x86.c +++ b/src/cpu/cpu_x86.c @@ -1090,23 +1090,9 @@ x86FeatureParse(xmlXPathContextPtr ctxt, } =20 =20 -static void -x86ModelFree(virCPUx86ModelPtr model) -{ - if (!model) - return; - - g_free(model->name); - g_free(model->signatures); - virCPUx86DataClear(&model->data); - g_free(model); -} -G_DEFINE_AUTOPTR_CLEANUP_FUNC(virCPUx86Model, x86ModelFree); - - static int -x86ModelCopySignatures(virCPUx86ModelPtr dst, - virCPUx86ModelPtr src) +virCPUx86SignaturesCopy(virCPUx86ModelPtr dst, + virCPUx86ModelPtr src) { size_t i; =20 @@ -1124,6 +1110,20 @@ x86ModelCopySignatures(virCPUx86ModelPtr dst, } =20 =20 +static void +x86ModelFree(virCPUx86ModelPtr model) +{ + if (!model) + return; + + g_free(model->name); + g_free(model->signatures); + virCPUx86DataClear(&model->data); + g_free(model); +} +G_DEFINE_AUTOPTR_CLEANUP_FUNC(virCPUx86Model, x86ModelFree); + + static virCPUx86ModelPtr x86ModelCopy(virCPUx86ModelPtr model) { @@ -1132,7 +1132,7 @@ x86ModelCopy(virCPUx86ModelPtr model) copy =3D g_new0(virCPUx86Model, 1); copy->name =3D g_strdup(model->name); =20 - if (x86ModelCopySignatures(copy, model) < 0) { + if (virCPUx86SignaturesCopy(copy, model) < 0) { x86ModelFree(copy); return NULL; } @@ -1360,7 +1360,7 @@ x86ModelParseAncestor(virCPUx86ModelPtr model, } =20 model->vendor =3D ancestor->vendor; - if (x86ModelCopySignatures(model, ancestor) < 0) + if (virCPUx86SignaturesCopy(model, ancestor) < 0) return -1; =20 x86DataCopy(&model->data, &ancestor->data); --=20 2.26.0