]> xenbits.xensource.com Git - libvirt.git/commitdiff
Fix error when starting a container after an error
authorCédric Bosdonnat <cbosdonnat@suse.com>
Thu, 18 Dec 2014 14:42:06 +0000 (15:42 +0100)
committerCédric Bosdonnat <cbosdonnat@suse.com>
Mon, 5 Jan 2015 17:43:32 +0000 (18:43 +0100)
The typical case for the problem is starting a domain needing a network
that isn't started. Even after starting the network, we get an unknown error
when starting the container.

This is due to dynamic security label not being removed.

src/lxc/lxc_process.c

index 1c0d4e5bf1dbc842fad4456459d73ee58f07c94d..d7eb8bc86fa21bcae9c353afc5763b3e92e21b80 100644 (file)
@@ -1372,6 +1372,7 @@ int virLXCProcessStart(virConnectPtr conn,
             VIR_FREE(vm->def->seclabels[0]->model);
             VIR_FREE(vm->def->seclabels[0]->label);
             VIR_FREE(vm->def->seclabels[0]->imagelabel);
+            VIR_DELETE_ELEMENT(vm->def->seclabels, 0, vm->def->nseclabels);
         }
     }
     for (i = 0; i < nttyFDs; i++)