From nobody Tue Feb 10 21:38:25 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=1612411162; cv=none; d=zohomail.com; s=zohoarc; b=WTpNFnZE3+w0xmWJ2HROfnstOkswOnSav47OFuRIxOo6KYi02T6EuIwFP/uZjEKf4ZQdwdw/iH/31GiApezCUGASohQMn/+eIA97kM+CjR5cHXYRGlZ6z6YVZ2fZxRnDi1SVQvHnIXKP9jQtoExkNSrb7GdHemI4z131KZ4FV3w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1612411162; 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=dJLnjfwzmdDV+lDPcPqu1GLCafVTNgstv6DqV3VOb/w=; b=n/OVIRWeOww6ABQiaD45sE/WTDystO34r48GKRgnVYp1OUotc9bGKgUwDdPIBdA7rZxQoMJd6pIYnbK5ePLIifCvKuoI/Ud217h2gwnLOig9niSwCyXJl/7JS1fO0MO3NyR2NzOmAMUB5WYBqkoFaHy0rZu3XnXkHQT0ktfCxtE= 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 1612411162177871.1450638919283; Wed, 3 Feb 2021 19:59:22 -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-570-YCJBcawxO3CGDzNrGg-3KA-1; Wed, 03 Feb 2021 22:58:28 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1F1C81007496; Thu, 4 Feb 2021 03:58:23 +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 F09215D9EF; Thu, 4 Feb 2021 03:58: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 BA0B45808C; Thu, 4 Feb 2021 03:58:22 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1143wGM1003578 for ; Wed, 3 Feb 2021 22:58:16 -0500 Received: by smtp.corp.redhat.com (Postfix) id 251685B697; Thu, 4 Feb 2021 03:58:16 +0000 (UTC) Received: from vhost2.laine.org (ovpn-112-199.phx2.redhat.com [10.3.112.199]) by smtp.corp.redhat.com (Postfix) with ESMTP id E3EEE5B698 for ; Thu, 4 Feb 2021 03:58:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612411161; 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=dJLnjfwzmdDV+lDPcPqu1GLCafVTNgstv6DqV3VOb/w=; b=NwqLPssXU/khvgEbwffKSuLrKrKyJzSjoL8BubsG9fESSDu/AMo6Zcrx/OBJPDAJDvXpdm EyMBjrRwowEfC89Gr60l55Itz9F+A4jtvp9BznIQ4bhbIrLs09ys62YwdTdkWJqR4FV0iF MWVYvjQ/uw5MaD1Edv8o6Pvh5Fa0y6w= X-MC-Unique: YCJBcawxO3CGDzNrGg-3KA-1 From: Laine Stump To: libvir-list@redhat.com Subject: [libvirt PATCH v2 21/24] qemu: rename virFirmware*Free() functions to have more accurate names Date: Wed, 3 Feb 2021 22:57:48 -0500 Message-Id: <20210204035751.164765-22-laine@redhat.com> In-Reply-To: <20210204035751.164765-1-laine@redhat.com> References: <20210204035751.164765-1-laine@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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.14 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" Several functions had the names virFirmware[something]Free(), but they aren't taking a pointer to some object and freeing it. Instead, they are making a copy of the content of an entire object, then Freeing the objects pointed to by that content. As a first step in a too-complicated cleanup just to eliminate a few occurrences of VIR_FREE(), this patch renames those functions to more accurately reflect what they do - they Free the *Content* of their arguments. Signed-off-by: Laine Stump --- src/qemu/qemu_firmware.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/qemu/qemu_firmware.c b/src/qemu/qemu_firmware.c index fe30db4f79..c22b1f1e9c 100644 --- a/src/qemu/qemu_firmware.c +++ b/src/qemu/qemu_firmware.c @@ -188,7 +188,7 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuFirmwareOSInterface, = qemuFirmwareOSInterfaceFr =20 =20 static void -qemuFirmwareFlashFileFree(qemuFirmwareFlashFile flash) +qemuFirmwareFlashFileFreeContent(qemuFirmwareFlashFile flash) { VIR_FREE(flash.filename); VIR_FREE(flash.format); @@ -196,39 +196,39 @@ qemuFirmwareFlashFileFree(qemuFirmwareFlashFile flash) =20 =20 static void -qemuFirmwareMappingFlashFree(qemuFirmwareMappingFlash flash) +qemuFirmwareMappingFlashFreeContent(qemuFirmwareMappingFlash flash) { - qemuFirmwareFlashFileFree(flash.executable); - qemuFirmwareFlashFileFree(flash.nvram_template); + qemuFirmwareFlashFileFreeContent(flash.executable); + qemuFirmwareFlashFileFreeContent(flash.nvram_template); } =20 =20 static void -qemuFirmwareMappingKernelFree(qemuFirmwareMappingKernel kernel) +qemuFirmwareMappingKernelFreeContent(qemuFirmwareMappingKernel kernel) { VIR_FREE(kernel.filename); } =20 =20 static void -qemuFirmwareMappingMemoryFree(qemuFirmwareMappingMemory memory) +qemuFirmwareMappingMemoryFreeContent(qemuFirmwareMappingMemory memory) { VIR_FREE(memory.filename); } =20 =20 static void -qemuFirmwareMappingFree(qemuFirmwareMapping mapping) +qemuFirmwareMappingFreeContent(qemuFirmwareMapping mapping) { switch (mapping.device) { case QEMU_FIRMWARE_DEVICE_FLASH: - qemuFirmwareMappingFlashFree(mapping.data.flash); + qemuFirmwareMappingFlashFreeContent(mapping.data.flash); break; case QEMU_FIRMWARE_DEVICE_KERNEL: - qemuFirmwareMappingKernelFree(mapping.data.kernel); + qemuFirmwareMappingKernelFreeContent(mapping.data.kernel); break; case QEMU_FIRMWARE_DEVICE_MEMORY: - qemuFirmwareMappingMemoryFree(mapping.data.memory); + qemuFirmwareMappingMemoryFreeContent(mapping.data.memory); break; case QEMU_FIRMWARE_DEVICE_NONE: case QEMU_FIRMWARE_DEVICE_LAST: @@ -271,7 +271,7 @@ qemuFirmwareFree(qemuFirmwarePtr fw) return; =20 qemuFirmwareOSInterfaceFree(fw->interfaces); - qemuFirmwareMappingFree(fw->mapping); + qemuFirmwareMappingFreeContent(fw->mapping); for (i =3D 0; i < fw->ntargets; i++) qemuFirmwareTargetFree(fw->targets[i]); g_free(fw->targets); --=20 2.29.2