From nobody Mon Feb 9 16:45:24 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=1649775543; cv=none; d=zohomail.com; s=zohoarc; b=F1zPfBBQXsPYUo0LabOKqcgb2poE0ZXSnVjmNg0ov38h0NUnmvA4bd6zU6TeonQsr0eb5r+vMPMmISZv+jafVJjjGmrL5efyFWdMz/vcfHa81F68MQ1gN/o4dsEFEfvgEHDPPS/7wt8roZZKFEjYP4i1u+slMMMoC5tvnueIrLs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1649775543; 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=9htCMYVquG8YjK0l8ChBf242P6JJwO/QgJftvknZyNQ=; b=BpEOpt7N8vKVoq9vNsIBN/RSCNCBPnMzd29vKDvjcxcMvStSaaoj1xfdDzuT8AMGCsnMpIEVpPKneYIQKIeuBTzZ+84sxkRmxiMoUYK+rKvIdSrEsXqE5ILHSvxAaA+zdO5w1s3gW7Itp5vQAAaP7dTHBjBRRIklhLQ2kHQj65I= 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 1649775543347716.3016058016475; Tue, 12 Apr 2022 07:59:03 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-517-r-98yEhaPyCwcN9_m1d3UQ-1; Tue, 12 Apr 2022 10:58:08 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 082CE3811F4C; Tue, 12 Apr 2022 14:57:34 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id DB1C5C44B1D; Tue, 12 Apr 2022 14:57:33 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 40D62193F505; Tue, 12 Apr 2022 14:57:33 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id AD4201940365 for ; Tue, 12 Apr 2022 14:57:31 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 83A644AE6E9; Tue, 12 Apr 2022 14:57:31 +0000 (UTC) Received: from work.redhat.com (unknown [10.39.194.239]) by smtp.corp.redhat.com (Postfix) with ESMTP id 094CF4AE6E8; Tue, 12 Apr 2022 14:57:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1649775542; 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=9htCMYVquG8YjK0l8ChBf242P6JJwO/QgJftvknZyNQ=; b=Zs4u5sykSV43Fn3jCTgzsJaqaT7MsD2Wow21jeu6p4LVp6n44f4oZSqBRIp3Gi+IhII+jF BN0qvmHxyCwclLZ4ppi2nMZ08R3zAnvTutbUQrbENmZJEIbsJd/Ko2FfR8R2/ZpcEBQSW0 Eyp2VWdkmvTgi32J0giHM7OxMBgg5Xg= X-MC-Unique: r-98yEhaPyCwcN9_m1d3UQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 03/10] virStorageVolObjEndAPI: Remove Date: Tue, 12 Apr 2022 16:57:20 +0200 Message-Id: <20220412145727.69564-4-twiederh@redhat.com> In-Reply-To: <20220412145727.69564-1-twiederh@redhat.com> References: <20220412145727.69564-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tim Wiederhake Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 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: 1649775545490100001 Content-Type: text/plain; charset="utf-8"; x-default="true" This allows a later patch to replace virObjectLock/Unlock pairs with automatic mutex management code. Signed-off-by: Tim Wiederhake --- src/conf/virstorageobj.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/src/conf/virstorageobj.c b/src/conf/virstorageobj.c index 1ecf35640c..108ae0aeb1 100644 --- a/src/conf/virstorageobj.c +++ b/src/conf/virstorageobj.c @@ -138,17 +138,6 @@ virStorageVolObjNew(void) } =20 =20 -static void -virStorageVolObjEndAPI(virStorageVolObj **obj) -{ - if (!*obj) - return; - - virObjectUnlock(*obj); - g_clear_pointer(obj, virObjectUnref); -} - - static void virStorageVolObjDispose(void *opaque) { @@ -660,7 +649,8 @@ virStoragePoolObjAddVol(virStoragePoolObj *obj, =20 volobj->voldef =3D voldef; =20 - virStorageVolObjEndAPI(&volobj); + virObjectUnlock(volobj); + virObjectUnref(volobj); virObjectRWUnlock(volumes); return 0; } @@ -689,8 +679,8 @@ virStoragePoolObjRemoveVol(virStoragePoolObj *obj, g_hash_table_remove(volumes->objsKey, voldef->key); g_hash_table_remove(volumes->objsName, voldef->name); g_hash_table_remove(volumes->objsPath, voldef->target.path); - virStorageVolObjEndAPI(&volobj); - + virObjectUnlock(volobj); + virObjectUnref(volobj); virObjectRWUnlock(volumes); } =20 --=20 2.31.1