From nobody Mon Feb 9 10:28:08 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1586527003; cv=none; d=zohomail.com; s=zohoarc; b=O8FIerMEUmfVf9mwFI3Slp7OzVQCm7HL2IcBxr1B3ASSbvNZt9AbICvvheRHf6xQakWiwUCOj8jGRbW5fAdctYbNtksdlr/bN5VO9GbKT0hEez4SzTDglN8AQvod8+Oc/alkXM9GxiRqMlrzTqKuCjW3mpINYJ04whlyc14uTx0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1586527003; h=Content-Type:Content-Transfer-Encoding:Cc: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=JE9qay9CiyDZ8xybVE5/07gTnw2hpNZYUhaN9Xlyw/g=; b=J3ptQgq7XHDQD2gR39ibTyeacBECPz7/LujsTaT+wIjxzIVdgluUQT4+ExLky0c4EcEPQFSrOwifJJne15SA/TnpCZOlD5ZwyG/z7LScky9X3LOYUt4eilEIj/05B7/FJ82ESaq6L24wDtqCWZQeJ84ua+mZsDOWSHdr+32TwWY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 158652700343598.54459408066816; Fri, 10 Apr 2020 06:56:43 -0700 (PDT) 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-321-xQd79u3rMZ6uQQPXEahSeA-1; Fri, 10 Apr 2020 09:56:39 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7CAC4801E67; Fri, 10 Apr 2020 13:56:32 +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 5022EC0DBC; Fri, 10 Apr 2020 13:56: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 F3D3138A1; Fri, 10 Apr 2020 13:56:31 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 03ADu6PK023208 for ; Fri, 10 Apr 2020 09:56:06 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7A7AD10E60DD; Fri, 10 Apr 2020 13:56:06 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast02.extmail.prod.ext.rdu2.redhat.com [10.11.55.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 767D710E60DC for ; Fri, 10 Apr 2020 13:56:06 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5DDDE8007A4 for ; Fri, 10 Apr 2020 13:56:06 +0000 (UTC) Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-103-aFAxUYRFPI2R7iFCc-353A-1; Fri, 10 Apr 2020 09:56:03 -0400 Received: by mail-wm1-f65.google.com with SMTP id r26so2833053wmh.0 for ; Fri, 10 Apr 2020 06:56:03 -0700 (PDT) Received: from localhost.localdomain (public-gprs377075.centertel.pl. [37.47.104.52]) by smtp.gmail.com with ESMTPSA id c11sm3066319wrt.24.2020.04.10.06.56.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Apr 2020 06:56:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1586527002; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=JE9qay9CiyDZ8xybVE5/07gTnw2hpNZYUhaN9Xlyw/g=; b=GWx6olIfaEcLyMcX/dDtwKn4nys9Y5H3qOPnSidlgB+hxzAWuq5wMbMG5XBv7THcEBtlvd 6WmL3UxWjOzBk6q0+NeeVZTNWn9Xd6du0dSuuN81k3nPNJsQrLOJ/LaI5FSn1mc6ueMmnd mRvBs8Y+9vdevvyY2F0riO2OrKCF+LY= X-MC-Unique: xQd79u3rMZ6uQQPXEahSeA-1 X-MC-Unique: aFAxUYRFPI2R7iFCc-353A-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=80ze4kGDBQ0doji6xXhTP31WFquPUTCGw2ZGM4YzPMk=; b=ZujqXN8TVwmYDrdPqL3p8vjvSBFdL5w1hlHGHX/w2bd8xyoApYuL0Jy1P79yNHD7D5 ExooCcpuh9xeaahws0fnkhnq9K2v82tYo4DQU58viVKM3NIICge1gN/Cm4x+XbeDSVSR 0GKfc5Ag/+E3Ma1RzSsMALABYSQSLZgFR03EeRIJ6zSPkpunubOJMgVYXvcHz7dp6sDF vgc5piWNphEjAumqzmKc+udPdJIgMhocJ5U3QwJs1xpRMpaldb9xF+U6TI63TNjOBBWB TYF3MCER4udZlIYGqi2ttauzpsRYNgSxXl9Kq92usTljg9xM6pvhUyN0dBzFYB6g+ysO s11w== X-Gm-Message-State: AGi0PuY+sf04fhYAF4wyLqQrdO1ESpPAzilXYG1V2hamaF2M6ayyRXC/ AOJRg8Db14Ekb66BUKcDHtwdNXBc9aQ= X-Google-Smtp-Source: APiQypIQE3dcWE/DdqvVbNoqyS0Y2Zg2H26uB6+eXPbpCndOKcxlnrzkusIna8gbBRTws7b4oVrBxg== X-Received: by 2002:a7b:c3c5:: with SMTP id t5mr4998078wmj.80.1586526962134; Fri, 10 Apr 2020 06:56:02 -0700 (PDT) From: Rafael Fonseca To: libvir-list@redhat.com Subject: [PATCH 27/43] nwfilter: convert virMutex to GMutex Date: Fri, 10 Apr 2020 15:54:54 +0200 Message-Id: <20200410135510.2148319-28-r4f4rfs@gmail.com> In-Reply-To: <20200410135510.2148319-1-r4f4rfs@gmail.com> References: <20200410135510.2148319-1-r4f4rfs@gmail.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 03ADu6PK023208 X-loop: libvir-list@redhat.com Cc: Rafael Fonseca 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.15 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" Signed-off-by: Rafael Fonseca --- src/conf/virnwfilterobj.h | 2 +- src/nwfilter/nwfilter_driver.c | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/conf/virnwfilterobj.h b/src/conf/virnwfilterobj.h index a6bdfb3864..f862f78650 100644 --- a/src/conf/virnwfilterobj.h +++ b/src/conf/virnwfilterobj.h @@ -33,7 +33,7 @@ typedef virNWFilterObjList *virNWFilterObjListPtr; typedef struct _virNWFilterDriverState virNWFilterDriverState; typedef virNWFilterDriverState *virNWFilterDriverStatePtr; struct _virNWFilterDriverState { - virMutex lock; + GMutex lock; bool privileged; =20 /* pid file FD, ensures two copies of the driver can't use the same ro= ot */ diff --git a/src/nwfilter/nwfilter_driver.c b/src/nwfilter/nwfilter_driver.c index 650ef19746..8dc928160b 100644 --- a/src/nwfilter/nwfilter_driver.c +++ b/src/nwfilter/nwfilter_driver.c @@ -70,11 +70,11 @@ static int nwfilterStateReload(void); =20 static void nwfilterDriverLock(void) { - virMutexLock(&driver->lock); + g_mutex_lock(&driver->lock); } static void nwfilterDriverUnlock(void) { - virMutexUnlock(&driver->lock); + g_mutex_lock(&driver->lock); } =20 #ifdef WITH_FIREWALLD @@ -197,8 +197,7 @@ nwfilterStateInitialize(bool privileged, return VIR_DRV_STATE_INIT_ERROR; =20 driver->lockFD =3D -1; - if (virMutexInit(&driver->lock) < 0) - goto err_free_driverstate; + g_mutex_init(&driver->lock); =20 driver->privileged =3D privileged; if (!(driver->nwfilters =3D virNWFilterObjListNew())) @@ -379,7 +378,7 @@ nwfilterStateCleanup(void) /* free inactive nwfilters */ virNWFilterObjListFree(driver->nwfilters); =20 - virMutexDestroy(&driver->lock); + g_mutex_clear(&driver->lock); VIR_FREE(driver); =20 return 0; --=20 2.25.2