From nobody Tue Apr 16 15:32:23 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 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=1599830593; cv=none; d=zohomail.com; s=zohoarc; b=HRI7Rz1dYuz/2wUqZBgkRSew5tOi9f8ZW9X7iJbaIhisrR0VIKKHB8HFL2L6kg2OtTuDR6pkB1ahdrmuY7J44Xu1kBi6kAVtW1FsD705IBIYUBxJC2e7Pb5IFI5oEouQaygwahutujI64YaIaU/n4extH4ZwWA+2aRERmVTsA3g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599830593; h=Content-Type:Content-Transfer-Encoding:Cc: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=qB2rucJIx20Cx9RfQYo0g3sCYzhIcySmABiopuOD5sc=; b=S/YxwJ9RuE+CVFVqzjK4tnXlM+ZHclkeIDIaxZoki6RPm/lig0nVpxMwcuydiNbEeIp07I4Z6UCSiQYdKgevAwcqUwH0JLUqQYi+CL/JxnkR8DGPBCNwXAATEKFcQfRIp6xNdrVOlnNwCu6uE0nNelJucUA2Gy3+QZqoxCm152s= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 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-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1599830593045833.5011559771999; Fri, 11 Sep 2020 06:23:13 -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-245-kj4vkB9HMQSjiVNZiAFqSQ-1; Fri, 11 Sep 2020 09:23:09 -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 40248AE963; Fri, 11 Sep 2020 13:23:03 +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 1C6AF60C04; Fri, 11 Sep 2020 13:23:03 +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 DD2DB9230C; Fri, 11 Sep 2020 13:23:02 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08BDMtRY025345 for ; Fri, 11 Sep 2020 09:22:55 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7C49C60C11; Fri, 11 Sep 2020 13:22:55 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-112-163.ams2.redhat.com [10.36.112.163]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8A97A60C04; Fri, 11 Sep 2020 13:22:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599830591; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=qB2rucJIx20Cx9RfQYo0g3sCYzhIcySmABiopuOD5sc=; b=RJajC/aQG3sQdcIKuRekhy/+VIzag6cN7O9mUgoGpg1IOkyeke+z5Iy5aEWFPBOUwGFShy PMrLQ0B3taesWxTSzXD2kSKeGeTCRVzwthGC2H3xn4VIpY6v1HKl/EqFI+oLUcSCi3XgIN ezBcYrRenoqfoAB4m6x+4FrPcmi/ooI= X-MC-Unique: kj4vkB9HMQSjiVNZiAFqSQ-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH v3 1/8] cpu_ppc64: Use g_auto* in ppc64MakeCPUData Date: Fri, 11 Sep 2020 15:22:42 +0200 Message-Id: <20200911132249.514503-2-twiederh@redhat.com> In-Reply-To: <20200911132249.514503-1-twiederh@redhat.com> References: <20200911132249.514503-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Cc: =?UTF-8?q?J=C3=A1n=20Tomko?= , Tim Wiederhake 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 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0.001 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Signed-off-by: Tim Wiederhake Reviewed-by: J=C3=A1n Tomko --- src/cpu/cpu_ppc64.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cpu/cpu_ppc64.c b/src/cpu/cpu_ppc64.c index 28fbfea9ae..c0d09db696 100644 --- a/src/cpu/cpu_ppc64.c +++ b/src/cpu/cpu_ppc64.c @@ -399,7 +399,7 @@ static virCPUDataPtr ppc64MakeCPUData(virArch arch, virCPUppc64Data *data) { - virCPUDataPtr cpuData; + g_autoptr(virCPUData) cpuData =3D NULL; =20 if (VIR_ALLOC(cpuData) < 0) return NULL; @@ -407,9 +407,9 @@ ppc64MakeCPUData(virArch arch, cpuData->arch =3D arch; =20 if (ppc64DataCopy(&cpuData->data.ppc64, data) < 0) - VIR_FREE(cpuData); + return NULL; =20 - return cpuData; + return g_steal_pointer(&cpuData); } =20 static virCPUCompareResult --=20 2.26.2 From nobody Tue Apr 16 15:32:23 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 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=1599830597; cv=none; d=zohomail.com; s=zohoarc; b=LAia17pgNM1N+ejWM55wGf67f1qst+CjKg8Bbjmua+PcZPrw7uUpDTZzFB8XEgArdEy3PQWaN00RPQEe4du2+LE+Z+FKH8RR5baw+UTVdp7hmN7xxAXXw2eOgDykg4adHtdYyOosOVlVta3wSYFEoDBDeuq97SlNPxNUe1GdMg8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599830597; h=Content-Type:Content-Transfer-Encoding:Cc: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=DdIvcU+7BcXMnnU67S4PxqFtvFC0/D/ZdufQEfhPf3U=; b=H8eTl9RDqd5Ie8ZQlnCOwRJd220syZrsDlbpfCatvc4Qe0vFldXdiVNDIZrmkHBo4VAdChlYltezB7hJSuLbRHuHP15DsL3329rBxVASmvx9+yOF+gB/7XsMh7crwEqGAy5HYfbQ6gTN0jHZuhYkS54uxvIoxt+Sn24LP6vPCVs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 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-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1599830597202893.3088601769017; Fri, 11 Sep 2020 06:23:17 -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-260-nbRz40uAMgCOxqr_GblnAQ-1; Fri, 11 Sep 2020 09:23:13 -0400 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9CA5D18BE164; Fri, 11 Sep 2020 13:23: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 7E9227C0BA; Fri, 11 Sep 2020 13:23: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 4AFC9181A872; Fri, 11 Sep 2020 13:23:05 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08BDMu0A025355 for ; Fri, 11 Sep 2020 09:22:56 -0400 Received: by smtp.corp.redhat.com (Postfix) id BD1F460C17; Fri, 11 Sep 2020 13:22:56 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-112-163.ams2.redhat.com [10.36.112.163]) by smtp.corp.redhat.com (Postfix) with ESMTP id D92E760C04; Fri, 11 Sep 2020 13:22:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599830595; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=DdIvcU+7BcXMnnU67S4PxqFtvFC0/D/ZdufQEfhPf3U=; b=guw1vTrOOOS9gG87IPRZKKnwq6voGrQ9eHtxm7416Z5F68iIwj6K73eFHlRQTY04/Q50Vz TFfqeEO9LJZzU8basB48blrQVCCiFUmfna3SVftDEOtiVW7l/mbXZ/lehOzjrB8GJVKzvZ 32fmnJHHf9RKHdw6fgnVNXH+JoeLov4= X-MC-Unique: nbRz40uAMgCOxqr_GblnAQ-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH v3 2/8] cpu_map: Use g_auto* in loadData Date: Fri, 11 Sep 2020 15:22:43 +0200 Message-Id: <20200911132249.514503-3-twiederh@redhat.com> In-Reply-To: <20200911132249.514503-1-twiederh@redhat.com> References: <20200911132249.514503-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Cc: =?UTF-8?q?J=C3=A1n=20Tomko?= , Tim Wiederhake 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.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Signed-off-by: Tim Wiederhake Reviewed-by: J=C3=A1n Tomko --- src/cpu/cpu_map.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cpu/cpu_map.c b/src/cpu/cpu_map.c index 65d244e011..53c8cbba6b 100644 --- a/src/cpu/cpu_map.c +++ b/src/cpu/cpu_map.c @@ -55,8 +55,9 @@ loadData(const char *mapfile, } =20 for (i =3D 0; i < n; i++) { - char *name =3D virXMLPropString(nodes[i], "name"); - if (!name) { + g_autofree char *name =3D NULL; + + if (!(name =3D virXMLPropString(nodes[i], "name"))) { virReportError(VIR_ERR_INTERNAL_ERROR, _("cannot find %s name in CPU map '%s'"), eleme= nt, mapfile); return -1; @@ -64,7 +65,6 @@ loadData(const char *mapfile, VIR_DEBUG("Load %s name %s", element, name); ctxt->node =3D nodes[i]; rv =3D callback(ctxt, name, data); - VIR_FREE(name); if (rv < 0) return -1; } --=20 2.26.2 From nobody Tue Apr 16 15:32:23 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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=1599830592; cv=none; d=zohomail.com; s=zohoarc; b=kK1gbpwirl9Rp3Na+OzJ4gf0Y1RhpQkczQ+PFjt/7uqWuszAUF7RSgj6HnyD+8cSY6mQxN0KSU84ax2DGAcS+MIoZYpAWA9wJLbcyOcWGlXdTgRKgzWI2vMzpbtigZayq3OrF3v1X2kuFZOUHrJCXxfwCuBg7vpTwOKqZBc/3Ms= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599830592; h=Content-Type:Content-Transfer-Encoding:Cc: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=w1h+y7hQ7Vsn4UMrtko+9mEbi+jvESCt9M7GP1MkzxI=; b=fpndKFKr+nwwpYnfTZetL6RKABw6jmxzC28Yqiu7thcYbUpqE07LcqsVlabx/d0aHXl2q2rVKPCBjG44foiSFCSU8zdtVhnHJ9FBugLHlXhLU2Q5F75A6LDBEEakPeuwr6ECrP1IsmH4rb6PG8de3VVevTfMJgwvehtw1w5fs9o= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1599830592408531.034505317989; Fri, 11 Sep 2020 06:23:12 -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-155-15vWnX-wOpa8TWFEWiZCEw-1; Fri, 11 Sep 2020 09:23:08 -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 15CD480F058; Fri, 11 Sep 2020 13:23:02 +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 E592981C47; Fri, 11 Sep 2020 13:23:01 +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 ACC6A181A86E; Fri, 11 Sep 2020 13:23:01 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08BDN0C3025367 for ; Fri, 11 Sep 2020 09:23:00 -0400 Received: by smtp.corp.redhat.com (Postfix) id 445E360C47; Fri, 11 Sep 2020 13:23:00 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-112-163.ams2.redhat.com [10.36.112.163]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7BB2A60C15; Fri, 11 Sep 2020 13:22:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599830590; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=w1h+y7hQ7Vsn4UMrtko+9mEbi+jvESCt9M7GP1MkzxI=; b=A0D0Zm7QycVl60Vua9JdPL1iS6QpyaqCQ8XNF3pGnrucgFByWRdhMzdaZbndglx7o7Qq9q aKpSGViGFA1LyGi+sZEtJxn/saaS5qxqVK8R27oaAJcdotM9rlssEuC4lzPdrJOf/bOT7t 2jPz1iZ/DPJZiSsKBFt1Rd3AKQZ1XwE= X-MC-Unique: 15vWnX-wOpa8TWFEWiZCEw-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH v3 3/8] cpu_map: Use g_auto* in loadIncludes Date: Fri, 11 Sep 2020 15:22:44 +0200 Message-Id: <20200911132249.514503-4-twiederh@redhat.com> In-Reply-To: <20200911132249.514503-1-twiederh@redhat.com> References: <20200911132249.514503-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Cc: Tim Wiederhake 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 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0.001 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: Tim Wiederhake --- src/cpu/cpu_map.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/cpu/cpu_map.c b/src/cpu/cpu_map.c index 53c8cbba6b..743547c6d1 100644 --- a/src/cpu/cpu_map.c +++ b/src/cpu/cpu_map.c @@ -125,18 +125,16 @@ loadIncludes(xmlXPathContextPtr ctxt, return -1; =20 for (i =3D 0; i < n; i++) { - char *filename =3D virXMLPropString(nodes[i], "filename"); + g_autofree char *filename =3D virXMLPropString(nodes[i], "filename= "); + if (!filename) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Missing 'filename' in CPU map include")); return -1; } VIR_DEBUG("Finding CPU map include '%s'", filename); - if (cpuMapLoadInclude(filename, vendorCB, featureCB, modelCB, data= ) < 0) { - VIR_FREE(filename); + if (cpuMapLoadInclude(filename, vendorCB, featureCB, modelCB, data= ) < 0) return -1; - } - VIR_FREE(filename); } =20 return 0; --=20 2.26.2 From nobody Tue Apr 16 15:32:23 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 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=1599830597; cv=none; d=zohomail.com; s=zohoarc; b=BiUwyHCYJwznxPWH+Y739WZkxxO5Qhe56bKlo27gJUOvxmDPHmzgWibLoIZcMg72AOSVO/pMlvpxBN3z3fTsVEfMtQ+DJcz0bCGT8oouvIsLr2Xlw6/89ohNa+ZxhKRFHT3/BZMjgPr/GAZD9lIM+2P3xTlWg31RPitfja588uc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599830597; h=Content-Type:Content-Transfer-Encoding:Cc: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=9NP2PTFbvYdvyONyk+TVJqDuGGNSbNApfBxaOGcLO14=; b=F4MVqU1A+zdwof7ZSTDdp+RtjP3Yq4D5RaYaNtx1IlNBXEvA1rOO64fig69tPViz2yXYgnfLSuWGECiJnqMzZL6QSN2ytPLppYo1oCCq81Vr68nLsbxL2BTXRB6F+H3NYKNNDfD13ecqOMhKJLe6DXXgTfQlXfdMJAGis+ErD8U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 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-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 159983059760037.005090890528436; Fri, 11 Sep 2020 06:23:17 -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-471-6pJwYXbEP16xHapd8aKZdg-1; Fri, 11 Sep 2020 09:23:11 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B22E08D0309; Fri, 11 Sep 2020 13:23: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 8F87D1002D57; Fri, 11 Sep 2020 13:23: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 5A976181A870; Fri, 11 Sep 2020 13:23:05 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08BDN1hm025379 for ; Fri, 11 Sep 2020 09:23:01 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8BE8160C11; Fri, 11 Sep 2020 13:23:01 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-112-163.ams2.redhat.com [10.36.112.163]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9E34360C15; Fri, 11 Sep 2020 13:23:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599830594; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=9NP2PTFbvYdvyONyk+TVJqDuGGNSbNApfBxaOGcLO14=; b=DC+Mhd6YaSx3D477/lLAYUkd0BnG7+BeIfqwN7g3O+ZVxcAJvcvHvZunO8zspHDkKvygUO L1hEt4/Ugddu5lKmki0ty5gzOcM0xQmCkF0Q/ETijPW+U5/VDbeoXG/iN8vuiPy3kS1Y8d Moh3We71szeftPlkDCqJsr/10faiz+c= X-MC-Unique: 6pJwYXbEP16xHapd8aKZdg-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH v3 4/8] cpu_x86: Use g_auto* in virX86CpuIncompatible Date: Fri, 11 Sep 2020 15:22:45 +0200 Message-Id: <20200911132249.514503-5-twiederh@redhat.com> In-Reply-To: <20200911132249.514503-1-twiederh@redhat.com> References: <20200911132249.514503-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Cc: =?UTF-8?q?J=C3=A1n=20Tomko?= , Tim Wiederhake 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.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Signed-off-by: Tim Wiederhake Reviewed-by: J=C3=A1n Tomko --- src/cpu/cpu_x86.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index fdb665b01d..db1b2e55a1 100644 --- a/src/cpu/cpu_x86.c +++ b/src/cpu/cpu_x86.c @@ -1797,7 +1797,7 @@ virCPUx86DataParse(xmlXPathContextPtr ctxt) */ #define virX86CpuIncompatible(MSG, CPU_DEF) \ do { \ - char *flagsStr =3D NULL; \ + g_autofree char *flagsStr =3D NULL; \ if (!(flagsStr =3D x86FeatureNames(map, ", ", (CPU_DEF)))) { \ virReportOOMError(); \ return VIR_CPU_COMPARE_ERROR; \ @@ -1805,7 +1805,6 @@ virCPUx86DataParse(xmlXPathContextPtr ctxt) if (message) \ *message =3D g_strdup_printf("%s: %s", _(MSG), flagsStr); \ VIR_DEBUG("%s: %s", MSG, flagsStr); \ - VIR_FREE(flagsStr); \ } while (0) =20 =20 --=20 2.26.2 From nobody Tue Apr 16 15:32:23 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 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=1599830598; cv=none; d=zohomail.com; s=zohoarc; b=SxBiZht35wHESTPPchJgbSTDa45P64/ZKAglczA8EQyoHgpJH7JMwkxDxCaXQw60QuSQmEbZHMt5JTiy1ezDKSlRTj7pcD8W1uX2s3LDBHVm6j+T+bAZdsA73gmYs+FujrX0biLQQQJfHeTWdkoxiIqcPtR8PdUpUPWg0XgYPng= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599830598; h=Content-Type:Content-Transfer-Encoding:Cc: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=b+6uQFcETR6gD9BvNFVtAZZJTJus2nzOkdTSj+Dqn3E=; b=fQVitjIGgfmhNwdsoKekl2NhYmv24k1j6N4PolqVyr+wMjXCZZC1eXO93RnOzNL8z8PwqZ4FUgw84CnuoaLEd01ccLpGr9ALAvG/2m3J/eIQLdLrpGN3X/emuyb4ImsLR3eS9qa8cQ2dRFEmtG2kXGHOZDntIRUe9uUuE0mNKAE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 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-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1599830598302611.9294650083477; Fri, 11 Sep 2020 06:23:18 -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-273-F1sKv7-jMWGeZP89YRIanQ-1; Fri, 11 Sep 2020 09:23:14 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6C7771008550; Fri, 11 Sep 2020 13:23:08 +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 47C0A17B33; Fri, 11 Sep 2020 13:23:08 +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 E23B2181A89B; Fri, 11 Sep 2020 13:23:07 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08BDN65G025400 for ; Fri, 11 Sep 2020 09:23:06 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3C5C160C47; Fri, 11 Sep 2020 13:23:06 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-112-163.ams2.redhat.com [10.36.112.163]) by smtp.corp.redhat.com (Postfix) with ESMTP id 460FD60C17; Fri, 11 Sep 2020 13:23:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599830597; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=b+6uQFcETR6gD9BvNFVtAZZJTJus2nzOkdTSj+Dqn3E=; b=bMKhjqcF1KU9Fof1XmG6zWHjUehtKx8do9Hf1IUEI8W3kZQ4LZaucO0PQuSvcl283mSAU1 N5zIvYYCxj6HHc12OzEQ5zKo2A/LVh2/mSzyrvvss5hVJk1h3QluSi2EdGtF2+HaZVeoJ6 ozE2T8N/P8FGTT24sTlOHo0ztTbpK58= X-MC-Unique: F1sKv7-jMWGeZP89YRIanQ-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH v3 5/8] cpu_map: Remove unnecessary variable in loadData Date: Fri, 11 Sep 2020 15:22:46 +0200 Message-Id: <20200911132249.514503-6-twiederh@redhat.com> In-Reply-To: <20200911132249.514503-1-twiederh@redhat.com> References: <20200911132249.514503-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Cc: =?UTF-8?q?J=C3=A1n=20Tomko?= , Tim Wiederhake 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.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0.001 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Signed-off-by: Tim Wiederhake Reviewed-by: J=C3=A1n Tomko --- src/cpu/cpu_map.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/cpu/cpu_map.c b/src/cpu/cpu_map.c index 743547c6d1..6baaa77776 100644 --- a/src/cpu/cpu_map.c +++ b/src/cpu/cpu_map.c @@ -43,7 +43,6 @@ loadData(const char *mapfile, g_autofree xmlNodePtr *nodes =3D NULL; int n; size_t i; - int rv; =20 if ((n =3D virXPathNodeSet(element, ctxt, &nodes)) < 0) return -1; @@ -64,8 +63,7 @@ loadData(const char *mapfile, } VIR_DEBUG("Load %s name %s", element, name); ctxt->node =3D nodes[i]; - rv =3D callback(ctxt, name, data); - if (rv < 0) + if (callback(ctxt, name, data) < 0) return -1; } =20 --=20 2.26.2 From nobody Tue Apr 16 15:32:23 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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=1599830605; cv=none; d=zohomail.com; s=zohoarc; b=nj0YIZIHE+Zqpw2q9IdgA7NoIJzsO/hZhPppXAp7pGWxn4Ahy2It0V5EUstTa2GdfIeaHVpoBTt79PyAhK2k2Q6BbXmwGnpoOuB8gsF0aZlT6dfiZyL6rceTXj2bdYrok1lMgbgtlPS18gqFZ6WPIzhcFUxV6O9BwGyITGFl2yo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599830605; h=Content-Type:Content-Transfer-Encoding:Cc: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=mt0a32UP2Zk0RB/Sx3bMCPWV69enGW+uVc96DyvlM5Y=; b=MGXoqdLYXjMXs/tssSknXEBVemPgby/l7NTpA/u7AHKaqzyfY7LUuIPGznv2/AnXzD4Cmz03IM1t7N3oGWN5lzs4dIduywFGX+ccqVEEKCOgVKpWpih88shdP11yKKd6KqVT6fZvJm8SoIPYDDE3+3omwposbRRSfswanx/MakI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1599830605591382.5753647455774; Fri, 11 Sep 2020 06:23: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-565-G0erKOEWOGCfbM-Ihvlh3g-1; Fri, 11 Sep 2020 09:23:17 -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 DDBCA10BBEE5; Fri, 11 Sep 2020 13:23:10 +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 BAECE81C4B; Fri, 11 Sep 2020 13:23: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 87B269230D; Fri, 11 Sep 2020 13:23:10 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08BDN7Kc025405 for ; Fri, 11 Sep 2020 09:23:07 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8EAF860C15; Fri, 11 Sep 2020 13:23:07 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-112-163.ams2.redhat.com [10.36.112.163]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9488860C04; Fri, 11 Sep 2020 13:23:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599830600; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=mt0a32UP2Zk0RB/Sx3bMCPWV69enGW+uVc96DyvlM5Y=; b=Gwj9WvOPM5og6Gn0T8jtxEqyyxryRQwen5ioeuyoSnx9vjVey9bpptB2jC/CfZbskV1S07 JeieRWfm/tB+gVDGuUMUSgONjpU6qGRWbdS4znlXJT267V2ZKKaPIvs1w+kIlCXuMUoiWp YwMst9Z/ANtgPRzXd3YTpXB//Eci4DU= X-MC-Unique: G0erKOEWOGCfbM-Ihvlh3g-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH v3 6/8] cpu: Replace VIR_ALLOC with g_new0 Date: Fri, 11 Sep 2020 15:22:47 +0200 Message-Id: <20200911132249.514503-7-twiederh@redhat.com> In-Reply-To: <20200911132249.514503-1-twiederh@redhat.com> References: <20200911132249.514503-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Cc: =?UTF-8?q?J=C3=A1n=20Tomko?= , Tim Wiederhake 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 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0.001 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Signed-off-by: Tim Wiederhake Reviewed-by: J=C3=A1n Tomko --- src/cpu/cpu.c | 4 +--- src/cpu/cpu_ppc64.c | 19 +++++-------------- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/src/cpu/cpu.c b/src/cpu/cpu.c index 69e4205e4b..c3eef52c79 100644 --- a/src/cpu/cpu.c +++ b/src/cpu/cpu.c @@ -286,9 +286,7 @@ virCPUDataNew(virArch arch) { virCPUDataPtr data; =20 - if (VIR_ALLOC(data) < 0) - return NULL; - + data =3D g_new0(virCPUData, 1); data->arch =3D arch; =20 return data; diff --git a/src/cpu/cpu_ppc64.c b/src/cpu/cpu_ppc64.c index c0d09db696..ca2cfa0a67 100644 --- a/src/cpu/cpu_ppc64.c +++ b/src/cpu/cpu_ppc64.c @@ -189,9 +189,7 @@ ppc64ModelCopy(const virCPUppc64Model *model) { g_autoptr(virCPUppc64Model) copy =3D NULL; =20 - if (VIR_ALLOC(copy) < 0) - return NULL; - + copy =3D g_new0(virCPUppc64Model, 1); copy->name =3D g_strdup(model->name); =20 if (ppc64DataCopy(©->data, &model->data) < 0) @@ -283,9 +281,7 @@ ppc64VendorParse(xmlXPathContextPtr ctxt G_GNUC_UNUSED, virCPUppc64MapPtr map =3D data; g_autoptr(virCPUppc64Vendor) vendor =3D NULL; =20 - if (VIR_ALLOC(vendor) < 0) - return -1; - + vendor =3D g_new0(virCPUppc64Vendor, 1); vendor->name =3D g_strdup(name); =20 if (ppc64VendorFind(map, vendor->name)) { @@ -314,9 +310,7 @@ ppc64ModelParse(xmlXPathContextPtr ctxt, size_t i; int n; =20 - if (VIR_ALLOC(model) < 0) - return -1; - + model =3D g_new0(virCPUppc64Model, 1); model->name =3D g_strdup(name); =20 if (ppc64ModelFind(map, model->name)) { @@ -386,8 +380,7 @@ ppc64LoadMap(void) { g_autoptr(virCPUppc64Map) map =3D NULL; =20 - if (VIR_ALLOC(map) < 0) - return NULL; + map =3D g_new0(virCPUppc64Map, 1); =20 if (cpuMapLoad("ppc64", ppc64VendorParse, NULL, ppc64ModelParse, map) = < 0) return NULL; @@ -401,9 +394,7 @@ ppc64MakeCPUData(virArch arch, { g_autoptr(virCPUData) cpuData =3D NULL; =20 - if (VIR_ALLOC(cpuData) < 0) - return NULL; - + cpuData =3D g_new0(virCPUData, 1); cpuData->arch =3D arch; =20 if (ppc64DataCopy(&cpuData->data.ppc64, data) < 0) --=20 2.26.2 From nobody Tue Apr 16 15:32:23 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 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=1599830647; cv=none; d=zohomail.com; s=zohoarc; b=MCqV8SYaV+9BuC/+eJ/+s/Rrd0NrE80w2Vin1jHw+b7MeK2hXv5wJeN9eP8NZ2XKwnPgRfEcHI2Mzt4jC/FGfiizeJabpHvsGLoAsg6XWsjRX/03525YC9BXfrGdmqhefkANGYc4lEZUWB9QyhG/EMj3Se3inISxEPFQ8HIIfzY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599830647; h=Content-Type:Content-Transfer-Encoding:Cc: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=zuGtsAW/xKEW7+FyOOGgZpHZjs3B7TC3kDnLItwB46s=; b=i819UGd+DSDmUJOGtG3QLhtbfAf7zqHvnK5GBw7S2r5IOjrOWxW3uSBf7vNhYTZ+c4n+dfOfO+jqY8LuiLjvv+RpGweIhiIT1j93e2cX/HRG+yDeory0ERnCgkNQjfBsmVi4UYSmsapV81bl1AerZWChDUrPUv+9j+B5oUPVp5A= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 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-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1599830647035333.1886652210509; Fri, 11 Sep 2020 06:24:07 -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-514-9axTAJpvOXSxqxaSrkSiSQ-1; Fri, 11 Sep 2020 09:23:16 -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 343E21008565; Fri, 11 Sep 2020 13:23: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 148887838A; Fri, 11 Sep 2020 13:23:11 +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 D7024181A89E; Fri, 11 Sep 2020 13:23:10 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08BDN8ru025422 for ; Fri, 11 Sep 2020 09:23:09 -0400 Received: by smtp.corp.redhat.com (Postfix) id EEE5760C47; Fri, 11 Sep 2020 13:23:08 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-112-163.ams2.redhat.com [10.36.112.163]) by smtp.corp.redhat.com (Postfix) with ESMTP id EAB9A60C04; Fri, 11 Sep 2020 13:23:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599830645; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=zuGtsAW/xKEW7+FyOOGgZpHZjs3B7TC3kDnLItwB46s=; b=IsEP851JOrLKfLvdFQ7WXAdp1WU6vTBjV5Nm54xe3PS/e2TAU80FZAAJFf+SDexKl+3OJr CU2riM0pjDR24HD20LDQ7gFkIm8y+K21e8BL5B4Rb0culUleobid/Xh1fjq9ME/ZqbF8eX lpwG63xs30M5Y7O2BlBiyzfFLJn5BRU= X-MC-Unique: 9axTAJpvOXSxqxaSrkSiSQ-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH v3 7/8] cpu: Replace VIR_ALLOC_N with g_new0 Date: Fri, 11 Sep 2020 15:22:48 +0200 Message-Id: <20200911132249.514503-8-twiederh@redhat.com> In-Reply-To: <20200911132249.514503-1-twiederh@redhat.com> References: <20200911132249.514503-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Cc: =?UTF-8?q?J=C3=A1n=20Tomko?= , Tim Wiederhake 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 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Signed-off-by: Tim Wiederhake Reviewed-by: J=C3=A1n Tomko --- src/cpu/cpu_ppc64.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/cpu/cpu_ppc64.c b/src/cpu/cpu_ppc64.c index ca2cfa0a67..6477b4bce7 100644 --- a/src/cpu/cpu_ppc64.c +++ b/src/cpu/cpu_ppc64.c @@ -134,9 +134,7 @@ ppc64DataCopy(virCPUppc64Data *dst, const virCPUppc64Da= ta *src) { size_t i; =20 - if (VIR_ALLOC_N(dst->pvr, src->len) < 0) - return -1; - + dst->pvr =3D g_new0(virCPUppc64PVR, src->len); dst->len =3D src->len; =20 for (i =3D 0; i < src->len; i++) { @@ -343,9 +341,7 @@ ppc64ModelParse(xmlXPathContextPtr ctxt, return -1; } =20 - if (VIR_ALLOC_N(model->data.pvr, n) < 0) - return -1; - + model->data.pvr =3D g_new0(virCPUppc64PVR, n); model->data.len =3D n; =20 for (i =3D 0; i < n; i++) { @@ -603,10 +599,7 @@ virCPUppc64GetHost(virCPUDefPtr cpu, return -1; =20 data =3D &cpuData->data.ppc64; - - if (VIR_ALLOC_N(data->pvr, 1) < 0) - return -1; - + data->pvr =3D g_new0(virCPUppc64PVR, 1); data->len =3D 1; =20 #if defined(__powerpc__) || defined(__powerpc64__) @@ -732,8 +725,7 @@ virCPUppc64DriverGetModels(char ***models) return -1; =20 if (models) { - if (VIR_ALLOC_N(*models, map->nmodels + 1) < 0) - return -1; + *models =3D g_new0(char*, map->nmodels + 1); =20 for (i =3D 0; i < map->nmodels; i++) (*models)[i] =3D g_strdup(map->models[i]->name); --=20 2.26.2 From nobody Tue Apr 16 15:32:23 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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=1599830605; cv=none; d=zohomail.com; s=zohoarc; b=imVp502At7W8tqSrpgZ3lwZuObVbzX3ECHkCdRhtj1DvnMtYHCOaLiEpLadWoN+spFg5xOOIBOBQ7Vnu2gQvoWkaL7C8/rOdaNVDT3If+ONsA6XzPH1W7eSy+ACfsiupJUDsaxKqzl0CPc4qwio+RDTdDgka49v9rWfoTmNfO+c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599830605; h=Content-Type:Content-Transfer-Encoding:Cc: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=o/X+dcRn+hp/ZIgG68WVz+SFm6Yv/zocaSFt6ysFnF4=; b=iKP2Bp/mlm75ymm7Pkgv3umKeMcKqHM/EyYK2DvDleR6PWQ58KZ7kbzgIhtfLXEzX7wFawcSMPwMrJCpvP4pmp4TpxqOJ6fXWgNNYrZ0Ou2O2wQqGZSN0aforquB+Xt/Hsw539MPFiENHIqXBeAZzn+2kTLT70ABsyJ8J+mv5ns= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1599830605271386.70322613034966; Fri, 11 Sep 2020 06:23: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-56-B3Wb6dDPNO6nDDJP_i0FpA-1; Fri, 11 Sep 2020 09:23:21 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8C2CA8D0303; Fri, 11 Sep 2020 13:23:15 +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 6D8AF5C1BD; Fri, 11 Sep 2020 13:23: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 3ACE71832FB6; Fri, 11 Sep 2020 13:23:15 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08BDNDZr025440 for ; Fri, 11 Sep 2020 09:23:13 -0400 Received: by smtp.corp.redhat.com (Postfix) id 5E2E560C87; Fri, 11 Sep 2020 13:23:13 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-112-163.ams2.redhat.com [10.36.112.163]) by smtp.corp.redhat.com (Postfix) with ESMTP id 55A1B60C11; Fri, 11 Sep 2020 13:23:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599830604; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=o/X+dcRn+hp/ZIgG68WVz+SFm6Yv/zocaSFt6ysFnF4=; b=DsN3BqaC7PsRl2VuPCKsC5+QO3HTX9EAB6p9yHgXXZh+SEO/dLm5cK8T3k8WtyO5ZjWNBm bH77Utbw2HYAmuCxVvVxjRXnZB6CJ5Awi/DSnV/b7/CPFFpSJTpAZD6RgVdxrF14VC5Qxe lvGYo0005356DY7Jldp0yy//JOhdvyI= X-MC-Unique: B3Wb6dDPNO6nDDJP_i0FpA-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH v3 8/8] cpu: Replace VIR_FREE with g_free Date: Fri, 11 Sep 2020 15:22:49 +0200 Message-Id: <20200911132249.514503-9-twiederh@redhat.com> In-Reply-To: <20200911132249.514503-1-twiederh@redhat.com> References: <20200911132249.514503-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Cc: =?UTF-8?q?J=C3=A1n=20Tomko?= , Tim Wiederhake 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.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Note the use of g_clear_pointer(..., g_free) in ppc64DataClear and virCPUx8= 6Baseline. Signed-off-by: Tim Wiederhake Reviewed-by: J=C3=A1n Tomko --- src/cpu/cpu.c | 2 +- src/cpu/cpu_ppc64.c | 18 +++++++++--------- src/cpu/cpu_x86.c | 8 ++++---- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/cpu/cpu.c b/src/cpu/cpu.c index c3eef52c79..188c5d86b5 100644 --- a/src/cpu/cpu.c +++ b/src/cpu/cpu.c @@ -315,7 +315,7 @@ virCPUDataFree(virCPUDataPtr data) if ((driver =3D cpuGetSubDriver(data->arch)) && driver->dataFree) driver->dataFree(data); else - VIR_FREE(data); + g_free(data); } =20 =20 diff --git a/src/cpu/cpu_ppc64.c b/src/cpu/cpu_ppc64.c index 6477b4bce7..2fedcd25da 100644 --- a/src/cpu/cpu_ppc64.c +++ b/src/cpu/cpu_ppc64.c @@ -126,7 +126,7 @@ ppc64DataClear(virCPUppc64Data *data) if (!data) return; =20 - VIR_FREE(data->pvr); + g_clear_pointer(&data->pvr, g_free); } =20 static int @@ -151,8 +151,8 @@ ppc64VendorFree(virCPUppc64VendorPtr vendor) if (!vendor) return; =20 - VIR_FREE(vendor->name); - VIR_FREE(vendor); + g_free(vendor->name); + g_free(vendor); } G_DEFINE_AUTOPTR_CLEANUP_FUNC(virCPUppc64Vendor, ppc64VendorFree); =20 @@ -177,8 +177,8 @@ ppc64ModelFree(virCPUppc64ModelPtr model) return; =20 ppc64DataClear(&model->data); - VIR_FREE(model->name); - VIR_FREE(model); + g_free(model->name); + g_free(model); } G_DEFINE_AUTOPTR_CLEANUP_FUNC(virCPUppc64Model, ppc64ModelFree); =20 @@ -261,13 +261,13 @@ ppc64MapFree(virCPUppc64MapPtr map) =20 for (i =3D 0; i < map->nmodels; i++) ppc64ModelFree(map->models[i]); - VIR_FREE(map->models); + g_free(map->models); =20 for (i =3D 0; i < map->nvendors; i++) ppc64VendorFree(map->vendors[i]); - VIR_FREE(map->vendors); + g_free(map->vendors); =20 - VIR_FREE(map); + g_free(map); } G_DEFINE_AUTOPTR_CLEANUP_FUNC(virCPUppc64Map, ppc64MapFree); =20 @@ -584,7 +584,7 @@ virCPUppc64DataFree(virCPUDataPtr data) return; =20 ppc64DataClear(&data->data.ppc64); - VIR_FREE(data); + g_free(data); } =20 =20 diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index db1b2e55a1..0e533c62e1 100644 --- a/src/cpu/cpu_x86.c +++ b/src/cpu/cpu_x86.c @@ -493,7 +493,7 @@ virCPUx86DataFree(virCPUDataPtr data) return; =20 virCPUx86DataClear(&data->data.x86); - VIR_FREE(data); + g_free(data); } =20 =20 @@ -2207,7 +2207,7 @@ x86Decode(virCPUDefPtr cpu, if (x86FeatureIsMigratable(cpuModel->features[i].name, map)) { i++; } else { - VIR_FREE(cpuModel->features[i].name); + g_free(cpuModel->features[i].name); VIR_DELETE_ELEMENT_INPLACE(cpuModel->features, i, cpuModel->nfeatures); } @@ -2892,7 +2892,7 @@ virCPUx86Baseline(virCPUDefPtr *cpus, cpu->fallback =3D VIR_CPU_FALLBACK_FORBID; =20 if (!outputVendor) - VIR_FREE(cpu->vendor); + g_clear_pointer(&cpu->vendor, g_free); =20 return g_steal_pointer(&cpu); } @@ -2914,7 +2914,7 @@ x86UpdateHostModel(virCPUDefPtr guest, return -1; =20 if (guest->vendor_id) { - VIR_FREE(updated->vendor_id); + g_free(updated->vendor_id); updated->vendor_id =3D g_strdup(guest->vendor_id); } =20 --=20 2.26.2