]> xenbits.xensource.com Git - libvirt.git/commitdiff
storage: Use virStoragePoolObjGetDef accessor for MPATH backend
authorJohn Ferlan <jferlan@redhat.com>
Wed, 26 Jul 2017 18:28:16 +0000 (14:28 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Tue, 7 Nov 2017 19:12:52 +0000 (14:12 -0500)
In preparation for privatizing the object, use the accessor.

src/storage/storage_backend_mpath.c

index 46818ef2cc541c742a78f4a0158ef629f4dad4f0..4bc39c24eb14b9e6598b2cb74a8d740fed9a8d0f 100644 (file)
@@ -48,6 +48,7 @@ virStorageBackendMpathNewVol(virStoragePoolObjPtr pool,
                              const int devnum,
                              const char *dev)
 {
+    virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool);
     virStorageVolDefPtr vol;
     int ret = -1;
 
@@ -74,8 +75,8 @@ virStorageBackendMpathNewVol(virStoragePoolObjPtr pool,
     if (virStoragePoolObjAddVol(pool, vol) < 0)
         goto cleanup;
 
-    pool->def->capacity += vol->target.capacity;
-    pool->def->allocation += vol->target.allocation;
+    def->capacity += vol->target.capacity;
+    def->allocation += vol->target.allocation;
     ret = 0;
 
  cleanup:
@@ -259,10 +260,11 @@ virStorageBackendMpathRefreshPool(virConnectPtr conn ATTRIBUTE_UNUSED,
                                   virStoragePoolObjPtr pool)
 {
     int retval = 0;
+    virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool);
 
     VIR_DEBUG("conn=%p, pool=%p", conn, pool);
 
-    pool->def->allocation = pool->def->capacity = pool->def->available = 0;
+    def->allocation = def->capacity = def->available = 0;
 
     virWaitForDevices();