From nobody Mon Feb 9 17:23:19 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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.133.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=1646414997; cv=none; d=zohomail.com; s=zohoarc; b=O6XOIixXTsZE+PSDDorS5FYp76HSXScNIi9KjNfqtPHuYj6LqjD5sVYuUv5y4PBR69JddYKQPFlt/klzVfDWARkZg3PZw1KvJ3BvvMAl7fPFXxIdslUUvlkNW4jsb47rEVPhBVXAQ+Rn3fO4yuzWFoCIzfZ3WIBLuGk1JYMgX9I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1646414997; 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=iIjf/wWhJmeRDa5L4aA2KKKX8tVd63aApTaApP5Fqeg=; b=M4tRBcwY99hG5K0Z05kHJPijiZlW99oqZWCP+bcnClFFuhjAf8qHRkoy/ElqjMNMVGP5VWf4iiBPxxDE3Ma3JgAOLPhIUrDtw1ubG5D3UA7eNUSfwN0bRnF28DjHypURU51ADEbznZsd7BanHxw+1uiuFRYNZKIpGMhFWhE4rR0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.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.133.124]) by mx.zohomail.com with SMTPS id 1646414997697243.3335150795159; Fri, 4 Mar 2022 09:29:57 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-220-VKAhYhhWOq2-MapyyPYaPg-1; Fri, 04 Mar 2022 12:29:55 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 897EE814707; Fri, 4 Mar 2022 17:29:49 +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 E29C186586; Fri, 4 Mar 2022 17:29:48 +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 B6E2544A59; Fri, 4 Mar 2022 17:29:48 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 224HTVNt024648 for ; Fri, 4 Mar 2022 12:29:31 -0500 Received: by smtp.corp.redhat.com (Postfix) id B427A8479F; Fri, 4 Mar 2022 17:29:31 +0000 (UTC) Received: from work.speedport.ip (unknown [10.39.195.86]) by smtp.corp.redhat.com (Postfix) with ESMTP id 067857DE4C; Fri, 4 Mar 2022 17:29:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1646414996; 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=iIjf/wWhJmeRDa5L4aA2KKKX8tVd63aApTaApP5Fqeg=; b=GX5gQlBEYH/glYkaUgBsHhMk7vHYSQSRpwsgBxXj/j/cQWwecleRx0X/dcUDQznO6g7T5l 9GVdiBWrtiXke6H9uQOofo9FiIyrCLsiR8kW5D0E+bnTLBZa+Ahnrcn5EMusqLhVSmh3UX 5gqxIIwiNTK66Q3pjaqUtaBCnZjGwLw= X-MC-Unique: VKAhYhhWOq2-MapyyPYaPg-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH v2 09/10] storage: Removing mutex locking in initialization and cleanup Date: Fri, 4 Mar 2022 18:28:39 +0100 Message-Id: <20220304172840.66057-10-twiederh@redhat.com> In-Reply-To: <20220304172840.66057-1-twiederh@redhat.com> References: <20220304172840.66057-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Cc: Tim Wiederhake 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.13 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: 1646414998162100003 Content-Type: text/plain; charset="utf-8" These functions are only ever called in a single threaded environment and the mutex would not have prevented concurrent access anyway. Signed-off-by: Tim Wiederhake --- src/storage/storage_driver.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c index 97e0d9b3a0..ee710f6b76 100644 --- a/src/storage/storage_driver.c +++ b/src/storage/storage_driver.c @@ -274,7 +274,6 @@ storageStateInitialize(bool privileged, VIR_FREE(driver); return VIR_DRV_STATE_INIT_ERROR; } - storageDriverLock(); =20 if (!(driver->pools =3D virStoragePoolObjListNew())) goto error; @@ -330,12 +329,9 @@ storageStateInitialize(bool privileged, if (!(driver->caps =3D virStorageBackendGetCapabilities())) goto error; =20 - storageDriverUnlock(); - return VIR_DRV_STATE_INIT_COMPLETE; =20 error: - storageDriverUnlock(); storageStateCleanup(); return VIR_DRV_STATE_INIT_ERROR; } @@ -376,8 +372,6 @@ storageStateCleanup(void) if (!driver) return -1; =20 - storageDriverLock(); - virObjectUnref(driver->caps); virObjectUnref(driver->storageEventState); =20 @@ -391,7 +385,6 @@ storageStateCleanup(void) VIR_FREE(driver->configDir); VIR_FREE(driver->autostartDir); VIR_FREE(driver->stateDir); - storageDriverUnlock(); virMutexDestroy(&driver->lock); VIR_FREE(driver); =20 --=20 2.31.1