[libvirt] [PATCH 2/2] virsh: perf: Remove unnecessary 'error' label

Peter Krempa pkrempa at redhat.com
Thu Apr 21 07:56:20 UTC 2016


The only place that uses it doesn't warrant a separate label.
---
 tools/virsh-domain.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index 4a73a80..a9f70dc 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -8652,8 +8652,10 @@ cmdPerf(vshControl *ctl, const vshCmd *cmd)
             }
         }
     } else {
-        if (virDomainSetPerfEvents(dom, params, nparams, flags) != 0)
-            goto error;
+        if (virDomainSetPerfEvents(dom, params, nparams, flags) != 0) {
+            vshError(ctl, "%s", _("Unable to enable/disable perf events"));
+            goto cleanup;
+        }
     }

     ret = true;
@@ -8661,10 +8663,6 @@ cmdPerf(vshControl *ctl, const vshCmd *cmd)
     virTypedParamsFree(params, nparams);
     virDomainFree(dom);
     return ret;
-
- error:
-    vshError(ctl, "%s", _("Unable to enable/disable perf events"));
-    goto cleanup;
 }


-- 
2.8.1




More information about the libvir-list mailing list