mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-09 06:25:19 +00:00
virCHDomainObjBeginJob: Cleanup
Remove unnecessary label and goto. Signed-off-by: Tim Wiederhake <twiederh@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
7badb6eeeb
commit
cf1177178e
@ -87,8 +87,22 @@ virCHDomainObjBeginJob(virDomainObj *obj, enum virCHDomainJob job)
|
|||||||
while (priv->job.active) {
|
while (priv->job.active) {
|
||||||
VIR_DEBUG("Wait normal job condition for starting job: %s",
|
VIR_DEBUG("Wait normal job condition for starting job: %s",
|
||||||
virCHDomainJobTypeToString(job));
|
virCHDomainJobTypeToString(job));
|
||||||
if (virCondWaitUntil(&priv->job.cond, &obj->parent.lock, then) < 0)
|
if (virCondWaitUntil(&priv->job.cond, &obj->parent.lock, then) < 0) {
|
||||||
goto error;
|
VIR_WARN("Cannot start job (%s) for domain %s;"
|
||||||
|
" current job is (%s) owned by (%d)",
|
||||||
|
virCHDomainJobTypeToString(job),
|
||||||
|
obj->def->name,
|
||||||
|
virCHDomainJobTypeToString(priv->job.active),
|
||||||
|
priv->job.owner);
|
||||||
|
|
||||||
|
if (errno == ETIMEDOUT)
|
||||||
|
virReportError(VIR_ERR_OPERATION_TIMEOUT,
|
||||||
|
"%s", _("cannot acquire state change lock"));
|
||||||
|
else
|
||||||
|
virReportSystemError(errno,
|
||||||
|
"%s", _("cannot acquire job mutex"));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
virCHDomainObjResetJob(priv);
|
virCHDomainObjResetJob(priv);
|
||||||
@ -98,22 +112,6 @@ virCHDomainObjBeginJob(virDomainObj *obj, enum virCHDomainJob job)
|
|||||||
priv->job.owner = virThreadSelfID();
|
priv->job.owner = virThreadSelfID();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
error:
|
|
||||||
VIR_WARN("Cannot start job (%s) for domain %s;"
|
|
||||||
" current job is (%s) owned by (%d)",
|
|
||||||
virCHDomainJobTypeToString(job),
|
|
||||||
obj->def->name,
|
|
||||||
virCHDomainJobTypeToString(priv->job.active),
|
|
||||||
priv->job.owner);
|
|
||||||
|
|
||||||
if (errno == ETIMEDOUT)
|
|
||||||
virReportError(VIR_ERR_OPERATION_TIMEOUT,
|
|
||||||
"%s", _("cannot acquire state change lock"));
|
|
||||||
else
|
|
||||||
virReportSystemError(errno,
|
|
||||||
"%s", _("cannot acquire job mutex"));
|
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user