From nobody Thu May 15 22:52:18 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 1503580170761916.2660639522187; Thu, 24 Aug 2017 06:09:30 -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 16934C0587E5; Thu, 24 Aug 2017 13:09:29 +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 E4AF77E22F; Thu, 24 Aug 2017 13:09:28 +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 ABB103FACF; Thu, 24 Aug 2017 13:09:28 +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 v7OD9EXj027821 for ; Thu, 24 Aug 2017 09:09:14 -0400 Received: by smtp.corp.redhat.com (Postfix) id DC6BB7B9C8; Thu, 24 Aug 2017 13:09:14 +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 AA3367B8D7 for ; Thu, 24 Aug 2017 13:09:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 16934C0587E5 Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.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:01 -0400 Message-Id: <20170824130905.5199-9-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 08/12] storage: Use virStoragePoolObj{Is|Set}Active 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.32]); Thu, 24 Aug 2017 13:09:29 +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, test_driver, and gluster backend. Signed-off-by: John Ferlan --- src/storage/storage_backend_gluster.c | 2 +- src/storage/storage_driver.c | 16 ++++++++-------- src/test/test_driver.c | 10 +++++----- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/storage/storage_backend_gluster.c b/src/storage/storage_ba= ckend_gluster.c index 90f31b0..05e7bff 100644 --- a/src/storage/storage_backend_gluster.c +++ b/src/storage/storage_backend_gluster.c @@ -544,7 +544,7 @@ virStorageBackendGlusterCheckPool(virStoragePoolObjPtr = pool, /* Return previous state remembered by the status XML. If the pool is = not * available we will fail to refresh it and end up in the same situati= on. * This will save one attempt to open the connection to the remote ser= ver */ - *active =3D pool->active; + *active =3D virStoragePoolObjIsActive(pool); return 0; } =20 diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c index a7a77ba..89eaee9 100644 --- a/src/storage/storage_driver.c +++ b/src/storage/storage_driver.c @@ -145,9 +145,9 @@ storagePoolUpdateState(virStoragePoolObjPtr obj) } } =20 - obj->active =3D active; + virStoragePoolObjSetActive(obj, active); =20 - if (!obj->active) + if (!virStoragePoolObjIsActive(obj)) virStoragePoolUpdateInactive(&obj); =20 cleanup: @@ -226,7 +226,7 @@ storageDriverAutostart(void) _("Failed to autostart storage pool '%s': %= s"), obj->def->name, virGetLastErrorMessage()); } else { - obj->active =3D true; + virStoragePoolObjSetActive(obj, true); } VIR_FREE(stateFile); } @@ -735,7 +735,7 @@ storagePoolCreateXML(virConnectPtr conn, 0); =20 VIR_INFO("Creating storage pool '%s'", obj->def->name); - obj->active =3D true; + virStoragePoolObjSetActive(obj, true); =20 pool =3D virGetStoragePool(conn, obj->def->name, obj->def->uuid, NULL,= NULL); =20 @@ -940,7 +940,7 @@ storagePoolCreate(virStoragePoolPtr pool, VIR_STORAGE_POOL_EVENT_STARTED, 0); =20 - obj->active =3D true; + virStoragePoolObjSetActive(obj, true); ret =3D 0; =20 cleanup: @@ -1040,7 +1040,7 @@ storagePoolDestroy(virStoragePoolPtr pool) VIR_STORAGE_POOL_EVENT_STOPPED, 0); =20 - obj->active =3D false; + virStoragePoolObjSetActive(obj, false); =20 virStoragePoolUpdateInactive(&obj); =20 @@ -1156,7 +1156,7 @@ storagePoolRefresh(virStoragePoolPtr pool, obj->def->uuid, VIR_STORAGE_POOL_EVENT_STO= PPED, 0); - obj->active =3D false; + virStoragePoolObjSetActive(obj, false); =20 virStoragePoolUpdateInactive(&obj); =20 @@ -1194,7 +1194,7 @@ storagePoolGetInfo(virStoragePoolPtr pool, goto cleanup; =20 memset(info, 0, sizeof(virStoragePoolInfo)); - if (obj->active) + if (virStoragePoolObjIsActive(obj)) info->state =3D VIR_STORAGE_POOL_RUNNING; else info->state =3D VIR_STORAGE_POOL_INACTIVE; diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 36e5ba1..33ce9e4 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -1131,7 +1131,7 @@ testParseStorage(testDriverPtr privconn, virStoragePoolObjUnlock(obj); goto error; } - obj->active =3D true; + virStoragePoolObjSetActive(obj, true); =20 /* Find storage volumes */ if (testOpenVolumesForPool(file, ctxt, obj, i+1) < 0) { @@ -4328,7 +4328,7 @@ testStoragePoolCreate(virStoragePoolPtr pool, if (!(obj =3D testStoragePoolObjFindInactiveByName(privconn, pool->nam= e))) return -1; =20 - obj->active =3D true; + virStoragePoolObjSetActive(obj, true); =20 event =3D virStoragePoolEventLifecycleNew(pool->name, pool->uuid, VIR_STORAGE_POOL_EVENT_STARTED, @@ -4476,7 +4476,7 @@ testStoragePoolCreateXML(virConnectPtr conn, * code will not Remove the pool */ virStoragePoolObjSetConfigFile(obj, NULL); =20 - obj->active =3D true; + virStoragePoolObjSetActive(obj, true); =20 event =3D virStoragePoolEventLifecycleNew(obj->def->name, obj->def->uu= id, VIR_STORAGE_POOL_EVENT_STARTED, @@ -4624,7 +4624,7 @@ testStoragePoolDestroy(virStoragePoolPtr pool) if (!(obj =3D testStoragePoolObjFindActiveByName(privconn, pool->name)= )) return -1; =20 - obj->active =3D false; + virStoragePoolObjSetActive(obj, false); =20 if (obj->def->source.adapter.type =3D=3D VIR_STORAGE_ADAPTER_TYPE_FC_HOST) { @@ -4702,7 +4702,7 @@ testStoragePoolGetInfo(virStoragePoolPtr pool, return -1; =20 memset(info, 0, sizeof(virStoragePoolInfo)); - if (obj->active) + if (virStoragePoolObjIsActive(obj)) info->state =3D VIR_STORAGE_POOL_RUNNING; else info->state =3D VIR_STORAGE_POOL_INACTIVE; --=20 2.9.5 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list