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

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

 



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

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]