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

[libvirt] [PATCH 7/6] net: Fix switching of transient domains to persistent



When assigning the new persistent definition for a transient network
(thus making it persistent) the network needs to be marked persistent
before actually atempting to assign the definition.
---
 src/network/bridge_driver.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
index 22bd99b..f0dbd66 100644
--- a/src/network/bridge_driver.c
+++ b/src/network/bridge_driver.c
@@ -2833,6 +2833,13 @@ static virNetworkPtr networkDefine(virConnectPtr conn, const char *xml) {
     if (networkValidate(driver, def, false) < 0)
        goto cleanup;

+    /* make the network persistent if we're defininig it */
+    if ((network = virNetworkFindByName(&driver->networks, def->name))) {
+        network->persistent = 1;
+        virNetworkObjUnlock(network);
+        network = NULL;
+    }
+
     if (!(network = virNetworkAssignDef(&driver->networks, def, false)))
         goto cleanup;
     freeDef = false;
-- 
1.7.12.4


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