]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Ensure transient def is removed if LXC start fails
authorDaniel P. Berrange <berrange@redhat.com>
Fri, 23 Nov 2012 16:40:16 +0000 (16:40 +0000)
committerCole Robinson <crobinso@redhat.com>
Sun, 9 Dec 2012 21:53:40 +0000 (16:53 -0500)
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 lose the new data being defined.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
(cherry picked from commit 9d2bfc1ca78eb7106e5d189b9d21ad47e1826e50)

src/lxc/lxc_process.c

index e611634e087cdbd0c1d48d2ae066e05620d64b3d..ae0b733afd8162fbf572b806b0b6476e4e13b4b5 100644 (file)
@@ -1184,6 +1184,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;