[libvirt] [PATCH] qemu: monitor: Fix incrementing of 'nstats' in qemuMonitorJSONBlockStatsCollectData

Peter Krempa posted 1 patch 5 years, 8 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/78f47a6395c0f71ca47fb5e328052db054508ddf.1533108269.git.pkrempa@redhat.com
Test syntax-check passed
src/qemu/qemu_monitor_json.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[libvirt] [PATCH] qemu: monitor: Fix incrementing of 'nstats' in qemuMonitorJSONBlockStatsCollectData
Posted by Peter Krempa 5 years, 8 months ago
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 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index 9acf62e0bb..2921f110a9 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -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); \
-- 
2.16.2

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] qemu: monitor: Fix incrementing of 'nstats' in qemuMonitorJSONBlockStatsCollectData
Posted by Ján Tomko 5 years, 8 months ago
On Wed, Aug 01, 2018 at 09:24:29AM +0200, Peter Krempa wrote:
>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 | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>

Reviewed-by: Ján Tomko <jtomko@redhat.com>

Jano
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list