mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 11:22:23 +00:00
Ensure transient def is removed if LXC start fails
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>
This commit is contained in:
parent
43db9cf4ed
commit
9d2bfc1ca7
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user