[PATCH 08/10] Ensure transient def is removed if LXC start fails

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

 



From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>

When starting a container, newDef is initialized to a
copy of 'def', but when startup fails newDef is never
removed. This cause later attempts to use 'virDomainDefine'
to loose the new data being defined.

Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx>
---
 src/lxc/lxc_process.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/lxc/lxc_process.c b/src/lxc/lxc_process.c
index 6cfbb0d..28eecec 100644
--- a/src/lxc/lxc_process.c
+++ b/src/lxc/lxc_process.c
@@ -1199,6 +1199,10 @@ cleanup:
         VIR_FREE(veths[i]);
     }
     if (rc != 0) {
+        if (vm->newDef) {
+            virDomainDefFree(vm->newDef);
+            vm->newDef = NULL;
+        }
         if (priv->monitor) {
             virObjectUnref(priv->monitor);
             priv->monitor = NULL;
-- 
1.7.11.2

--
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]