]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu_monitor: Fix regression in getting disk capacity
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 26 Jul 2018 14:37:27 +0000 (16:37 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 26 Jul 2018 15:06:23 +0000 (17:06 +0200)
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 <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_monitor_json.c

index 75d0738b5dafc6ada28a8560a25ac19dd69d7886..9acf62e0bbe4cc70a6e5b2bacdc249c612ceb01d 100644 (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;