From nobody Tue Feb 10 19:48:03 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=1612160862; cv=none; d=zohomail.com; s=zohoarc; b=KDpqEfT2Qua6PNgSSEqIaldZFUR4XfziSeyx99ApIsZDSBvgzxtK3jGJ8ZkL8aAx2wWIfRTz0pmR6lF49hksBGxgUYg2Vn+CpbWptlQeS8J5NJhyJGHQ0d3ak/e2ABoodQh+ypHqy/Q9HI644CvetzWm7hmA9tB/rNYHxabFnYA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1612160862; 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=92YalUK8Au2chXQHLVV3kuZiChUx+oSVbEJ6MHccSQI=; b=E4umrEED2Cv0xDpBySGUyxP0yIZxfjYykWO2xvkpxBg0Xnj9ZarjtiXuQ8rTrAFIaHBbnWjniOZVXLxQ6vxMnKJAQgIH4bkmkCp1PtmQYcAn7+7CuY5+UdmmbAv/NTXaZTt8K6Lslg/cK+DTIVaztPfQILeXQrJz3mZxUNzak8I= 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 1612160862737443.76771071847224; Sun, 31 Jan 2021 22:27:42 -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-389-I7BOqs2RM8a9zcDSpB7N7A-1; Mon, 01 Feb 2021 01:27:39 -0500 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 6E1EAC7401; Mon, 1 Feb 2021 06:27:33 +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 2CF1D19744; Mon, 1 Feb 2021 06:27:32 +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 09DEB1809C9F; Mon, 1 Feb 2021 06:27:29 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1116RRL3025979 for ; Mon, 1 Feb 2021 01:27:27 -0500 Received: by smtp.corp.redhat.com (Postfix) id 567AB70476; Mon, 1 Feb 2021 06:27:27 +0000 (UTC) Received: from vhost2.laine.org (ovpn-112-159.phx2.redhat.com [10.3.112.159]) by smtp.corp.redhat.com (Postfix) with ESMTP id 221CD7216C for ; Mon, 1 Feb 2021 06:27:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612160861; 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=92YalUK8Au2chXQHLVV3kuZiChUx+oSVbEJ6MHccSQI=; b=BZW+YqhRzBoGl2NquY1dVrhXTl2LXMrpPexcLqCr2MuDO46qAbf7jKqXr6AFxLCYzsV6aP eqIw2rhaLt243I/wtWcLOGTlQx5I78VV7wiJyVX/6R9x6wiGAxgLEMVI6FEkVVqQ8RwzPU fqO6EZeEnKko0zkExhhqfk5JUt76skA= X-MC-Unique: I7BOqs2RM8a9zcDSpB7N7A-1 From: Laine Stump To: libvir-list@redhat.com Subject: [PATCH 3/8] conf: replace g_clear_pointer(..., g_hash_table_unref) with virHashFree() Date: Mon, 1 Feb 2021 01:27:15 -0500 Message-Id: <20210201062720.425041-4-laine@redhat.com> In-Reply-To: <20210201062720.425041-1-laine@redhat.com> References: <20210201062720.425041-1-laine@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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.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 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" virHashFree() just calls g_hash_table_unref(), and it's more common for libvirt code to call virHashFree() rather than the convoluted calling of g_hash_table_unref() via g_clear_pointer(). Since the object containing the hashes is g_freed immediately after the hashes are freed, there is no functional difference. Signed-off-by: Laine Stump --- src/conf/domain_addr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/conf/domain_addr.c b/src/conf/domain_addr.c index 37dad20ade..a8648d5858 100644 --- a/src/conf/domain_addr.c +++ b/src/conf/domain_addr.c @@ -949,8 +949,8 @@ virDomainPCIAddressSetExtensionFree(virDomainPCIAddress= SetPtr addrs) if (!addrs || !addrs->zpciIds) return; =20 - g_clear_pointer(&addrs->zpciIds->uids, g_hash_table_unref); - g_clear_pointer(&addrs->zpciIds->fids, g_hash_table_unref); + virHashFree(addrs->zpciIds->uids); + virHashFree(addrs->zpciIds->fids); =20 VIR_FREE(addrs->zpciIds); } --=20 2.29.2