From nobody Mon Feb 9 19:26:10 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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=1586527007; cv=none; d=zohomail.com; s=zohoarc; b=IF0Bq2e/omSKAKujRpprVUxUQ6UNcnhBLKn/Q7OK+bpCoLJAXuVhvaNgoYA201NsBMhOCVZgPSXxGHa91qqjHij1+FQVnJ3/JWxEp1fz//1Jo3TNYWH24griHbwNhF6Lpi3eK4JT0iAaFw4RA5cOZ8w7ThqV8F0B46prq3PmoCw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1586527007; 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=HdjlDS0sk1StUzVU+rMw04ewSDZiW+vdZJjoRJzP0xg=; b=FPuTAba9OopfaRZs06P5h7GMphnAoz3ROq97cRPtg5g83aZTAaKTPBiXmOrDUo+eYYtJagQfYdKc8kWWYAOWARa4a1MSOY1mgFufXIndT7/a+5OPjN+s01YVE4+P6l4LfKE46dLKruzKUSdGfIg3SSyB7F9PUDSmMYeWscndwGo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1586527007151391.781162241119; Fri, 10 Apr 2020 06:56:47 -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-113-vz-2yrGgPyanAVczMp_B1Q-1; Fri, 10 Apr 2020 09:56:41 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0CB9F8018AB; Fri, 10 Apr 2020 13:56:36 +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 D588511A25E; Fri, 10 Apr 2020 13:56:35 +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 8884393093; Fri, 10 Apr 2020 13:56:35 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 03ADuBji023252 for ; Fri, 10 Apr 2020 09:56:11 -0400 Received: by smtp.corp.redhat.com (Postfix) id A90A7127515; Fri, 10 Apr 2020 13:56:11 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast01.extmail.prod.ext.rdu2.redhat.com [10.11.55.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A510E127512 for ; Fri, 10 Apr 2020 13:56:11 +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 8C323802D05 for ; Fri, 10 Apr 2020 13:56:11 +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-8-2NGiijFCOY6pk3bS_hcBPw-1; Fri, 10 Apr 2020 09:56:06 -0400 Received: by mail-wm1-f67.google.com with SMTP id x25so2592636wmc.0 for ; Fri, 10 Apr 2020 06:56:06 -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.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Apr 2020 06:56:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1586527006; 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=HdjlDS0sk1StUzVU+rMw04ewSDZiW+vdZJjoRJzP0xg=; b=a40re/Iu9043sOm+pOilN0Bj+ckF3KL8mhFrKbwaXiW7w+eC2GPc+0KUmHL4uQH0LbgYTE QIbuCxNFvcBmJcygV/I+PWwLRaLUIcTimEWxjpmwikhIyNXD5nHkV1oOxcxedGzciCScbg d5MSlOHuF5CeUA1SB6QNzCB5dVMbnVg= X-MC-Unique: vz-2yrGgPyanAVczMp_B1Q-1 X-MC-Unique: 2NGiijFCOY6pk3bS_hcBPw-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=5zekBdq0KeSU9G3eIo0ArmubAAgkiqD9a3kYRxCWqo8=; b=gsADYzIEPH7LF38n9K7xq6hvT3lEbgAcajEpV8VSVOsrP4jmEm9Ki3YFsZarvj1XcN jZwD1+0M52pGwF/szvOmt6eBhrvFLMAhFE9S5Z1RNekm6kyYuf4/oEqSgmb420ZZQTXo 1rnHtnDJ1Me7IF7Y6SGA08qcQHLMaHKbHdF+nMIU4qpXd6k0OVIbcsR6lG2umbGUyYEQ +dY3P0eQPhWdhJ6XD1WPx9HRkfn6M+H4QTiNwK2kaXBF8BTKn/cvqZRVSeWIRGmdAgwx ZjB3oRVvVEs57y0y4i4T0wdA0FJvfwbP2SmdVuH/jSPZN6by9/Jw5QcUKxfc2ZvFC8Cn ZGmg== X-Gm-Message-State: AGi0PuawYARJm0dIz3rfGz9xopbFFRkbJuBrsvu4dzCDpl1EveWv86Yr HiyE+HF+luq/dHP2pl2otmu8PXgbsCk= X-Google-Smtp-Source: APiQypKUU3HY3AWvXXqPXUwERFFxGYeu98oTAXk/1JKxXLiIk9mhLsQuWtN71JjHm0iIztiBirRutw== X-Received: by 2002:a7b:c417:: with SMTP id k23mr5399136wmi.147.1586526965002; Fri, 10 Apr 2020 06:56:05 -0700 (PDT) From: Rafael Fonseca To: libvir-list@redhat.com Subject: [PATCH 29/43] storage: convert virMutex to GMutex Date: Fri, 10 Apr 2020 15:54:56 +0200 Message-Id: <20200410135510.2148319-30-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.79 on 10.11.54.5 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 03ADuBji023252 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.11 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/virstorageobj.h | 2 +- src/storage/storage_driver.c | 11 ++++------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/conf/virstorageobj.h b/src/conf/virstorageobj.h index 54100ac22a..0f1f7c3d8d 100644 --- a/src/conf/virstorageobj.h +++ b/src/conf/virstorageobj.h @@ -35,7 +35,7 @@ typedef struct _virStorageDriverState virStorageDriverSta= te; typedef virStorageDriverState *virStorageDriverStatePtr; =20 struct _virStorageDriverState { - virMutex lock; + GMutex lock; =20 /* pid file FD, ensures two copies of the driver can't use the same ro= ot */ int lockFD; diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c index 2db763caa5..3a2816dede 100644 --- a/src/storage/storage_driver.c +++ b/src/storage/storage_driver.c @@ -68,11 +68,11 @@ struct _virStorageVolStreamInfo { =20 static void storageDriverLock(void) { - virMutexLock(&driver->lock); + g_mutex_lock(&driver->lock); } static void storageDriverUnlock(void) { - virMutexUnlock(&driver->lock); + g_mutex_unlock(&driver->lock); } =20 =20 @@ -269,10 +269,7 @@ storageStateInitialize(bool privileged, return VIR_DRV_STATE_INIT_ERROR; =20 driver->lockFD =3D -1; - if (virMutexInit(&driver->lock) < 0) { - VIR_FREE(driver); - return VIR_DRV_STATE_INIT_ERROR; - } + g_mutex_init(&driver->lock); storageDriverLock(); =20 if (!(driver->pools =3D virStoragePoolObjListNew())) @@ -391,7 +388,7 @@ storageStateCleanup(void) VIR_FREE(driver->autostartDir); VIR_FREE(driver->stateDir); storageDriverUnlock(); - virMutexDestroy(&driver->lock); + g_mutex_clear(&driver->lock); VIR_FREE(driver); =20 return 0; --=20 2.25.2