From 3bb75024da58a1432761c1469827e8b767298108 Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Thu, 26 Jul 2018 16:37:27 +0200 Subject: [PATCH] qemu_monitor: Fix regression in getting disk capacity MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In dbf990fd31e8 the qemuMonitorJSONBlockStatsUpdateCapacityOne() was split. However, due to a bug the return value was never set to something meaningful. Signed-off-by: Michal Privoznik Reviewed-by: Ján Tomko --- src/qemu/qemu_monitor_json.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 75d0738b5d..9acf62e0bb 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -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; -- GitLab