]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemuMonitorJSONGetMigrationStats: Don't clear @stats on failure
authorMichal Privoznik <mprivozn@redhat.com>
Fri, 22 Oct 2021 05:07:09 +0000 (07:07 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 25 Oct 2021 11:42:19 +0000 (13:42 +0200)
In the qemuMonitorJSONGetMigrationStats() there's a code under
cleanup label that's clearing returned @stats if the function
returns with an error. However, transitively there's just one
caller - qemuMigrationAnyFetchStats() - and it doesn't care for
this behaviour. Drop the code to simplify the cleanup label.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
src/qemu/qemu_monitor_json.c

index 7833038a0666b6a73e1832bc4ca4091f6c7c2d22..bcbb4e59abf8cb44147ced460d073665b8f84ecc 100644 (file)
@@ -3542,8 +3542,6 @@ int qemuMonitorJSONGetMigrationStats(qemuMonitor *mon,
 
     ret = 0;
  cleanup:
-    if (ret < 0)
-        memset(stats, 0, sizeof(*stats));
     virJSONValueFree(cmd);
     virJSONValueFree(reply);
     return ret;