From nobody Thu May 15 22:57:53 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1503580210416511.8258350146574; Thu, 24 Aug 2017 06:10:10 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 863D08B137; Thu, 24 Aug 2017 13:10:08 +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 64F3F7D51D; Thu, 24 Aug 2017 13:10:08 +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 432E73FAEE; Thu, 24 Aug 2017 13:09:39 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v7OD9G82027844 for ; Thu, 24 Aug 2017 09:09:16 -0400 Received: by smtp.corp.redhat.com (Postfix) id 53C4E7B607; Thu, 24 Aug 2017 13:09:16 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-123-165.rdu2.redhat.com [10.10.123.165]) by smtp.corp.redhat.com (Postfix) with ESMTP id 21B737B606 for ; Thu, 24 Aug 2017 13:09:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 863D08B137 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=libvir-list-bounces@redhat.com From: John Ferlan To: libvir-list@redhat.com Date: Thu, 24 Aug 2017 09:09:04 -0400 Message-Id: <20170824130905.5199-12-jferlan@redhat.com> In-Reply-To: <20170824130905.5199-1-jferlan@redhat.com> References: <20170824130905.5199-1-jferlan@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 11/12] storage: Use virStoragePoolObj{Get|Incr}Decr}Asyncjobs 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Thu, 24 Aug 2017 13:10:09 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Use the new accessor APIs for storage_driver. Signed-off-by: John Ferlan --- src/storage/storage_driver.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c index 6fae6f4..83d9ce3 100644 --- a/src/storage/storage_driver.c +++ b/src/storage/storage_driver.c @@ -832,7 +832,7 @@ storagePoolUndefine(virStoragePoolPtr pool) goto cleanup; } =20 - if (obj->asyncjobs > 0) { + if (virStoragePoolObjGetAsyncjobs(obj) > 0) { virReportError(VIR_ERR_INTERNAL_ERROR, _("pool '%s' has asynchronous jobs running."), obj->def->name); @@ -1014,7 +1014,7 @@ storagePoolDestroy(virStoragePoolPtr pool) goto cleanup; } =20 - if (obj->asyncjobs > 0) { + if (virStoragePoolObjGetAsyncjobs(obj) > 0) { virReportError(VIR_ERR_INTERNAL_ERROR, _("pool '%s' has asynchronous jobs running."), obj->def->name); @@ -1082,7 +1082,7 @@ storagePoolDelete(virStoragePoolPtr pool, goto cleanup; } =20 - if (obj->asyncjobs > 0) { + if (virStoragePoolObjGetAsyncjobs(obj) > 0) { virReportError(VIR_ERR_INTERNAL_ERROR, _("pool '%s' has asynchronous jobs running."), obj->def->name); @@ -1140,7 +1140,7 @@ storagePoolRefresh(virStoragePoolPtr pool, goto cleanup; } =20 - if (obj->asyncjobs > 0) { + if (virStoragePoolObjGetAsyncjobs(obj) > 0) { virReportError(VIR_ERR_INTERNAL_ERROR, _("pool '%s' has asynchronous jobs running."), obj->def->name); @@ -1827,7 +1827,7 @@ storageVolCreateXML(virStoragePoolPtr pool, memcpy(buildvoldef, voldef, sizeof(*voldef)); =20 /* Drop the pool lock during volume allocation */ - obj->asyncjobs++; + virStoragePoolObjIncrAsyncjobs(obj); voldef->building =3D true; virStoragePoolObjUnlock(obj); =20 @@ -1840,7 +1840,7 @@ storageVolCreateXML(virStoragePoolPtr pool, storageDriverUnlock(); =20 voldef->building =3D false; - obj->asyncjobs--; + virStoragePoolObjDecrAsyncjobs(obj); =20 if (buildret < 0) { /* buildVol handles deleting volume on failure */ @@ -2020,13 +2020,13 @@ storageVolCreateXMLFrom(virStoragePoolPtr pool, goto cleanup; =20 /* Drop the pool lock during volume allocation */ - obj->asyncjobs++; + virStoragePoolObjIncrAsyncjobs(obj); voldef->building =3D true; voldefsrc->in_use++; virStoragePoolObjUnlock(obj); =20 if (objsrc) { - objsrc->asyncjobs++; + virStoragePoolObjIncrAsyncjobs(objsrc); virStoragePoolObjUnlock(objsrc); } =20 @@ -2040,10 +2040,10 @@ storageVolCreateXMLFrom(virStoragePoolPtr pool, =20 voldefsrc->in_use--; voldef->building =3D false; - obj->asyncjobs--; + virStoragePoolObjDecrAsyncjobs(obj); =20 if (objsrc) { - objsrc->asyncjobs--; + virStoragePoolObjDecrAsyncjobs(objsrc); virStoragePoolObjUnlock(objsrc); objsrc =3D NULL; } --=20 2.9.5 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list