From nobody Wed May 15 02:38:47 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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.129.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=1647600224; cv=none; d=zohomail.com; s=zohoarc; b=JbzZtEMu/rpe0TIyt51yU8YFFbC4oYgTUSrDiAdo+V0eImIlwKGzlw72+aghejRAVMaF7oli3IiwOy2OKx0IWtt5h2C1jYw5i0zbjSjka/EEayoZfUHdOvAsHmBOZL0J4wa/wiEOYhzNEQMF0GlivNxw6dPKsUY9ON26VmBKCoQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1647600224; 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=IwLI+Q3MxHfs5Qqrlrfiw1SMJNpL06C9H/8kS3lVsMU=; b=iBjGZ/GBRGGNz9QJBjAF3YVs5+DRjykGFLzcwLCRVmMsb5GRBbm7urs0wQH1ryfKU0Fpn4B6hTcA39musV4sc6GA1qa8X5BniAYWQo2yTWFMobN1102YE2StVEbcM/1KvsUjKvYRSYDxt08Dvhvwcsm/hAfSrGYmDuPZgukE7Sk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.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.129.124]) by mx.zohomail.com with SMTPS id 1647600224360227.9674082552773; Fri, 18 Mar 2022 03:43:44 -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-231-PdYdwui5P0eyGzMvUG-5Dw-1; Fri, 18 Mar 2022 06:43:41 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id F2849185A7A4; Fri, 18 Mar 2022 10:43:39 +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 73F242156A31; Fri, 18 Mar 2022 10:43:39 +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 DB24E1949763; Fri, 18 Mar 2022 10:43:37 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 0AF5C1949761 for ; Fri, 18 Mar 2022 10:43:36 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id DBE21C4C7A5; Fri, 18 Mar 2022 10:43:36 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.152]) by smtp.corp.redhat.com (Postfix) with ESMTP id 81658C4C7A0 for ; Fri, 18 Mar 2022 10:43:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1647600223; 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=IwLI+Q3MxHfs5Qqrlrfiw1SMJNpL06C9H/8kS3lVsMU=; b=cnuiBM+qTnCmAJhamK3AwzxpQcxExdaK3T23YV0rrbwxlocuyfo7YFqiGSQkt750hgNAWH cMBCSFOTKj2gopAp3KTZ9ps+EqY2euBG37R5xwVXi9kunLXAkC3solWH5UoomrWPtNciJh jBZeZ5Vbc4L2zYOoFJ22l9w7Was0C3s= X-MC-Unique: PdYdwui5P0eyGzMvUG-5Dw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH] virnwfilterobj: Don't use virObjectLockGuard() with virNWFilterObj Date: Fri, 18 Mar 2022 11:43:34 +0100 Message-Id: <98a854ba418d941ef1f9ab84f7b6b813de1e27db.1647600214.git.mprivozn@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 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.78 on 10.11.54.6 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) X-ZM-MESSAGEID: 1647600225295100001 Content-Type: text/plain; charset="utf-8" While its name would suggest that virNWFilterObj is an actual virObject it is not. It's a plain structure (with virMutex as its first member). Therefore, when locking the struct virObjectLockGuard() can' be used and virLockGuardLock() must be used instead. Spotted-by: Martin Kletzander Signed-off-by: Michal Privoznik --- src/conf/virnwfilterobj.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/conf/virnwfilterobj.c b/src/conf/virnwfilterobj.c index 309f8bddb4..e9bb2b1811 100644 --- a/src/conf/virnwfilterobj.c +++ b/src/conf/virnwfilterobj.c @@ -386,7 +386,7 @@ virNWFilterObjListCount(void *key G_GNUC_UNUSED, { virNWFilterObj *obj =3D payload; struct virNWFilterObjListData *data =3D opaque; - VIR_LOCK_GUARD lock =3D virObjectLockGuard(obj); + VIR_LOCK_GUARD lock =3D virLockGuardLock(&obj->lock); =20 if (data->filter(data->conn, obj->def)) data->count++; @@ -423,7 +423,7 @@ virNWFilterObjListCopyNames(void *key G_GNUC_UNUSED, { virNWFilterObj *obj =3D payload; struct virNWFilterNameData *data =3D opaque; - VIR_LOCK_GUARD lock =3D virObjectLockGuard(obj); + VIR_LOCK_GUARD lock =3D virLockGuardLock(&obj->lock); =20 if (data->filter && !data->filter(data->conn, obj->def)) --=20 2.34.1