From nobody Wed Dec 4 18:59:55 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 17320423195471002.0183005737553; Tue, 19 Nov 2024 10:51:59 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id 5E34A158D; Tue, 19 Nov 2024 13:51:58 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 617A31414; Tue, 19 Nov 2024 13:50:33 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id 84D31137A; Tue, 19 Nov 2024 13:50:17 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 0073713DB for ; Tue, 19 Nov 2024 13:50:16 -0500 (EST) Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-324-He0Eh15xNcmn-iv988xzcA-1; Tue, 19 Nov 2024 13:50:15 -0500 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 5BFC11955D44 for ; Tue, 19 Nov 2024 18:50:14 +0000 (UTC) Received: from orkuz (unknown [10.45.226.13]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id D4EC530001A2 for ; Tue, 19 Nov 2024 18:50:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1732042216; h=from:from: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; bh=dA75gR22oP1hH2v9mbOIE3m8EDQ7hllCw0I7cQnoMM4=; b=dD3MCXoV4tZhKSzV86+BS3K4jdoE0CT+aMXQ38J9UUDBJJ1d6oZngm7ZRjywEYPZN2b4JU xs0/TnRMB4fad+iDE905Ue6HSWhBbe6AJvwaoJ7U5S9hd9PM3lqEdz/RcX0UtRFB8iv5fG iO4Juq2XuFH2IDbaRB8igpWJDFRLxEw= X-MC-Unique: He0Eh15xNcmn-iv988xzcA-1 X-Mimecast-MFC-AGG-ID: He0Eh15xNcmn-iv988xzcA From: Jiri Denemark To: devel@lists.libvirt.org Subject: [PATCH 01/32] cpu_x86: Copy added and removed features from ancestor Date: Tue, 19 Nov 2024 19:49:37 +0100 Message-ID: <6c0db479bcaf3e410885ac331595fd7ed7e43458.1732039836.git.jdenemar@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 0RZ0mkm3ehNi_FFVCMQNUsWaGiT7-ItRgNtbZnpEfSQ_1732042214 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: CGQ2XNXYGECCLJ7V5H6L2UCDTORTKRGA X-Message-ID-Hash: CGQ2XNXYGECCLJ7V5H6L2UCDTORTKRGA X-MailFrom: jdenemar@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1732042321188116600 Content-Type: text/plain; charset="utf-8" When a CPU model is defined based on another model, we need to copy the lists of removed and added features from it. Signed-off-by: Jiri Denemark --- src/cpu/cpu_x86.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index 97d6e00007..7cfab8278d 100644 --- a/src/cpu/cpu_x86.c +++ b/src/cpu/cpu_x86.c @@ -1555,6 +1555,8 @@ x86ModelParseAncestor(virCPUx86Model *model, model->vendor =3D ancestor->vendor; model->signatures =3D virCPUx86SignaturesCopy(ancestor->signatures); x86DataCopy(&model->data, &ancestor->data); + model->removedFeatures =3D g_strdupv(ancestor->removedFeatures); + model->addedFeatures =3D g_strdupv(ancestor->addedFeatures); =20 return 0; } @@ -1654,8 +1656,19 @@ x86ModelParseFeatures(virCPUx86Model *model, if ((n =3D virXPathNodeSet("./feature", ctxt, &nodes)) <=3D 0) return n; =20 - model->removedFeatures =3D g_new0(char *, n + 1); - model->addedFeatures =3D g_new0(char *, n + 1); + if (model->removedFeatures) { + nremoved =3D g_strv_length(model->removedFeatures); + model->removedFeatures =3D g_renew(char *, model->removedFeatures,= nremoved + n + 1); + } else { + model->removedFeatures =3D g_new0(char *, n + 1); + } + + if (model->addedFeatures) { + nadded =3D g_strv_length(model->addedFeatures); + model->addedFeatures =3D g_renew(char *, model->addedFeatures, nad= ded + n + 1); + } else { + model->addedFeatures =3D g_new0(char *, n + 1); + } =20 for (i =3D 0; i < n; i++) { g_autofree char *ftname =3D NULL; --=20 2.47.0