mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 17:34:18 +03:00
openvz: start using virDomainObjCheckActive
Signed-off-by: Clementine Hayat <clem@lse.epita.fr> Reviewed-by: Ján Tomko <jtomko@redhat.com> Signed-off-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
1e68a86454
commit
7987780779
@ -571,11 +571,8 @@ static int openvzDomainSuspend(virDomainPtr dom)
|
||||
if (!(vm = openvzDomObjFromDomain(driver, dom->uuid)))
|
||||
return -1;
|
||||
|
||||
if (!virDomainObjIsActive(vm)) {
|
||||
virReportError(VIR_ERR_OPERATION_INVALID, "%s",
|
||||
_("Domain is not running"));
|
||||
if (virDomainObjCheckActive(vm) < 0)
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (virDomainObjGetState(vm, NULL) != VIR_DOMAIN_PAUSED) {
|
||||
openvzSetProgramSentinal(prog, vm->def->name);
|
||||
@ -601,11 +598,8 @@ static int openvzDomainResume(virDomainPtr dom)
|
||||
if (!(vm = openvzDomObjFromDomain(driver, dom->uuid)))
|
||||
return -1;
|
||||
|
||||
if (!virDomainObjIsActive(vm)) {
|
||||
virReportError(VIR_ERR_OPERATION_INVALID, "%s",
|
||||
_("Domain is not running"));
|
||||
if (virDomainObjCheckActive(vm) < 0)
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (virDomainObjGetState(vm, NULL) == VIR_DOMAIN_PAUSED) {
|
||||
openvzSetProgramSentinal(prog, vm->def->name);
|
||||
@ -1891,11 +1885,8 @@ openvzDomainInterfaceStats(virDomainPtr dom,
|
||||
if (!(vm = openvzDomObjFromDomain(driver, dom->uuid)))
|
||||
return -1;
|
||||
|
||||
if (!virDomainObjIsActive(vm)) {
|
||||
virReportError(VIR_ERR_OPERATION_INVALID,
|
||||
"%s", _("domain is not running"));
|
||||
if (virDomainObjCheckActive(vm) < 0)
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (!(net = virDomainNetFind(vm->def, device)))
|
||||
goto cleanup;
|
||||
@ -2131,11 +2122,8 @@ openvzDomainMigrateBegin3Params(virDomainPtr domain,
|
||||
if (!(vm = openvzDomObjFromDomain(driver, domain->uuid)))
|
||||
return NULL;
|
||||
|
||||
if (!virDomainObjIsActive(vm)) {
|
||||
virReportError(VIR_ERR_OPERATION_INVALID,
|
||||
"%s", _("domain is not running"));
|
||||
if (virDomainObjCheckActive(vm) < 0)
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (openvzGetVEStatus(vm, &status, NULL) == -1)
|
||||
goto cleanup;
|
||||
|
Loading…
Reference in New Issue
Block a user