diff options
author | Daniel P. Berrange <berrange@redhat.com> | 2010-11-11 20:09:20 +0000 |
---|---|---|
committer | Daniel P. Berrange <berrange@redhat.com> | 2010-11-23 15:00:35 +0000 |
commit | 1b7e0b1a9c3e94e77b2d9b09d6002167f02ad25e (patch) | |
tree | d81ff67f1a2cb6aaf2d0a90cfb3bd37a600b415e /src/storage/storage_backend.h | |
parent | Remove bogus port handling code in virsh (diff) | |
download | libvirt-1b7e0b1a9c3e94e77b2d9b09d6002167f02ad25e.tar.gz libvirt-1b7e0b1a9c3e94e77b2d9b09d6002167f02ad25e.tar.bz2 libvirt-1b7e0b1a9c3e94e77b2d9b09d6002167f02ad25e.zip |
Check whether pools are already active upon libvirtd startup
When libvirt starts up all storage pools default to the inactive
state, even if the underlying storage is already active on the
host. This introduces a new API into the internal storage backend
drivers that checks whether a storage pool is already active. If
the pool is active at libvirtd startup, the volume list will be
immediately populated.
* src/storage/storage_backend.h: New internal API for checking
storage pool state
* src/storage/storage_driver.c: Check whether a pool is active
upon driver startup
* src/storage/storage_backend_fs.c, src/storage/storage_backend_iscsi.c,
src/storage/storage_backend_logical.c, src/storage/storage_backend_mpath.c,
src/storage/storage_backend_scsi.c: Add checks for pool state
Diffstat (limited to 'src/storage/storage_backend.h')
-rw-r--r-- | src/storage/storage_backend.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/storage/storage_backend.h b/src/storage/storage_backend.h index 1165a45f3..6f395c767 100644 --- a/src/storage/storage_backend.h +++ b/src/storage/storage_backend.h @@ -25,10 +25,12 @@ # define __VIR_STORAGE_BACKEND_H__ # include <stdint.h> +# include <stdbool.h> # include "internal.h" # include "storage_conf.h" typedef char * (*virStorageBackendFindPoolSources)(virConnectPtr conn, const char *srcSpec, unsigned int flags); +typedef int (*virStorageBackendCheckPool)(virConnectPtr conn, virStoragePoolObjPtr pool, bool *active); typedef int (*virStorageBackendStartPool)(virConnectPtr conn, virStoragePoolObjPtr pool); typedef int (*virStorageBackendBuildPool)(virConnectPtr conn, virStoragePoolObjPtr pool, unsigned int flags); typedef int (*virStorageBackendRefreshPool)(virConnectPtr conn, virStoragePoolObjPtr pool); @@ -65,6 +67,7 @@ struct _virStorageBackend { int type; virStorageBackendFindPoolSources findPoolSources; + virStorageBackendCheckPool checkPool; virStorageBackendStartPool startPool; virStorageBackendBuildPool buildPool; virStorageBackendRefreshPool refreshPool; |