mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 09:17:52 +03:00
lxc: Allow to undefine a running domain
This commit is contained in:
parent
0f407570b4
commit
b375fc01e2
@ -479,12 +479,6 @@ static int lxcDomainUndefineFlags(virDomainPtr dom,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (virDomainObjIsActive(vm)) {
|
|
||||||
lxcError(VIR_ERR_OPERATION_INVALID,
|
|
||||||
"%s", _("Cannot delete active domain"));
|
|
||||||
goto cleanup;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!vm->persistent) {
|
if (!vm->persistent) {
|
||||||
lxcError(VIR_ERR_OPERATION_INVALID,
|
lxcError(VIR_ERR_OPERATION_INVALID,
|
||||||
"%s", _("Cannot undefine transient domain"));
|
"%s", _("Cannot undefine transient domain"));
|
||||||
@ -500,8 +494,13 @@ static int lxcDomainUndefineFlags(virDomainPtr dom,
|
|||||||
VIR_DOMAIN_EVENT_UNDEFINED,
|
VIR_DOMAIN_EVENT_UNDEFINED,
|
||||||
VIR_DOMAIN_EVENT_UNDEFINED_REMOVED);
|
VIR_DOMAIN_EVENT_UNDEFINED_REMOVED);
|
||||||
|
|
||||||
|
if (virDomainObjIsActive(vm)) {
|
||||||
|
vm->persistent = 0;
|
||||||
|
} else {
|
||||||
virDomainRemoveInactive(&driver->domains, vm);
|
virDomainRemoveInactive(&driver->domains, vm);
|
||||||
vm = NULL;
|
vm = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
|
Loading…
Reference in New Issue
Block a user