[libvirt PATCH 02/10] virCHDomainObjBeginJob: Cleanup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Remove unnecessary label and goto.

Signed-off-by: Tim Wiederhake <twiederh@xxxxxxxxxx>
---
 src/ch/ch_domain.c | 34 ++++++++++++++++------------------
 1 file changed, 16 insertions(+), 18 deletions(-)

diff --git a/src/ch/ch_domain.c b/src/ch/ch_domain.c
index 9d32d8669a..dd4de9e1ea 100644
--- a/src/ch/ch_domain.c
+++ b/src/ch/ch_domain.c
@@ -87,8 +87,22 @@ virCHDomainObjBeginJob(virDomainObj *obj, enum virCHDomainJob job)
     while (priv->job.active) {
         VIR_DEBUG("Wait normal job condition for starting job: %s",
                   virCHDomainJobTypeToString(job));
-        if (virCondWaitUntil(&priv->job.cond, &obj->parent.lock, then) < 0)
-            goto error;
+        if (virCondWaitUntil(&priv->job.cond, &obj->parent.lock, then) < 0) {
+            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);
@@ -98,22 +112,6 @@ virCHDomainObjBeginJob(virDomainObj *obj, enum virCHDomainJob job)
     priv->job.owner = virThreadSelfID();
 
     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;
 }
 
 /*
-- 
2.31.1




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux