mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 21:34:54 +03:00
openvz: Allow to undefine a running domain
This commit is contained in:
parent
b375fc01e2
commit
ea92a34d1d
@ -1132,19 +1132,18 @@ openvzDomainUndefineFlags(virDomainPtr dom,
|
||||
if (openvzGetVEStatus(vm, &status, NULL) == -1)
|
||||
goto cleanup;
|
||||
|
||||
if (status != VIR_DOMAIN_SHUTOFF) {
|
||||
openvzError(VIR_ERR_OPERATION_INVALID, "%s",
|
||||
_("cannot delete active domain"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
openvzSetProgramSentinal(prog, vm->def->name);
|
||||
if (virRun(prog, NULL) < 0) {
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
virDomainRemoveInactive(&driver->domains, vm);
|
||||
vm = NULL;
|
||||
if (virDomainObjIsActive(vm)) {
|
||||
vm->persistent = 0;
|
||||
} else {
|
||||
virDomainRemoveInactive(&driver->domains, vm);
|
||||
vm = NULL;
|
||||
}
|
||||
|
||||
ret = 0;
|
||||
|
||||
cleanup:
|
||||
|
Loading…
Reference in New Issue
Block a user