[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [RFC PATCH 16/56] migration: Make XBZRLE transferred size u
From: |
Markus Armbruster |
Subject: |
[Qemu-block] [RFC PATCH 16/56] migration: Make XBZRLE transferred size unsigned in QAPI/QMP |
Date: |
Mon, 7 Aug 2017 16:45:20 +0200 |
Sizes should use QAPI type 'size' (uint64_t). XBZRLECacheStats member
@bytes is 'int' (int64_t). save_xbzrle_page() computes the byte count
increment in size_t, implicitly converts it to int, then adds that to
@bytes.
Change the XBZRLECacheStats member to 'size' and clean up
save_xbzrle_page().
query-migrate now reports transferred sizes above 2^63-1 correctly
instead of their (negative) two's complement.
HMP's "info migrate" already reported them correctly, because it
printed the signed integer with PRIu64.
Signed-off-by: Markus Armbruster <address@hidden>
---
migration/ram.c | 3 ++-
qapi-schema.json | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/migration/ram.c b/migration/ram.c
index ce38be4..5c247f8 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -461,7 +461,8 @@ static int save_xbzrle_page(RAMState *rs, uint8_t
**current_data,
ram_addr_t current_addr, RAMBlock *block,
ram_addr_t offset, bool last_stage)
{
- int encoded_len = 0, bytes_xbzrle;
+ int encoded_len;
+ size_t bytes_xbzrle;
uint8_t *prev_cached_page;
if (!cache_is_cached(XBZRLE.cache, current_addr,
diff --git a/qapi-schema.json b/qapi-schema.json
index ecabff6..4a3d07e 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -646,7 +646,7 @@
# Since: 1.2
##
{ 'struct': 'XBZRLECacheStats',
- 'data': {'cache-size': 'size', 'bytes': 'int', 'pages': 'int',
+ 'data': {'cache-size': 'size', 'bytes': 'size', 'pages': 'int',
'cache-miss': 'int', 'cache-miss-rate': 'number',
'overflow': 'int' } }
--
2.7.5
[Qemu-block] [RFC PATCH 01/56] qobject: Touch up comments to say @param instead of 'param', Markus Armbruster, 2017/08/07
[Qemu-block] [RFC PATCH 13/56] pci: Make PCI addresses and sizes unsigned in QAPI/QMP, Markus Armbruster, 2017/08/07
[Qemu-block] [RFC PATCH 16/56] migration: Make XBZRLE transferred size unsigned in QAPI/QMP,
Markus Armbruster <=
[Qemu-block] [RFC PATCH 11/56] monitor: Drop unused HMP .args_type 'M', Markus Armbruster, 2017/08/07
[Qemu-block] [RFC PATCH 17/56] migration: Make MigrationStats sizes unsigned in QAPI/QMP, Markus Armbruster, 2017/08/07
[Qemu-block] [RFC PATCH 19/56] block: Make snapshot VM state size unsigned in QAPI/QMP, Markus Armbruster, 2017/08/07
[Qemu-block] [RFC PATCH 21/56] block: Clean up get_human_readable_size(), Markus Armbruster, 2017/08/07
[Qemu-block] [RFC PATCH 22/56] block: Mix up signed and unsigned less in bdrv_img_create(), Markus Armbruster, 2017/08/07
[Qemu-block] [RFC PATCH 25/56] block/qcow2: Change qcow2_calc_prealloc_size() to uint64_t, Markus Armbruster, 2017/08/07
[Qemu-block] [RFC PATCH 02/56] qdict: New helpers to put and get unsigned integers, Markus Armbruster, 2017/08/07