[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH 07/50] list: Implement listAllStoragePools for storage driver



src/storage/storage_driver.c: Implement listAllStoragePools.
---
 src/storage/storage_driver.c |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c
index 39dc13b..1356a96 100644
--- a/src/storage/storage_driver.c
+++ b/src/storage/storage_driver.c
@@ -42,6 +42,7 @@
 #include "util.h"
 #include "storage_driver.h"
 #include "storage_conf.h"
+#include "virobjectlist.h"
 #include "memory.h"
 #include "storage_backend.h"
 #include "logging.h"
@@ -2289,6 +2290,23 @@ cleanup:
     return ret;
 }
 
+static int
+storageListAllPools(virConnectPtr conn,
+                    virStoragePoolPtr **pools,
+                    unsigned int flags)
+{
+    virStorageDriverStatePtr driver = conn->storagePrivateData;
+    int ret = -1;
+
+    virCheckFlags(VIR_CONNECT_LIST_STORAGE_POOLS_FILTERS_ALL, -1);
+
+    storageDriverLock(driver);
+    ret = virStoragePoolList(conn, driver->pools, pools, flags);
+    storageDriverUnlock(driver);
+
+    return ret;
+}
+
 static virStorageDriver storageDriver = {
     .name = "storage",
     .open = storageOpen, /* 0.4.0 */
@@ -2297,6 +2315,7 @@ static virStorageDriver storageDriver = {
     .listPools = storageListPools, /* 0.4.0 */
     .numOfDefinedPools = storageNumDefinedPools, /* 0.4.0 */
     .listDefinedPools = storageListDefinedPools, /* 0.4.0 */
+    .listAllPools = storageListAllPools, /* 0.9.14 */
     .findPoolSources = storageFindPoolSources, /* 0.4.0 */
     .poolLookupByName = storagePoolLookupByName, /* 0.4.0 */
     .poolLookupByUUID = storagePoolLookupByUUID, /* 0.4.0 */
-- 
1.7.7.3


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]