qemuMonitorJSONGetMigrationStats: Don't clear @stats on failure

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>
This commit is contained in:
Michal Privoznik 2021-10-22 07:07:09 +02:00
parent a70ae22cfd
commit 4e8bb57859

View 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;