From nobody Tue May 14 03:06:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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 170.10.133.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=1647519467; cv=none; d=zohomail.com; s=zohoarc; b=U6K7ETmE/omSDYVjg7CWPLFZXJwlFpu1jJ5eED5n2DDgA/gApUFSIMWON0numTS0q698IEOppvgK4Fog9f2Ev8jWLrgLciqDSlGTgfNtWe8jSWlPKbuBtZgYH725Wd7R+REn8kLKcWdEQAQGw/6BP/lGH5VpYwRjJD0tvWd4Bhc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1647519467; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=VcSQvpVSUCANLA+Wmgyer9YoKMvXXhO1Wcjeb8YJVRA=; b=RdrcKIFoMrUXO0GNX5EWZI22dBP7LC4F9NgeDo8IcwOYnz5Qa9IUFllU70AIn++78FFDthohRwpMZqIhbuqxNnl3pxmCDz2+pJij5tjpdBLi8794al2BV2sNoL9YaIQtxe7tWL9Oo8eqF8+D+owP3RzdpYPlRGHNlcLrQCNhFWM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1647519467659694.7473838657999; Thu, 17 Mar 2022 05:17:47 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-524-gCftqyNIOMySEkNDR0z3iQ-1; Thu, 17 Mar 2022 08:17:45 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C8160101A54C; Thu, 17 Mar 2022 12:17:42 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 563EF40D2820; Thu, 17 Mar 2022 12:17:41 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 22B25194036B; Thu, 17 Mar 2022 12:17:41 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 9C67C194035E for ; Thu, 17 Mar 2022 12:17:40 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 6E74B401E75; Thu, 17 Mar 2022 12:17:40 +0000 (UTC) Received: from domokun.gsslab.fab.redhat.com (gx270-2.gsslab.fab.redhat.com [10.33.8.41]) by smtp.corp.redhat.com (Postfix) with ESMTP id 17D21401E71; Thu, 17 Mar 2022 12:17:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1647519466; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=VcSQvpVSUCANLA+Wmgyer9YoKMvXXhO1Wcjeb8YJVRA=; b=GzXnvfPePNt8H/4kFFofLpuTSM8bolRod1uZc4xVU+Zi6TJevTlwkLJutdJd+06K7OQ5bp mBZrx55b71lmsPSSgnnurAh/BuUHv96jjoGWEBSWjq1kkaJCv06C82if3JABWZeAoCl46h QPWvWbsAdRGdLZ9k1Cg8Nsf4FppWQuY= X-MC-Unique: gCftqyNIOMySEkNDR0z3iQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [PATCH] conf: fix inverted parameters in hash iterator callbacks Date: Thu, 17 Mar 2022 12:17:36 +0000 Message-Id: <20220317121736.2017598-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1647519469152100001 virHashTableForEach unhelpfully has payload/key args in its callback reversed compared to g_hash_table_foreach. When converting from one to the other the semantics change but you don't get a compile error Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Erik Skultety --- This fixes the virNWFilterObjList conversion to GHashTable which I clearly forgot to re-test properly after replacing virHashTableForEach with g_hash_table_foreach in my patch. src/conf/virnwfilterobj.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/conf/virnwfilterobj.c b/src/conf/virnwfilterobj.c index a569a52002..309f8bddb4 100644 --- a/src/conf/virnwfilterobj.c +++ b/src/conf/virnwfilterobj.c @@ -380,8 +380,8 @@ struct virNWFilterObjListData { =20 =20 static void -virNWFilterObjListCount(void *payload, - void *key G_GNUC_UNUSED, +virNWFilterObjListCount(void *key G_GNUC_UNUSED, + void *payload, void *opaque) { virNWFilterObj *obj =3D payload; @@ -417,8 +417,8 @@ struct virNWFilterNameData { =20 =20 static void -virNWFilterObjListCopyNames(void *payload, - void *key G_GNUC_UNUSED, +virNWFilterObjListCopyNames(void *key G_GNUC_UNUSED, + void *payload, void *opaque) { virNWFilterObj *obj =3D payload; @@ -460,15 +460,15 @@ struct virNWFilterListData { =20 =20 static void -virNWFilterObjListCollectIterator(void *payload, - void *key G_GNUC_UNUSED, +virNWFilterObjListCollectIterator(void *key G_GNUC_UNUSED, + void *payload, void *opaque) { struct virNWFilterListData *data =3D opaque; virNWFilterObj *obj =3D payload; =20 virNWFilterObjLock(obj); - data->filters[data->nfilters++] =3D payload; + data->filters[data->nfilters++] =3D obj; } =20 =20 --=20 2.35.1