From nobody Mon Feb 9 10:47:47 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; 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 205.139.110.61 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=1586527014; cv=none; d=zohomail.com; s=zohoarc; b=Vn3MTTvc7OfXWWWOTR3vwQz01FWUUgV9N/PvV7IBlpZUbq/HXozkXMV0JG0IkLyOjR06aKo8LPvs7ve2UJBhQ5rAWXiM/OWU36NVZtQ9A1xXsXR+tsqcBtDIjSVy0Ym7yZJGxTKaVG+DIj5M9dtWx1ARp+eVfwteIK5KCE8tEbw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1586527014; 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=qFOQAhndEMiklY+mCz3RsP+bmr2uTDG7ntZiu7EhMXY=; b=OVt0ZXFTQljcIPWiKu8qMs06ceGis/PVkuJLwSgmAGJNmBioJWCJAQOVipa9q01JFG3TY7yfpHRIVbnz9I1jH3WkIs7vIcddHtAo6ycQ8wYn9dtJqGgPqNMyM5PRxLtA0uX3XLmCvzP01kC+SU3RHZys+h2WmrbjczZWsskioaM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 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-2.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1586527014305788.1777372992249; Fri, 10 Apr 2020 06:56:54 -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-18-7JjVo_JuPUKGsSMzObb-bg-1; Fri, 10 Apr 2020 09:56:50 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B98ED1137855; Fri, 10 Apr 2020 13:56:44 +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 DF7251036D3F; Fri, 10 Apr 2020 13:56:43 +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 84F5593F44; Fri, 10 Apr 2020 13:56:43 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 03ADuM3Q023352 for ; Fri, 10 Apr 2020 09:56:22 -0400 Received: by smtp.corp.redhat.com (Postfix) id 804E2200AFD4; Fri, 10 Apr 2020 13:56:22 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast04.extmail.prod.ext.rdu2.redhat.com [10.11.55.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7C09C202A940 for ; Fri, 10 Apr 2020 13:56:17 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (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 C9646101A55A for ; Fri, 10 Apr 2020 13:56:17 +0000 (UTC) Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-511-n8SUlfxYMOGlsoM7Yk46og-1; Fri, 10 Apr 2020 09:56:15 -0400 Received: by mail-wm1-f67.google.com with SMTP id v8so4844537wma.0 for ; Fri, 10 Apr 2020 06:56:15 -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.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Apr 2020 06:56:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1586527013; 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=qFOQAhndEMiklY+mCz3RsP+bmr2uTDG7ntZiu7EhMXY=; b=AS/lqVK/DWP+EnFWgAYqHilTZ9Wi9gTrvD2P16izrfhEaBl1ab1RSDZxjBzp79hyOrtJc1 XwtV2jgWcg5PgAj+NAyi35ABSmxa0T6QJyY3U8cq/JgAUAvcEkbJw0PEia4MRhFQ6VrFMz +k/iokNPeGRkTV6fIvpOEDTP5ccq6/U= X-MC-Unique: 7JjVo_JuPUKGsSMzObb-bg-1 X-MC-Unique: n8SUlfxYMOGlsoM7Yk46og-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=f0wist+St9EOrdH3OnXqXRC+KtlR+/f2X8CLjB/Fots=; b=A6atyN5nFZRA9jlQfsORPTryvEGKOMnQFGG+TISq05bAelYWpwzTGHkzUZp+c0dz8t KrxEW0rqo/SXnFGdpjU4NOSxAvnaebiTXwnblWm8gjLbwu1fqf773GfJxcM+PfrbyRmm RaOHCvPjnAnpQriaZxTIOzg8mj4qGE1kC80xBLARY6TdtisW5AfAQokMrN4brWTZ9MVR Y3Egb8TSQ+QYAIKnVZmWOXHcKoTsqtmoK8VdSKICr6Vnjx34bqBL8ZW2u51rVomZ1SpW xzgZXweVTqxKPlsI+KrAqfHQZ8EBCDh3juuwQljnvOnefuL/ARvbGJDnibuxkmO7P7Y5 06Hw== X-Gm-Message-State: AGi0PuYjp54jUslNfhzywsOvuuG0OfQXconCPsTYT09/DqygpoiVrPFP UW9zxPvOEyXGuuYCW6r5GcFrIBYgoNk= X-Google-Smtp-Source: APiQypLR+bJ/9PAjd8MphvMnvGxnbtsLN5arwKoMH2A9Xn2uUAMdHNF/HJ29SzM4e+jB5hNCKEj6mg== X-Received: by 2002:a05:600c:210c:: with SMTP id u12mr5472604wml.135.1586526974221; Fri, 10 Apr 2020 06:56:14 -0700 (PDT) From: Rafael Fonseca To: libvir-list@redhat.com Subject: [PATCH 36/43] util: virnetlink: convert virMutex to GMutex Date: Fri, 10 Apr 2020 15:55:03 +0200 Message-Id: <20200410135510.2148319-37-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.4 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 03ADuM3Q023352 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.84 on 10.5.11.22 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/util/virnetlink.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/util/virnetlink.c b/src/util/virnetlink.c index 3117dcbe65..e9f2c273d9 100644 --- a/src/util/virnetlink.c +++ b/src/util/virnetlink.c @@ -62,7 +62,7 @@ typedef struct _virNetlinkEventSrvPrivate virNetlinkEvent= SrvPrivate; typedef virNetlinkEventSrvPrivate *virNetlinkEventSrvPrivatePtr; struct _virNetlinkEventSrvPrivate { /* Server */ - virMutex lock; + GMutex lock; int eventwatch; int netlinkfd; virNetlinkHandle *netlinknh; @@ -791,13 +791,13 @@ virNetlinkGetErrorCode(struct nlmsghdr *resp, unsigne= d int recvbuflen) static void virNetlinkEventServerLock(virNetlinkEventSrvPrivatePtr driver) { - virMutexLock(&driver->lock); + g_mutex_lock(&driver->lock); } =20 static void virNetlinkEventServerUnlock(virNetlinkEventSrvPrivatePtr driver) { - virMutexUnlock(&driver->lock); + g_mutex_unlock(&driver->lock); } =20 /** @@ -916,7 +916,7 @@ virNetlinkEventServiceStop(unsigned int protocol) VIR_FREE(srv->handles); virNetlinkEventServerUnlock(srv); =20 - virMutexDestroy(&srv->lock); + g_mutex_clear(&srv->lock); VIR_FREE(srv); return 0; } @@ -1017,10 +1017,7 @@ virNetlinkEventServiceStart(unsigned int protocol, u= nsigned int groups) if (VIR_ALLOC(srv) < 0) return -1; =20 - if (virMutexInit(&srv->lock) < 0) { - VIR_FREE(srv); - return -1; - } + g_mutex_init(&srv->lock); =20 virNetlinkEventServerLock(srv); =20 @@ -1070,7 +1067,7 @@ virNetlinkEventServiceStart(unsigned int protocol, un= signed int groups) error_locked: virNetlinkEventServerUnlock(srv); if (ret < 0) { - virMutexDestroy(&srv->lock); + g_mutex_clear(&srv->lock); VIR_FREE(srv); } return ret; --=20 2.25.2