From cf7392a0d263dc60a039d1f04a8e179ee6e62eb2 Mon Sep 17 00:00:00 2001 From: Erik Skultety Date: Mon, 9 Mar 2015 15:34:35 +0100 Subject: [PATCH] storage: Remove unused attribute conn from 'checkPool' callback In order to be able to use 'checkPool' inside functions which do not have any connection reference, 'conn' attribute needs to be discarded from the checkPool's signature, since it's not used by any storage backend anyway. --- src/storage/storage_backend.h | 3 +-- src/storage/storage_backend_fs.c | 3 +-- src/storage/storage_backend_iscsi.c | 3 +-- src/storage/storage_backend_logical.c | 3 +-- src/storage/storage_backend_mpath.c | 3 +-- src/storage/storage_backend_scsi.c | 3 +-- src/storage/storage_backend_zfs.c | 3 +-- src/storage/storage_driver.c | 2 +- 8 files changed, 8 insertions(+), 15 deletions(-) diff --git a/src/storage/storage_backend.h b/src/storage/storage_backend.h index 9f1db605fb..fd2451cf6a 100644 --- a/src/storage/storage_backend.h +++ b/src/storage/storage_backend.h @@ -34,8 +34,7 @@ typedef char * (*virStorageBackendFindPoolSources)(virConnectPtr conn, const char *srcSpec, unsigned int flags); -typedef int (*virStorageBackendCheckPool)(virConnectPtr conn, - virStoragePoolObjPtr pool, +typedef int (*virStorageBackendCheckPool)(virStoragePoolObjPtr pool, bool *active); typedef int (*virStorageBackendStartPool)(virConnectPtr conn, virStoragePoolObjPtr pool); diff --git a/src/storage/storage_backend_fs.c b/src/storage/storage_backend_fs.c index 35385db84f..d4d65bcf2e 100644 --- a/src/storage/storage_backend_fs.c +++ b/src/storage/storage_backend_fs.c @@ -533,8 +533,7 @@ virStorageBackendFileSystemUnmount(virStoragePoolObjPtr pool) static int -virStorageBackendFileSystemCheck(virConnectPtr conn ATTRIBUTE_UNUSED, - virStoragePoolObjPtr pool, +virStorageBackendFileSystemCheck(virStoragePoolObjPtr pool, bool *isActive) { if (pool->def->type == VIR_STORAGE_POOL_DIR) { diff --git a/src/storage/storage_backend_iscsi.c b/src/storage/storage_backend_iscsi.c index 079c767af4..497a71b66c 100644 --- a/src/storage/storage_backend_iscsi.c +++ b/src/storage/storage_backend_iscsi.c @@ -236,8 +236,7 @@ virStorageBackendISCSIFindPoolSources(virConnectPtr conn ATTRIBUTE_UNUSED, } static int -virStorageBackendISCSICheckPool(virConnectPtr conn ATTRIBUTE_UNUSED, - virStoragePoolObjPtr pool, +virStorageBackendISCSICheckPool(virStoragePoolObjPtr pool, bool *isActive) { char *session = NULL; diff --git a/src/storage/storage_backend_logical.c b/src/storage/storage_backend_logical.c index 7ba8ded55b..11c5683884 100644 --- a/src/storage/storage_backend_logical.c +++ b/src/storage/storage_backend_logical.c @@ -479,8 +479,7 @@ virStorageBackendLogicalFindPoolSources(virConnectPtr conn ATTRIBUTE_UNUSED, static int -virStorageBackendLogicalCheckPool(virConnectPtr conn ATTRIBUTE_UNUSED, - virStoragePoolObjPtr pool, +virStorageBackendLogicalCheckPool(virStoragePoolObjPtr pool, bool *isActive) { *isActive = virFileExists(pool->def->target.path); diff --git a/src/storage/storage_backend_mpath.c b/src/storage/storage_backend_mpath.c index 44bcd60ddf..971408a817 100644 --- a/src/storage/storage_backend_mpath.c +++ b/src/storage/storage_backend_mpath.c @@ -245,8 +245,7 @@ virStorageBackendGetMaps(virStoragePoolObjPtr pool) } static int -virStorageBackendMpathCheckPool(virConnectPtr conn ATTRIBUTE_UNUSED, - virStoragePoolObjPtr pool ATTRIBUTE_UNUSED, +virStorageBackendMpathCheckPool(virStoragePoolObjPtr pool ATTRIBUTE_UNUSED, bool *isActive) { *isActive = virFileExists("/dev/mpath"); diff --git a/src/storage/storage_backend_scsi.c b/src/storage/storage_backend_scsi.c index 58e7e6d060..66e0846cc6 100644 --- a/src/storage/storage_backend_scsi.c +++ b/src/storage/storage_backend_scsi.c @@ -844,8 +844,7 @@ deleteVport(virConnectPtr conn, static int -virStorageBackendSCSICheckPool(virConnectPtr conn ATTRIBUTE_UNUSED, - virStoragePoolObjPtr pool, +virStorageBackendSCSICheckPool(virStoragePoolObjPtr pool, bool *isActive) { char *path = NULL; diff --git a/src/storage/storage_backend_zfs.c b/src/storage/storage_backend_zfs.c index 948270680c..cb2662a27e 100644 --- a/src/storage/storage_backend_zfs.c +++ b/src/storage/storage_backend_zfs.c @@ -41,8 +41,7 @@ VIR_LOG_INIT("storage.storage_backend_zfs"); static int -virStorageBackendZFSCheckPool(virConnectPtr conn ATTRIBUTE_UNUSED, - virStoragePoolObjPtr pool ATTRIBUTE_UNUSED, +virStorageBackendZFSCheckPool(virStoragePoolObjPtr pool ATTRIBUTE_UNUSED, bool *isActive) { char *devpath; diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c index b95506faf5..64ea770d23 100644 --- a/src/storage/storage_driver.c +++ b/src/storage/storage_driver.c @@ -100,7 +100,7 @@ storageDriverAutostart(void) } if (backend->checkPool && - backend->checkPool(conn, pool, &started) < 0) { + backend->checkPool(pool, &started) < 0) { virErrorPtr err = virGetLastError(); VIR_ERROR(_("Failed to initialize storage pool '%s': %s"), pool->def->name, err ? err->message : -- GitLab