提交 b375fc01 编写于 作者: O Osier Yang

lxc: Allow to undefine a running domain

上级 0f407570
......@@ -479,12 +479,6 @@ static int lxcDomainUndefineFlags(virDomainPtr dom,
goto cleanup;
}
if (virDomainObjIsActive(vm)) {
lxcError(VIR_ERR_OPERATION_INVALID,
"%s", _("Cannot delete active domain"));
goto cleanup;
}
if (!vm->persistent) {
lxcError(VIR_ERR_OPERATION_INVALID,
"%s", _("Cannot undefine transient domain"));
......@@ -500,8 +494,13 @@ static int lxcDomainUndefineFlags(virDomainPtr dom,
VIR_DOMAIN_EVENT_UNDEFINED,
VIR_DOMAIN_EVENT_UNDEFINED_REMOVED);
virDomainRemoveInactive(&driver->domains, vm);
vm = NULL;
if (virDomainObjIsActive(vm)) {
vm->persistent = 0;
} else {
virDomainRemoveInactive(&driver->domains, vm);
vm = NULL;
}
ret = 0;
cleanup:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册