]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
tests: virnetdev*: remove unnecessary labels
authorJán Tomko <jtomko@redhat.com>
Fri, 20 Aug 2021 13:11:52 +0000 (15:11 +0200)
committerJán Tomko <jtomko@redhat.com>
Fri, 20 Aug 2021 14:43:20 +0000 (16:43 +0200)
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
tests/virnetdevbandwidthtest.c
tests/virnetdevopenvswitchtest.c

index a17737ec401cfd3827b1a42dfef495d2a851ad0b..eb4f47dfce1501440cc82c7a3d34b27bbecc9c79 100644 (file)
@@ -63,7 +63,6 @@ testVirNetDevBandwidthParse(virNetDevBandwidth **var,
 static int
 testVirNetDevBandwidthSet(const void *data)
 {
-    int ret = -1;
     const struct testSetStruct *info = data;
     const char *iface = info->iface;
     g_autoptr(virNetDevBandwidth) band = NULL;
@@ -80,7 +79,7 @@ testVirNetDevBandwidthSet(const void *data)
     virCommandSetDryRun(dryRunToken, &buf, false, false, NULL, NULL);
 
     if (virNetDevBandwidthSet(iface, band, info->hierarchical_class, true) < 0)
-        goto cleanup;
+        return -1;
 
     if (!(actual_cmd = virBufferContentAndReset(&buf))) {
         /* This is interesting, no command has been executed.
@@ -91,12 +90,10 @@ testVirNetDevBandwidthSet(const void *data)
         virTestDifference(stderr,
                           NULLSTR(info->exp_cmd),
                           NULLSTR(actual_cmd));
-        goto cleanup;
+        return -1;
     }
 
-    ret = 0;
- cleanup:
-    return ret;
+    return 0;
 }
 
 static int
index 1026c890cd24a68218a2d6c3b9a061a9abe99494..2a20ba82d09e41ddc80e4e31b6e7a61eac1d3cf7 100644 (file)
@@ -152,7 +152,6 @@ testNameEscape(const void *opaque)
 static int
 testVirNetDevOpenvswitchInterfaceSetQos(const void *data)
 {
-    int ret = -1;
     const struct testSetQosStruct *info = data;
     const char *iface = info->iface;
     g_autoptr(virNetDevBandwidth) band = NULL;
@@ -169,7 +168,7 @@ testVirNetDevOpenvswitchInterfaceSetQos(const void *data)
     virCommandSetDryRun(dryRunToken, &buf, false, false, NULL, NULL);
 
     if (virNetDevOpenvswitchInterfaceSetQos(iface, band, vm_id, true) < 0)
-        goto cleanup;
+        return -1;
 
     if (!(actual_cmd = virBufferContentAndReset(&buf))) {
         /* This is interesting, no command has been executed.
@@ -180,19 +179,16 @@ testVirNetDevOpenvswitchInterfaceSetQos(const void *data)
         virTestDifference(stderr,
                           NULLSTR(info->exp_cmd),
                           NULLSTR(actual_cmd));
-        goto cleanup;
+        return -1;
     }
 
-    ret = 0;
-    cleanup:
-    return ret;
+    return 0;
 }
 
 
 static int
 testVirNetDevOpenvswitchInterfaceClearQos(const void *data)
 {
-    int ret = -1;
     const struct testClearQosStruct *info = data;
     g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
     g_autofree char *actual_cmd = NULL;
@@ -203,7 +199,7 @@ testVirNetDevOpenvswitchInterfaceClearQos(const void *data)
     virCommandSetDryRun(dryRunToken, &buf, false, false, NULL, NULL);
 
     if (virNetDevOpenvswitchInterfaceClearQos(iface, vmid) < 0)
-        goto cleanup;
+        return -1;
 
     if (!(actual_cmd = virBufferContentAndReset(&buf))) {
         /* This is interesting, no command has been executed.
@@ -214,12 +210,10 @@ testVirNetDevOpenvswitchInterfaceClearQos(const void *data)
         virTestDifference(stderr,
                           NULLSTR(info->exp_cmd),
                           NULLSTR(actual_cmd));
-        goto cleanup;
+        return -1;
     }
 
-    ret = 0;
-    cleanup:
-    return ret;
+    return 0;
 }
 
 static int