]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: monitor: Fix incrementing of 'nstats' in qemuMonitorJSONBlockStatsCollectData
authorPeter Krempa <pkrempa@redhat.com>
Wed, 1 Aug 2018 07:15:22 +0000 (09:15 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 1 Aug 2018 07:15:22 +0000 (09:15 +0200)
commit 8d9ca6cdb3a5 refactored qemuMonitorJSONBlockStatsCollectData so
that the number of stats is passed back via a pointer. The commit failed
to fix the macro which increments the number of stats to increment the
actual pointee.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
src/qemu/qemu_monitor_json.c

index 9acf62e0bbe4cc70a6e5b2bacdc249c612ceb01d..2921f110a94324c3b40234dac8e54d11cec43813 100644 (file)
@@ -2299,7 +2299,7 @@ qemuMonitorJSONBlockStatsCollectData(virJSONValuePtr dev,
 
 #define QEMU_MONITOR_BLOCK_STAT_GET(NAME, VAR, MANDATORY) \
     if (MANDATORY || virJSONValueObjectHasKey(stats, NAME)) { \
-        nstats++; \
+        (*nstats)++; \
         if (virJSONValueObjectGetNumberLong(stats, NAME, &VAR) < 0) { \
             virReportError(VIR_ERR_INTERNAL_ERROR, \
                            _("cannot read %s statistic"), NAME); \