From nobody Fri Mar 29 14:14:40 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=1599810797; cv=none; d=zohomail.com; s=zohoarc; b=WK2v6ktnDdvpHGPZRvs+XHUvuGVW82hG1yNJZQjbIwli0O4HyXd8++ABjDUuGbJepwe+C9wGV42tW61EVQ/ZvGS4NrYcjcMg85DMGajtp39bUYHIKITeQancuAZitKV5Ug22vZ6CvHt4EGD+KmE0oQvbI9exfjRjMC503cLpcok= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599810797; 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=MK3zZI8I6iXSsmQd9fLh+8F3f+DIk5lx1JENTw7Si4Q=; b=MDw+J5mUSZpRbzmA8U8Kmp/4SNrTHucKLZX08gTNHXm0zDgj+woTNg2Tu3V/HSojV0GkT8dGesEsYhJ/Uz5RSWBEGXEisAHjQYt6n+PZbH0uqP5LhdkfbXeoMGgkM+QMf5Oh4+JmoBizzSHDpAYEp8DrB4FvODa4dt6XIfRFs2w= 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 1599810797347609.0798040902703; Fri, 11 Sep 2020 00:53: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-75-s6pYCS8fO6KpBKnA_NfPKA-1; Fri, 11 Sep 2020 03:53:13 -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 A6E31807100; Fri, 11 Sep 2020 07:53:07 +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 36F3910013BD; Fri, 11 Sep 2020 07:53:07 +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 5E34A181A06B; Fri, 11 Sep 2020 07:53:04 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08B7r3Dg013450 for ; Fri, 11 Sep 2020 03:53:03 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2774B27CD3; Fri, 11 Sep 2020 07:53:03 +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 64A1927CCD; Fri, 11 Sep 2020 07:53:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599810796; 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=MK3zZI8I6iXSsmQd9fLh+8F3f+DIk5lx1JENTw7Si4Q=; b=TC1skdL/d6G8810Xsa3K5kIVhDlArcAW2rT4ijZgo5oPyzfpgZSvhJ9gESRAUqOGsISLxN qtjpGfbLYhUFDimiQGmk8vqzzRZaszlV6Ntm4weP3Q0UZ7hGWxDfrxOxRxFGZDXEIutG5P JUiGB9TW/nfjh0xY2vqWp2bZU8Nbavo= X-MC-Unique: s6pYCS8fO6KpBKnA_NfPKA-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH v2 1/8] cpu_ppc64: Use g_auto* in ppc64MakeCPUData Date: Fri, 11 Sep 2020 09:52:48 +0200 Message-Id: <20200911075255.305089-2-twiederh@redhat.com> In-Reply-To: <20200911075255.305089-1-twiederh@redhat.com> References: <20200911075255.305089-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 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.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.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: 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 Fri Mar 29 14:14:40 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=1599810795; cv=none; d=zohomail.com; s=zohoarc; b=CFl9G7+kzN44ShukUZaUwgp5YGV8n7hwS8tIcWAYwdfPOtdO9E0XDzBGH5c49Y0A3OgU51JOnsLdz+xnNre9HnuaagMblaE7tcwOXJuCr8bE6JITpAUtMgnyNfKxRAh2q5EcLTbBwH9jCcv6NxzI6wn3n6zolVzJMzK+creg45I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599810795; 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=yEd/IgwS8ZuiaMJUWtIRUdvgXv+q5Ha6qLV3Sk4rKG4=; b=jW0JBciUj9p63jX5zWjlKZxSpRmP0ushNWj0JyVhGri4s/wsZ4fTAEY7fLvyjPcOL7WOgAqcQtLNYxFar6kZX3mFrxU6eQqToF9cFyQlTHKWxBCk2iE+/s8QJsS5I0i2FTpI4hN/vCAjspUanbchOgCP8VB4Vawj7MdtdUMQWc0= 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 1599810795678216.93072676511542; Fri, 11 Sep 2020 00:53:15 -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-124-INFAnUy4MLeH9LVBUET_lw-1; Fri, 11 Sep 2020 03:53:12 -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 C803C81CBDF; Fri, 11 Sep 2020 07:53:07 +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 9E2401002D40; Fri, 11 Sep 2020 07:53:07 +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 CF019181A050; Fri, 11 Sep 2020 07:53:06 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08B7r4L5013461 for ; Fri, 11 Sep 2020 03:53:04 -0400 Received: by smtp.corp.redhat.com (Postfix) id 41ECC27CCD; Fri, 11 Sep 2020 07:53:04 +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 7DAFB27CD6; Fri, 11 Sep 2020 07:53:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599810794; 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=yEd/IgwS8ZuiaMJUWtIRUdvgXv+q5Ha6qLV3Sk4rKG4=; b=E+4/Naezylq6In7C5kWcqWYcZQhBP4a5TCuANmK0RpzbJQ+VbvU+h1jPG5GvkdVEN44FbT mXp0+DwijuM6477pY/PYzsR2g1mvBvr0xKS5bRYfrXDbYiKbsDY4eRX7TadWSZ916tV57d fFh6atJfAs0rinHt3Q0NeMg7HpGrxH8= X-MC-Unique: INFAnUy4MLeH9LVBUET_lw-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH v2 2/8] cpu_map: Use g_auto* in loadData Date: Fri, 11 Sep 2020 09:52:49 +0200 Message-Id: <20200911075255.305089-3-twiederh@redhat.com> In-Reply-To: <20200911075255.305089-1-twiederh@redhat.com> References: <20200911075255.305089-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 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.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.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 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 Fri Mar 29 14:14:40 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=1599810811; cv=none; d=zohomail.com; s=zohoarc; b=XZFpCCQ4g6kBFOFoDxXRv7oPDewqE3ElukHN2DNJTcORwA/Jro956O8CUtmNMjJ3uaKo9DpX8jfj9dSHbcRrtBxy+lJvuw6Z6M5VNJUcSejLLNLcQNr8CKjB27yEPlS26+mwpi5lZhzsqPsOpG1bo4QIEeszDlsTF6nXMV+vCjk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599810811; 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=25LknnB9fJvBzd5/BMb1xEb1xQHdTBlUZW/eaFRXNBM=; b=S6km1066949waxPh2yYFPCG+tLvqFqfABUV3P6J4P928kjUVspzvpK1K7APPI1AEvvFze+I7biv8PvsUcepycFR24vemzZ7hhRwNsPInAz3k3hw13zR9uoF1xUTHmMRzo2f8l08PFos4GHoIq/irxfQfh7wPLSHdCgMd8pIaTIY= 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 1599810811028875.1690971190951; Fri, 11 Sep 2020 00:53:31 -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-552-g6fVUqxiNeqa4TiKkopOaA-1; Fri, 11 Sep 2020 03:53:27 -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 EE660EA1CD; Fri, 11 Sep 2020 07:53:22 +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 D01BA9CBA; Fri, 11 Sep 2020 07:53:22 +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 9AAD792307; Fri, 11 Sep 2020 07:53:22 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08B7r5SO013470 for ; Fri, 11 Sep 2020 03:53:05 -0400 Received: by smtp.corp.redhat.com (Postfix) id 60CDF27CDA; Fri, 11 Sep 2020 07:53:05 +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 9C4EA27CCD; Fri, 11 Sep 2020 07:53:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599810809; 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=25LknnB9fJvBzd5/BMb1xEb1xQHdTBlUZW/eaFRXNBM=; b=SMqSm/ZoIUZ/rzeviOWpW5FUbaG5NYMT6G5TbTgJMdEvy1zE57QgypdKuNCrw1cSCrSEhN ugM5vW/kgP+gQaix0YOy7G3TcfcVVWdbPg/8iZvLLJjkwOWOzv7a1KjNtvBTc/z6HbZpqS 0qeytuFABlAe7EveFJWrIpiIP0ladNs= X-MC-Unique: g6fVUqxiNeqa4TiKkopOaA-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH v2 3/8] cpu_map: Use g_auto* in loadIncludes Date: Fri, 11 Sep 2020 09:52:50 +0200 Message-Id: <20200911075255.305089-4-twiederh@redhat.com> In-Reply-To: <20200911075255.305089-1-twiederh@redhat.com> References: <20200911075255.305089-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 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.11 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 Reviewed-by: J=C3=A1n Tomko --- src/cpu/cpu_map.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/cpu/cpu_map.c b/src/cpu/cpu_map.c index 53c8cbba6b..ac98a14e2e 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"); - if (!filename) { + g_autofree char *filename =3D NULL; + + if (!(filename =3D virXMLPropString(nodes[i], "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 Fri Mar 29 14:14:40 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=1599810811; cv=none; d=zohomail.com; s=zohoarc; b=DvI8HE2llXBr0JifNgE4I6BYdJ6VQVic4rJKWeqMSGQntTUy7GUaAoYO99dOlmdtwNRaKL05aPYL+gMGhjgrnxc00wghNkDgGY/aCrAVsRtXvv9HiLdVzKLZbsaGcItSP1sy3XxRVaXVkJIzZCOmjVlhD3trLENI5mtAxXrINMc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599810811; 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=Igv1r64D5sFgTB6ysEY4VGkZkbniA0UHZ8oZi4wdI54=; b=YqzoQb8j5tcx6ouhGRaKwG2QRlq0FOAWOhnVS3HtHk2wr03ltgTve4nV0vUxUbCJ34HcjmgCUzLktDq5Ld5UdM8IesvvE2uRR/mQs9b3z1tjloGs2WsfCAiMHldEVQdr9n4BPff5u/K9tabaqfyb5UvXoFBWd0nwfv4r7GOW3E4= 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 1599810811559825.9405632394687; Fri, 11 Sep 2020 00:53:31 -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-463-jI74Pf4PNzWXx08VLzhJ6A-1; Fri, 11 Sep 2020 03:53:27 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3C1B0EA1CB; Fri, 11 Sep 2020 07:53:22 +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 1881B75129; Fri, 11 Sep 2020 07:53:22 +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 D2E7F181A07D; Fri, 11 Sep 2020 07:53:21 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08B7r6aN013481 for ; Fri, 11 Sep 2020 03:53:06 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7E21127CD3; Fri, 11 Sep 2020 07:53: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 B845327CCD; Fri, 11 Sep 2020 07:53:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599810810; 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=Igv1r64D5sFgTB6ysEY4VGkZkbniA0UHZ8oZi4wdI54=; b=N242O+NihkFkCXqEl5IK1Cw8QJJ2hxJk4zkyYUFXjPIXyzlQnDcAA6GD05JTr8zD4xfpTG Kuv2wpVVg303tu7pxNZk07eWBlI03tENVDBVRwrSqx3JjbZS8WPNpqMy8O8m/oD6dLp5mX FoJP9jjQ30u765xHnHcjfQcD6SH6zy0= X-MC-Unique: jI74Pf4PNzWXx08VLzhJ6A-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH v2 4/8] cpu_x86: Use g_auto* in virX86CpuIncompatible Date: Fri, 11 Sep 2020 09:52:51 +0200 Message-Id: <20200911075255.305089-5-twiederh@redhat.com> In-Reply-To: <20200911075255.305089-1-twiederh@redhat.com> References: <20200911075255.305089-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 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.15 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 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 Fri Mar 29 14:14:40 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=1599810843; cv=none; d=zohomail.com; s=zohoarc; b=i64XLTQbWSaYNMSv7uJviIMqcdVa4kTjP/Tw9bSij5JicGgwBHaxpvzTX2sESNPqgM4ITQH5Q3AkDSgkqhm+DVzSP+agZNbYYaxaHiLtPjNww+uGDqvUcNfR74HdrAoNlVK5Q06fv2Q9R5JceLI3vEkPVt7yjpaibfb81nZoLAI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599810843; 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=ceV/tTdbn0JBqZeIwZEWjUQ7dETWznWZMzj7jTjH0rg=; b=ZXI0rg57XR/5ayg8tFx/JkZ/R15FpJrL34qRCtfFcCwsU18xbASEWmvAaKxbqwg8uibRb+PPn4Pb2XJkzYeUvbMEcWbO0hReEAzxusAWfrtiNUR12O/VC7cEKhqgx8dAloKfdnWFFrnnzFky+wJkRyAPEMpTlnD1OR9PTsdrMhM= 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 1599810843312986.3295542757445; Fri, 11 Sep 2020 00:54:03 -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-552-uMOXQaLYNpKBLhKr1iMxIA-1; Fri, 11 Sep 2020 03:53:27 -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 E90DF873110; Fri, 11 Sep 2020 07:53:22 +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 C745F1002D66; Fri, 11 Sep 2020 07:53:22 +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 955B292304; Fri, 11 Sep 2020 07:53:22 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08B7r7X0013493 for ; Fri, 11 Sep 2020 03:53:07 -0400 Received: by smtp.corp.redhat.com (Postfix) id 9D04127CD3; Fri, 11 Sep 2020 07:53: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 D70B027CD6; Fri, 11 Sep 2020 07:53:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599810842; 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=ceV/tTdbn0JBqZeIwZEWjUQ7dETWznWZMzj7jTjH0rg=; b=BPTEYHQEcrFfXtvnI5MEieudNI0LsMLETP3dR6o1TqP3RXKo5D4OR40YYovW/Vu50lCpy/ uChCnhZkMcJEBnzlcMLz4yuLdMxHGfiPyosUydqhwIPv6GY7n0W3gowjIXGtoukLqnmZCK Q8/I+5uN17mPiinZVDsCHD94oiK3SMc= X-MC-Unique: uMOXQaLYNpKBLhKr1iMxIA-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH v2 5/8] cpu_map: Remove unnecessary variable in loadData Date: Fri, 11 Sep 2020 09:52:52 +0200 Message-Id: <20200911075255.305089-6-twiederh@redhat.com> In-Reply-To: <20200911075255.305089-1-twiederh@redhat.com> References: <20200911075255.305089-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 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.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.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: 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 ac98a14e2e..3fa03e707c 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 Fri Mar 29 14:14:40 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=1599810818; cv=none; d=zohomail.com; s=zohoarc; b=HdOHdXINB2+rdDwTrWxPittBfVYkq01dTcLWdPAh1iZdJqnXZSatrlF7jZrE7v8IPFQL/X/G+COY8YR27PZYoU+OSysWO8PnJd4YG3+1T/02/59n9Zn4rPMzJgZylDXmSLbDyQVe1WqmPM0XsZAZC50H28HLd0sKrh7JAMyvdR4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599810818; 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=hvrrfwbV2iLOyqyRzCFnEJmIf2BTGLV0zZ3jHFc82cc=; b=T7dDKpmuPZnuEVmgRTTErGiYCdPnVo6bgeXZu/bMBb4bdoV8yf7NQ7OO27+hFmr8iBtavdfPxYYXL4yUPnTGqZAmeYhh1cXrBP4yfuT2B9I+dOZloLUhEHltEZLAMgVWnhqduJ0RTk6cCABaPVIDX0DzeB804ZZFvoAQOoicWTU= 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 1599810818705883.3484658112723; Fri, 11 Sep 2020 00:53:38 -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-132-2H3juZX6M8qRim5FLCct6Q-1; Fri, 11 Sep 2020 03:53:35 -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 52C851019641; Fri, 11 Sep 2020 07:53:25 +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 31ED260BFA; Fri, 11 Sep 2020 07:53:25 +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 0170D9230A; Fri, 11 Sep 2020 07:53:24 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08B7r8Fv013501 for ; Fri, 11 Sep 2020 03:53:08 -0400 Received: by smtp.corp.redhat.com (Postfix) id BB13927CDA; Fri, 11 Sep 2020 07:53: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 0332D27CCD; Fri, 11 Sep 2020 07:53:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599810817; 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=hvrrfwbV2iLOyqyRzCFnEJmIf2BTGLV0zZ3jHFc82cc=; b=CEgbHAXPgjVXEIPoJSgVKUz5KvfgjuEQW8pX3OgJvuUj60Q6ljma10Fwm/0U0qzPJLI7Lq g8lqTfiethgMCBJbt2CNJboMLGmO9ZV9RCfzSCH1+TWNz5MAS7JWLWKli8q8mGEmVVF9ze EEoBc5kDbBi7HWGD2AHhyOte3DSA5as= X-MC-Unique: 2H3juZX6M8qRim5FLCct6Q-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH v2 6/8] cpu: Replace VIR_ALLOC with g_new0 Date: Fri, 11 Sep 2020 09:52:53 +0200 Message-Id: <20200911075255.305089-7-twiederh@redhat.com> In-Reply-To: <20200911075255.305089-1-twiederh@redhat.com> References: <20200911075255.305089-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 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.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0.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: 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 Fri Mar 29 14:14:40 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=1599810816; cv=none; d=zohomail.com; s=zohoarc; b=ExWOE4OR8ILYDJWn4kEoRLtiK9w8hOIvg6ODu3frxPpcKeG/s4s4i2UdKo/t52fO04HbCg5A/qiEaYTAbRs8ttYinO56kk/TaSH+3wS5/6q08YM+8dzb/bufCGvrGwunpZhO7gAnb2Xg81o5LgWYmMr1OSrQoush9z4r14ojW3g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599810816; 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=TtBkW6EmHoCI0gvPNRVtdC85XMTyvpjoLmq2uA1UK/6O/jtpyYbnUmEfFPfQ1asUCnU1gVeRsF594giDBw+kNNPnr8Lnvt2NTUMLIhDwhRqjoMKr7lkltd82+H8u8DIOaa7rE5ByBAligm9c5lndH1l6gOQmCSfiJIv3c4ckTzk= 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 1599810816176445.7090342049564; Fri, 11 Sep 2020 00:53:36 -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-30-Sx19oyRJOEOao3OSPFlYFg-1; Fri, 11 Sep 2020 03:53:32 -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 A296118BFED4; Fri, 11 Sep 2020 07:53:27 +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 849305C1BD; Fri, 11 Sep 2020 07:53:27 +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 52D3E9230D; Fri, 11 Sep 2020 07:53:27 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08B7rAm6013510 for ; Fri, 11 Sep 2020 03:53:10 -0400 Received: by smtp.corp.redhat.com (Postfix) id 0D36C27CD9; Fri, 11 Sep 2020 07:53:10 +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 214CA27CCD; Fri, 11 Sep 2020 07:53:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599810814; 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=OrZ/Z3WkzUpZtuzsBpcaH6gLtYptPqhsMD6nYNl84HT66ihRjrctapwqsyo79UC3F7c1Tz QI9uPf1nldr29RpLS7BkB3y1WSZhfO5SF0h5EhybjdZmPLmkHbkUNE6tJDKTbKcMWK4UQm 6JFyY+HQsPLBHYFCNWBQeQDq3m6NtQI= X-MC-Unique: Sx19oyRJOEOao3OSPFlYFg-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH v2 7/8] cpu: Replace VIR_ALLOC_N with g_new0 Date: Fri, 11 Sep 2020 09:52:54 +0200 Message-Id: <20200911075255.305089-8-twiederh@redhat.com> In-Reply-To: <20200911075255.305089-1-twiederh@redhat.com> References: <20200911075255.305089-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 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) 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 Fri Mar 29 14:14:40 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=1599810818; cv=none; d=zohomail.com; s=zohoarc; b=GetIWjPPFAlcHH8PrvnZOCh6aDhyG+seSOKK1U5d+/0E8z1u3GdCCcYTxqNMItZbOHH3ba6EjQtOYaCt3k+hRZKV6iSa7SgAIZypyIISSnXXTjiWm9TaIZwd67+cqV3/TALl7p2fugmaEkd5ZfxSf1jq5CP1YiJKQ482qhQullI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599810818; 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=zB88LNfgGt7P0LL4swtCZeWwWHgteNEwzHyUeVvSmn0=; b=JK8gxo0g8wzhTxxT0VaD1xU8SLCAGSlN3Uja8bJxuB25I8T/7aA25UCjvIDMzHs2DJxMzOgvNzKlGPO9rS4lwuffEjiTSzWqJMbDjMVn4B3ywz92D/w1hF4sL/Gf5vHmbiJfhKPIF5UHRz2BzcnJuDmAl5Ae5gLzJTfI6QNaKY4= 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 1599810818137189.7574726948567; Fri, 11 Sep 2020 00:53:38 -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-112-I2XMUjsBOnGK-Tfz00vt8Q-1; Fri, 11 Sep 2020 03:53:34 -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 EF4DA10BBED9; Fri, 11 Sep 2020 07:53:29 +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 D43535C1BD; Fri, 11 Sep 2020 07:53:29 +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 A08D1181A271; Fri, 11 Sep 2020 07:53:29 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08B7rBB3013528 for ; Fri, 11 Sep 2020 03:53:11 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2920C27CDA; Fri, 11 Sep 2020 07:53:11 +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 65DA827CCD; Fri, 11 Sep 2020 07:53:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599810816; 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=zB88LNfgGt7P0LL4swtCZeWwWHgteNEwzHyUeVvSmn0=; b=ZXd+5vya6ggqZNI0ZUkaugSzEQTBHFSDCXLx7DRmwxx2toc4RM8iAW3DaS92S8FeXikNgr KzykHHiN32eqAE/mgIQdvc0yc5BHOUNO722WBHdtokYS3YZkqvkg0nIY7dE4CbFEiNngKM TD3S+1zMe7xApgMwEnepmdTb3vdqmeo= X-MC-Unique: I2XMUjsBOnGK-Tfz00vt8Q-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH v2 8/8] cpu: Replace VIR_FREE with g_free Date: Fri, 11 Sep 2020 09:52:55 +0200 Message-Id: <20200911075255.305089-9-twiederh@redhat.com> In-Reply-To: <20200911075255.305089-1-twiederh@redhat.com> References: <20200911075255.305089-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 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.16 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" 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