From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49071) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dejJ8-0007RR-WF for qemu-devel@nongnu.org; Mon, 07 Aug 2017 10:47:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dejIs-0003xG-SM for qemu-devel@nongnu.org; Mon, 07 Aug 2017 10:47:03 -0400 From: Markus Armbruster Date: Mon, 7 Aug 2017 16:45:33 +0200 Message-Id: <1502117160-24655-30-git-send-email-armbru@redhat.com> In-Reply-To: <1502117160-24655-1-git-send-email-armbru@redhat.com> References: <1502117160-24655-1-git-send-email-armbru@redhat.com> Subject: [Qemu-devel] [RFC PATCH 29/56] block: Make BlockDirtyInfo byte count unsigned in QAPI/QMP List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: eblake@redhat.com, kwolf@redhat.com, mreitz@redhat.com, jcody@redhat.com, famz@redhat.com, jsnow@redhat.com, pbonzini@redhat.com, marcandre.lureau@redhat.com, dgilbert@redhat.com, quintela@redhat.com, berrange@redhat.com, qemu-block@nongnu.org Byte counts should use QAPI type 'size' (uint64_t). BlockDirtyInfo member @count is 'int' (int64_t). bdrv_query_dirty_bitmaps() computes @count from bdrv_get_dirty_count() in uint64_t, then implicitly converts to int64_t. Before the commit before previous, the conversion was in bdrv_get_dirty_count() instead. Change member @count to 'size'. query-block now reports @count values above 2^63-1 correctly instead of their (negative) two's complement. Signed-off-by: Markus Armbruster --- qapi/block-core.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qapi/block-core.json b/qapi/block-core.json index 1c4a08d..60e1b6f 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -418,7 +418,7 @@ # Since: 1.3 ## { 'struct': 'BlockDirtyInfo', - 'data': {'*name': 'str', 'count': 'int', 'granularity': 'size', + 'data': {'*name': 'str', 'count': 'size', 'granularity': 'size', 'status': 'DirtyBitmapStatus'} } ## -- 2.7.5