[libvirt] [PATCH 14/22] qemu: driver: Remove pointless macro QEMU_BLOCK_STAT_TOTAL

Peter Krempa posted 22 patches 6 years, 4 months ago
[libvirt] [PATCH 14/22] qemu: driver: Remove pointless macro QEMU_BLOCK_STAT_TOTAL
Posted by Peter Krempa 6 years, 4 months ago
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
---
 src/qemu/qemu_driver.c | 20 ++++++++------------
 1 file changed, 8 insertions(+), 12 deletions(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index ab41e51700..2814d6825a 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -11415,18 +11415,14 @@ static int
 qemuDomainBlockStatsGatherTotals(qemuBlockStatsPtr data,
                                  qemuBlockStatsPtr total)
 {
-#define QEMU_BLOCK_STAT_TOTAL(NAME) \
-    total->NAME += data->NAME
-
-    QEMU_BLOCK_STAT_TOTAL(wr_bytes);
-    QEMU_BLOCK_STAT_TOTAL(wr_req);
-    QEMU_BLOCK_STAT_TOTAL(rd_bytes);
-    QEMU_BLOCK_STAT_TOTAL(rd_req);
-    QEMU_BLOCK_STAT_TOTAL(flush_req);
-    QEMU_BLOCK_STAT_TOTAL(wr_total_times);
-    QEMU_BLOCK_STAT_TOTAL(rd_total_times);
-    QEMU_BLOCK_STAT_TOTAL(flush_total_times);
-#undef QEMU_BLOCK_STAT_TOTAL
+    total->wr_bytes += data->wr_bytes;
+    total->wr_req += data->wr_req;
+    total->rd_bytes += data->rd_bytes;
+    total->rd_req += data->rd_req;
+    total->flush_req += data->flush_req;
+    total->wr_total_times += data->wr_total_times;
+    total->rd_total_times += data->rd_total_times;
+    total->flush_total_times += data->flush_total_times;
     return 0;
 }

-- 
2.21.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 14/22] qemu: driver: Remove pointless macro QEMU_BLOCK_STAT_TOTAL
Posted by Ján Tomko 6 years, 4 months ago
On Thu, Sep 19, 2019 at 07:13:17PM +0200, Peter Krempa wrote:
>Signed-off-by: Peter Krempa <pkrempa@redhat.com>
>---
> src/qemu/qemu_driver.c | 20 ++++++++------------
> 1 file changed, 8 insertions(+), 12 deletions(-)
>

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