mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 13:45:38 +00:00
domain_conf: rewrite conditions in virDomainObjWaitUntil()
This patch rewrites conditions to make the code easier to read and less nested. Signed-off-by: Kristina Hanicova <khanicov@redhat.com> Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
parent
0f729b6ce0
commit
bad1206ce9
@ -4009,15 +4009,15 @@ int
|
||||
virDomainObjWaitUntil(virDomainObj *vm,
|
||||
unsigned long long whenms)
|
||||
{
|
||||
if (virCondWaitUntil(&vm->cond, &vm->parent.lock, whenms) < 0) {
|
||||
if (errno != ETIMEDOUT) {
|
||||
virReportSystemError(errno, "%s",
|
||||
_("failed to wait for domain condition"));
|
||||
return -1;
|
||||
}
|
||||
if (virCondWaitUntil(&vm->cond, &vm->parent.lock, whenms) >= 0)
|
||||
return 0;
|
||||
|
||||
if (errno == ETIMEDOUT)
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
|
||||
virReportSystemError(errno, "%s",
|
||||
_("failed to wait for domain condition"));
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user