From nobody Sun Feb 8 13:27:54 2026 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=1613107750; cv=none; d=zohomail.com; s=zohoarc; b=IK+EI2wkKilYHvVKslTyTVw4ESYFZRXeUhlKSnHN0rSjiueaFcByl1RZMR5Af05myk9PkhW9IbeM4eRyrvqYOEHhBOricp9qF+pPbTzWvZrGvidkVxweWhM9FzcSRY7AGQvHSj73rFyv5vBywTRHuGedriSc7IfdC8oBxCSukHI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1613107750; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=v0ne7EYgnfqQlly/M8M5bEG/kxqXemeZOB00AS3PdXw=; b=L0lMXoyKQqsPMAjHZ5YauOmTMjk4zr3AYkzQgAAmC8Xxld8C+06gcvsjWO2aZgg2/sAqYvQQSU16OO5IWcd/KLkcEqGCjxDEDJeWDi1BmhHr7ht9Mvc8mjX5aSTCX2WOshSN1QBL+cdek78UcrQqduo+icuZHf+MpP8cFqUe+vc= 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 161310775014818.734443471404575; Thu, 11 Feb 2021 21:29:10 -0800 (PST) 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-521-WmnpI2l0O2WuHCLOuzb_Dw-1; Fri, 12 Feb 2021 00:29:02 -0500 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 0C202107ACED; Fri, 12 Feb 2021 05:28:53 +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 DC92D60C64; Fri, 12 Feb 2021 05:28:52 +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 A5CF957DFD; Fri, 12 Feb 2021 05:28:52 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 11C5SOW4017137 for ; Fri, 12 Feb 2021 00:28:24 -0500 Received: by smtp.corp.redhat.com (Postfix) id BCB3310016F6; Fri, 12 Feb 2021 05:28:24 +0000 (UTC) Received: from vhost2.router.laine.org (ovpn-112-48.phx2.redhat.com [10.3.112.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id 84F4C10013D7 for ; Fri, 12 Feb 2021 05:28:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1613107749; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=v0ne7EYgnfqQlly/M8M5bEG/kxqXemeZOB00AS3PdXw=; b=EiFrONMqkmMojMwbam7kB8uAmfBARWInfIdZ/unH7AnmJyLVC5S67CJnHkjcadSxA6vOKD +PRILl1poqI5dMQNvTOb5/3ClA2A4Q0kVMhlw6UHvlxHoCgt/L5/BM7RrW+ot8MGN/REu7 Cpj2OlDyVcHNSK+ihHYLkzEzXXBj/8s= X-MC-Unique: WmnpI2l0O2WuHCLOuzb_Dw-1 From: Laine Stump To: libvir-list@redhat.com Subject: [libvirt PATCH 2/8] conf: convert VIR_FREE to g_free in other functions that free their arg Date: Fri, 12 Feb 2021 00:28:12 -0500 Message-Id: <20210212052818.684878-3-laine@redhat.com> In-Reply-To: <20210212052818.684878-1-laine@redhat.com> References: <20210212052818.684878-1-laine@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Previous patches have converted VIR_FREE to g_free in functions with names ending in Free() and Dispose(), but there are a few similar functions with names that don't fit that pattern, but server the same purpose (and thus can survive the same conversion). in particular *Free*(), and *Unref(). Signed-off-by: Laine Stump --- src/conf/capabilities.c | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/conf/capabilities.c b/src/conf/capabilities.c index dd3321db9a..69d9bb0e38 100644 --- a/src/conf/capabilities.c +++ b/src/conf/capabilities.c @@ -118,10 +118,10 @@ virCapabilitiesFreeHostNUMACell(virCapsHostNUMACellPt= r cell) =20 virCapabilitiesClearHostNUMACellCPUTopology(cell->cpus, cell->ncpus); =20 - VIR_FREE(cell->cpus); - VIR_FREE(cell->siblings); - VIR_FREE(cell->pageinfo); - VIR_FREE(cell); + g_free(cell->cpus); + g_free(cell->siblings); + g_free(cell->pageinfo); + g_free(cell); } =20 static void @@ -129,9 +129,9 @@ virCapabilitiesFreeGuestMachine(virCapsGuestMachinePtr = machine) { if (machine =3D=3D NULL) return; - VIR_FREE(machine->name); - VIR_FREE(machine->canonical); - VIR_FREE(machine); + g_free(machine->name); + g_free(machine->canonical); + g_free(machine); } =20 static void @@ -141,13 +141,13 @@ virCapabilitiesFreeGuestDomain(virCapsGuestDomainPtr = dom) if (dom =3D=3D NULL) return; =20 - VIR_FREE(dom->info.emulator); - VIR_FREE(dom->info.loader); + g_free(dom->info.emulator); + g_free(dom->info.loader); for (i =3D 0; i < dom->info.nmachines; i++) virCapabilitiesFreeGuestMachine(dom->info.machines[i]); - VIR_FREE(dom->info.machines); + g_free(dom->info.machines); =20 - VIR_FREE(dom); + g_free(dom); } =20 void @@ -157,17 +157,17 @@ virCapabilitiesFreeGuest(virCapsGuestPtr guest) if (guest =3D=3D NULL) return; =20 - VIR_FREE(guest->arch.defaultInfo.emulator); - VIR_FREE(guest->arch.defaultInfo.loader); + g_free(guest->arch.defaultInfo.emulator); + g_free(guest->arch.defaultInfo.loader); for (i =3D 0; i < guest->arch.defaultInfo.nmachines; i++) virCapabilitiesFreeGuestMachine(guest->arch.defaultInfo.machines[i= ]); - VIR_FREE(guest->arch.defaultInfo.machines); + g_free(guest->arch.defaultInfo.machines); =20 for (i =3D 0; i < guest->arch.ndomains; i++) virCapabilitiesFreeGuestDomain(guest->arch.domains[i]); - VIR_FREE(guest->arch.domains); + g_free(guest->arch.domains); =20 - VIR_FREE(guest); + g_free(guest); } =20 =20 @@ -177,7 +177,7 @@ virCapabilitiesFreeStoragePool(virCapsStoragePoolPtr po= ol) if (!pool) return; =20 - VIR_FREE(pool); + g_free(pool); } =20 =20 @@ -190,7 +190,7 @@ virCapabilitiesHostNUMAUnref(virCapsHostNUMAPtr caps) if (g_atomic_int_dec_and_test(&caps->refs)) { g_ptr_array_unref(caps->cells); =20 - VIR_FREE(caps); + g_free(caps); } } =20 @@ -409,7 +409,7 @@ virCapabilitiesFreeMachines(virCapsGuestMachinePtr *mac= hines, virCapabilitiesFreeGuestMachine(machines[i]); machines[i] =3D NULL; } - VIR_FREE(machines); + g_free(machines); } =20 /** --=20 2.29.2