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

[libvirt] [PATCH 23/48] list: Implement listAllNetworks for network driver



src/network/bridge_driver.c: Implement listAllNetworks.
---
 src/network/bridge_driver.c |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
index a5046f1..0b5cc85 100644
--- a/src/network/bridge_driver.c
+++ b/src/network/bridge_driver.c
@@ -2201,6 +2201,22 @@ static int networkListDefinedNetworks(virConnectPtr conn, char **const names, in
     return -1;
 }
 
+static int
+networkListAllNetworks(virConnectPtr conn,
+                       virNetworkPtr **nets,
+                       unsigned int flags)
+{
+    struct network_driver *driver = conn->networkPrivateData;
+    int ret = -1;
+
+    virCheckFlags(VIR_CONNECT_LIST_NETWORKS_FILTERS_ALL, -1);
+
+    networkDriverLock(driver);
+    ret = virNetworkList(conn, driver->networks, nets, flags);
+    networkDriverUnlock(driver);
+
+    return ret;
+}
 
 static int networkIsActive(virNetworkPtr net)
 {
@@ -2689,6 +2705,7 @@ static virNetworkDriver networkDriver = {
     .listNetworks = networkListNetworks, /* 0.2.0 */
     .numOfDefinedNetworks = networkNumDefinedNetworks, /* 0.2.0 */
     .listDefinedNetworks = networkListDefinedNetworks, /* 0.2.0 */
+    .listAllNetworks = networkListAllNetworks, /* 0.10.0 */
     .networkLookupByUUID = networkLookupByUUID, /* 0.2.0 */
     .networkLookupByName = networkLookupByName, /* 0.2.0 */
     .networkCreateXML = networkCreate, /* 0.2.0 */
-- 
1.7.7.3


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