api: virDomainMemoryStats: use 'ret' variable

Instead of 'nr_stats_ret'. Also reduce its scope.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
Ján Tomko 2020-09-23 18:44:14 +02:00
parent 0a109dc9e3
commit bcc920e474

View File

@ -5741,7 +5741,6 @@ virDomainMemoryStats(virDomainPtr dom, virDomainMemoryStatPtr stats,
unsigned int nr_stats, unsigned int flags)
{
virConnectPtr conn;
unsigned long nr_stats_ret = 0;
VIR_DOMAIN_DEBUG(dom, "stats=%p, nr_stats=%u, flags=0x%x",
stats, nr_stats, flags);
@ -5758,11 +5757,10 @@ virDomainMemoryStats(virDomainPtr dom, virDomainMemoryStatPtr stats,
conn = dom->conn;
if (conn->driver->domainMemoryStats) {
nr_stats_ret = conn->driver->domainMemoryStats(dom, stats, nr_stats,
flags);
if (nr_stats_ret == -1)
int ret = conn->driver->domainMemoryStats(dom, stats, nr_stats, flags);
if (ret == -1)
goto error;
return nr_stats_ret;
return ret;
}
virReportUnsupportedError();