From nobody Mon Feb 9 08:55:49 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=1586526986; cv=none; d=zohomail.com; s=zohoarc; b=I598rSzIw0Cvd1kwOAbhq083SrKQIIsqatnLGB9BplGQ4mxz5w0BjFNFqCBgYMcAJRp9mDCUbu+UXr1ibbuXqlcWnupj0zsgi3jgIWzcGVzeJtFRVN0EiAeW3WOteLKJZxsb1k+M+RNKH6fxIG/cGCsYhOnjayEPrjwoJI8RVJQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1586526986; 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=QJNcsJBMQoRGlS93D9vk54xidfIUzSaLu/SVgA/VoWY=; b=cjYiFzJuYua6phpdwqe92oF+49flpOi0hiYcd5O6rgEKQ5WSdEO/YRzhjmY2D9sK7talAUJVn5+DyZtAXj9ah7h8HHLeOgvx1Q4eBlOQFXKFQ2hbgRF7exXW8RgsLH0e/1amZE0csOq48BJdn8fMiYTOfK0mV8KAyKnupltl7AA= 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 1586526986284585.9170447954949; Fri, 10 Apr 2020 06:56:26 -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-379-Jz_TGPkRPKaoHuuZdJCK9A-1; Fri, 10 Apr 2020 09:56:22 -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 695B010509A1; Fri, 10 Apr 2020 13:56:16 +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 3CFA8101D484; Fri, 10 Apr 2020 13:56:16 +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 E0A8F93098; Fri, 10 Apr 2020 13:56:15 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 03ADtphN023045 for ; Fri, 10 Apr 2020 09:55:51 -0400 Received: by smtp.corp.redhat.com (Postfix) id B9C092166B35; Fri, 10 Apr 2020 13:55:51 +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 B5D8C2166B34 for ; Fri, 10 Apr 2020 13:55:51 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) (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 9C512101A55D for ; Fri, 10 Apr 2020 13:55:51 +0000 (UTC) Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-154-MbAReuxJNPCkwLKKyACSQA-1; Fri, 10 Apr 2020 09:55:49 -0400 Received: by mail-wr1-f66.google.com with SMTP id g3so2413658wrx.2 for ; Fri, 10 Apr 2020 06:55:48 -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.55.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Apr 2020 06:55:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1586526985; 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=QJNcsJBMQoRGlS93D9vk54xidfIUzSaLu/SVgA/VoWY=; b=e9AelUWQ90DMeaeg2o9r24KXWnYpLnfvaLZKeP9oaU5HWWTO7j17YM2JyKbUOSR8kv4cv9 mkZNSbU55L5t8HWHFb8oyN95NsoBU2u34Luvy8ZEYukZpGCY9ZarLcPPI+5hNiVfZ0aHgG +ToOOlm0EhU53JMkZ//RQDoMNxo6Zu0= X-MC-Unique: Jz_TGPkRPKaoHuuZdJCK9A-1 X-MC-Unique: MbAReuxJNPCkwLKKyACSQA-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=kjBslTJx5UZZ5zAcW3qwdLQYFJke9jU9IQBVkAEsmH8=; b=QgchjQSdKONHLCtrSfQBwByKXSkjvhdWwfBnQMpVZDKn1YMe65MCumZgl6EBoqsKt4 RxqPeTDoAf0NGSL7FY6HxAtip+Sal327W9+3ffWqrD4/bt6i5MsNfEfz+DA1NUz+ZEyj ySIqpnRmzsHRYBizetP2v5cV37tXzEu4YOCmJOWt7EzWCKvDzHgvNcWwyezkPi2Xo/x8 QebgV/VO2Dk/5IEMiy5xA68apbW2PT1bu8gwOlxmeS65xo2s8DvHMkgsHFRpcG4J/iN7 bxZGanepv+aoYV1W77dfARYLcN5PpzJwKxfz4TyWujxJThASa+wackQx+JilzEukfLUn 6RIg== X-Gm-Message-State: AGi0PuYHWpQKF+2IVFpJuCnfjljkO+p8bFAXnxbNmkUAk8q41a3zy7It ctCMKJbtR0Z7waW7BAntXWak32MUOJk= X-Google-Smtp-Source: APiQypJ2YdFutSs6lkbrwd7q3sIu2v8pxlNgd6Agk+IlyY6HGsZgaGNIDyav0WiFbgBHmxy53JzwIw== X-Received: by 2002:adf:ed86:: with SMTP id c6mr4537857wro.286.1586526947390; Fri, 10 Apr 2020 06:55:47 -0700 (PDT) From: Rafael Fonseca To: libvir-list@redhat.com Subject: [PATCH 15/43] test: convert virMutex to GMutex Date: Fri, 10 Apr 2020 15:54:42 +0200 Message-Id: <20200410135510.2148319-16-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.6 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 03ADtphN023045 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/test/test_driver.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 7759847c2d..1c23d569d5 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -125,7 +125,7 @@ typedef struct _testDriver testDriver; typedef testDriver *testDriverPtr; =20 static testDriverPtr defaultPrivconn; -static virMutex defaultLock =3D VIR_MUTEX_INITIALIZER; +G_LOCK_DEFINE_STATIC(defaultLock); =20 static virClassPtr testDriverClass; static void testDriverDispose(void *obj); @@ -1334,10 +1334,10 @@ testOpenDefault(virConnectPtr conn) xmlXPathContextPtr ctxt =3D NULL; size_t i; =20 - virMutexLock(&defaultLock); + G_LOCK(defaultLock); if (defaultPrivconn) { conn->privateData =3D virObjectRef(defaultPrivconn); - virMutexUnlock(&defaultLock); + G_UNLOCK(defaultLock); return VIR_DRV_OPEN_SUCCESS; } =20 @@ -1379,7 +1379,7 @@ testOpenDefault(virConnectPtr conn) defaultPrivconn =3D privconn; ret =3D VIR_DRV_OPEN_SUCCESS; cleanup: - virMutexUnlock(&defaultLock); + G_UNLOCK(defaultLock); xmlXPathFreeContext(ctxt); xmlFreeDoc(doc); return ret; @@ -1445,11 +1445,11 @@ testConnectAuthenticate(virConnectPtr conn, static void testDriverCloseInternal(testDriverPtr driver) { - virMutexLock(&defaultLock); + G_LOCK(defaultLock); bool disposed =3D !virObjectUnref(driver); if (disposed && driver =3D=3D defaultPrivconn) defaultPrivconn =3D NULL; - virMutexUnlock(&defaultLock); + G_UNLOCK(defaultLock); } =20 =20 --=20 2.25.2