qemu_monitor: Fix regression in getting disk capacity

In dbf990fd31 the qemuMonitorJSONBlockStatsUpdateCapacityOne()
was split. However, due to a bug the return value was never set
to something meaningful.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Michal Privoznik 2018-07-26 16:37:27 +02:00
parent 9e66ecb5ea
commit 3bb75024da
1 changed files with 8 additions and 7 deletions

View File

@ -2492,14 +2492,15 @@ qemuMonitorJSONBlockStatsUpdateCapacityOne(virJSONValuePtr image,
goto cleanup;
if (backingChain &&
(backing = virJSONValueObjectGetObject(image, "backing-image"))) {
ret = qemuMonitorJSONBlockStatsUpdateCapacityOne(backing,
dev_name,
depth + 1,
stats,
true);
}
(backing = virJSONValueObjectGetObject(image, "backing-image")) &&
qemuMonitorJSONBlockStatsUpdateCapacityOne(backing,
dev_name,
depth + 1,
stats,
true) < 0)
goto cleanup;
ret = 0;
cleanup:
VIR_FREE(entry_name);
return ret;