From nobody Sun Feb 8 12:32:41 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=1585316675; cv=none; d=zohomail.com; s=zohoarc; b=Ig7QRm+4bLNHSqC8S4ZIAx14AMRfE9QO8oXXLZ8Nu+duOORMRpPNmQKETt+SoYj1tvgO0Iqk3vIKNK90SJl8BXr4BEEwZm//CvaBk1gCcX51HnFhiyRmiSDXbyzRWbA9Nsgro9JgLJvmHf8ozQlly8/eOqmrq/6IWV8cS42CdqM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585316675; 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=MIi+p8Ss14jPmIxmEyWJOddkna+vL2OI/AILOtOZO5w=; b=cnUCRVS3LpNu04IlWNv4FKuahVfEtGv4k/8MkXqSqUc6P0nlbZNxIOtihnlk4b9XiYiEW7fYD5EnaapFQF6/glnQesRUt2RYROXZPFDZN9Mhyjao0tjmtqSOrghl1InvO2eYefKoWx6EESalljOqvRAgNDVc1QIxX7K3faqaIjk= 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 1585316675178657.4597862881378; Fri, 27 Mar 2020 06:44:35 -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-283-uZh7bq-wN5O_zkHwWmBWZQ-1; Fri, 27 Mar 2020 09:44:30 -0400 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 433051005514; Fri, 27 Mar 2020 13:44:24 +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 0D9CF96FA4; Fri, 27 Mar 2020 13:44:24 +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 031978A055; Fri, 27 Mar 2020 13:44:21 +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 02RDiJm3006266 for ; Fri, 27 Mar 2020 09:44:19 -0400 Received: by smtp.corp.redhat.com (Postfix) id F1D035C1D8; Fri, 27 Mar 2020 13:44:18 +0000 (UTC) Received: from rein.int.mamuti.net (unknown [10.40.192.72]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C36165C1D4 for ; Fri, 27 Mar 2020 13:44:16 +0000 (UTC) Received: by rein.int.mamuti.net (Postfix, from userid 500) id CCAA318D070; Fri, 27 Mar 2020 14:44:10 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1585316671; 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=MIi+p8Ss14jPmIxmEyWJOddkna+vL2OI/AILOtOZO5w=; b=gP8VtuAeUt7hu7NrnLyLYyvsj2kdOy6GARDsZDs6boUyjt4B2BVgLSgjCWQvlscUExCHWD DI0+M71l30pSCxJBHKlnivkRfvHbIiWZTto3jXJz06zyYIsD9eoTdImb/2eUDybhfhwyro 0JlKmTWjPLiqbEDAHmlEIkZtmKG1f9o= X-MC-Unique: uZh7bq-wN5O_zkHwWmBWZQ-1 From: Jiri Denemark To: libvir-list@redhat.com Subject: [libvirt PATCH 04/39] cpu_x86: Use glib allocation for virCPUx86Feature Date: Fri, 27 Mar 2020 14:43:33 +0100 Message-Id: <47a46bf4d35b847f634c8d23473e8638ead5e33a.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.13 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" Signed-off-by: Jiri Denemark Reviewed-by: J=C3=A1n Tomko --- src/cpu/cpu_x86.c | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index 6fad4af922..cfb8a2e4a5 100644 --- a/src/cpu/cpu_x86.c +++ b/src/cpu/cpu_x86.c @@ -893,28 +893,17 @@ x86VendorParse(xmlXPathContextPtr ctxt, } =20 =20 -static virCPUx86FeaturePtr -x86FeatureNew(void) -{ - virCPUx86FeaturePtr feature; - - if (VIR_ALLOC(feature) < 0) - return NULL; - - return feature; -} - - static void x86FeatureFree(virCPUx86FeaturePtr feature) { if (!feature) return; =20 - VIR_FREE(feature->name); + g_free(feature->name); virCPUx86DataClear(&feature->data); - VIR_FREE(feature); + g_free(feature); } +G_DEFINE_AUTOPTR_CLEANUP_FUNC(virCPUx86Feature, x86FeatureFree); =20 =20 static int @@ -1056,11 +1045,8 @@ x86FeatureParse(xmlXPathContextPtr ctxt, char *str =3D NULL; int ret =3D -1; =20 - if (!(feature =3D x86FeatureNew())) - goto cleanup; - + feature =3D g_new0(virCPUx86Feature, 1); feature->migratable =3D true; - feature->name =3D g_strdup(name); =20 if (x86FeatureFind(map, feature->name)) { --=20 2.26.0