]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu_monitor_json.c: remove unneeded cleanup label
authorDaniel Henrique Barboza <danielhb413@gmail.com>
Mon, 21 Oct 2019 18:18:59 +0000 (15:18 -0300)
committerJán Tomko <jtomko@redhat.com>
Tue, 12 Nov 2019 16:54:01 +0000 (17:54 +0100)
qemuMonitorJSONBlockIoThrottleInfo uses a macro called
GET_THROTTLE_STATS that's defined outside of the function,
which references a 'cleanup' label. GET_THROTTLE_STATS is
only used inside qemuMonitorJSONBlockIoThrottleInfo (in fact,
the macro is undef right after it) thus it is safe to erase
the 'cleanup' reference inside the macro, then proceed
with the usual cleanup label removal inside
qemuMonitorJSONBlockIoThrottleInfo.

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_monitor_json.c

index d66c58fedafae80cb34c9deb62765f16e6744642..10f6a4cadc89eba4596d28e8c7c0f7a301301fa2 100644 (file)
@@ -5192,7 +5192,7 @@ int qemuMonitorJSONOpenGraphics(qemuMonitorPtr mon,
                        _("block_io_throttle field '%s' missing " \
                          "in qemu's output"), \
                        #STORE); \
-        goto cleanup; \
+        return -1; \
     }
 static int
 qemuMonitorJSONBlockIoThrottleInfo(virJSONValuePtr io_throttle,
@@ -5200,7 +5200,6 @@ qemuMonitorJSONBlockIoThrottleInfo(virJSONValuePtr io_throttle,
                                    const char *qdevid,
                                    virDomainBlockIoTuneInfoPtr reply)
 {
-    int ret = -1;
     size_t i;
     bool found = false;
 
@@ -5214,7 +5213,7 @@ qemuMonitorJSONBlockIoThrottleInfo(virJSONValuePtr io_throttle,
             virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
                            _("block_io_throttle device entry "
                              "was not in expected format"));
-            goto cleanup;
+            return -1;
         }
 
         current_qdev = virJSONValueObjectGetString(temp_dev, "qdev");
@@ -5224,7 +5223,7 @@ qemuMonitorJSONBlockIoThrottleInfo(virJSONValuePtr io_throttle,
             virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
                            _("block_io_throttle device entry "
                              "was not in expected format"));
-            goto cleanup;
+            return -1;
         }
 
         if ((drivealias && current_drive && STRNEQ(current_drive, drivealias)) ||
@@ -5236,7 +5235,7 @@ qemuMonitorJSONBlockIoThrottleInfo(virJSONValuePtr io_throttle,
             virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
                            _("block_io_throttle inserted entry "
                              "was not in expected format"));
-            goto cleanup;
+            return -1;
         }
         GET_THROTTLE_STATS("bps", total_bytes_sec);
         GET_THROTTLE_STATS("bps_rd", read_bytes_sec);
@@ -5268,12 +5267,10 @@ qemuMonitorJSONBlockIoThrottleInfo(virJSONValuePtr io_throttle,
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("cannot find throttling info for device '%s'"),
                        drivealias ? drivealias : qdevid);
-        goto cleanup;
+        return -1;
     }
-    ret = 0;
 
- cleanup:
-    return ret;
+    return 0;
 }
 #undef GET_THROTTLE_STATS
 #undef GET_THROTTLE_STATS_OPTIONAL