[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [RFC PATCH 55/56] block: Make MapEntry offsets and size uns
From: |
Markus Armbruster |
Subject: |
[Qemu-block] [RFC PATCH 55/56] block: Make MapEntry offsets and size unsigned in QAPI |
Date: |
Mon, 7 Aug 2017 16:45:59 +0200 |
File offsets and sizes use QAPI type 'size' (uint64_t). MapEntry
members @start, @length and @offset are 'int' (int64_t).
get_block_status() sets @start and @length to unsigned long long
values, and @offset to a non-negative int64_t value.
Change these MapEntry members to 'size'.
"qemu-img map" now reports them correctly above 2^63-1 instead of
their (negative) two's complement.
Signed-off-by: Markus Armbruster <address@hidden>
---
qapi/block-core.json | 4 ++--
qemu-img.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/qapi/block-core.json b/qapi/block-core.json
index 3482f8c..6f62723 100644
--- a/qapi/block-core.json
+++ b/qapi/block-core.json
@@ -236,8 +236,8 @@
#
##
{ 'struct': 'MapEntry',
- 'data': {'start': 'int', 'length': 'int', 'data': 'bool',
- 'zero': 'bool', 'depth': 'int', '*offset': 'int',
+ 'data': {'start': 'size', 'length': 'size', 'data': 'bool',
+ 'zero': 'bool', 'depth': 'int', '*offset': 'size',
'*filename': 'str' } }
##
diff --git a/qemu-img.c b/qemu-img.c
index cf3ef3e..1c783c7 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -2655,14 +2655,14 @@ static void dump_map_entry(OutputFormat output_format,
MapEntry *e,
}
break;
case OFORMAT_JSON:
- printf("%s{ \"start\": %"PRId64", \"length\": %"PRId64","
+ printf("%s{ \"start\": %" PRIu64 ", \"length\": %" PRIu64 ","
" \"depth\": %"PRId64", \"zero\": %s, \"data\": %s",
(e->start == 0 ? "[" : ",\n"),
e->start, e->length, e->depth,
e->zero ? "true" : "false",
e->data ? "true" : "false");
if (e->has_offset) {
- printf(", \"offset\": %"PRId64"", e->offset);
+ printf(", \"offset\": %" PRIu64, e->offset);
}
putchar('}');
--
2.7.5
- [Qemu-block] [RFC PATCH 40/56] blockjob: Lift speed sign conversion out of backup_job_create(), (continued)
- [Qemu-block] [RFC PATCH 40/56] blockjob: Lift speed sign conversion out of backup_job_create(), Markus Armbruster, 2017/08/07
- [Qemu-block] [RFC PATCH 48/56] block: Make mirror buffer size unsigned in QAPI/QMP, Markus Armbruster, 2017/08/07
- [Qemu-block] [RFC PATCH 54/56] qemu-img: blk_getlength() can fail, fix img_map() to check, Markus Armbruster, 2017/08/07
- [Qemu-block] [RFC PATCH 46/56] blockjob: Make job commands' speed parameter unsigned in QAPI/QMP, Markus Armbruster, 2017/08/07
- [Qemu-block] [RFC PATCH 38/56] blockjob: Lift speed sign conversion out of block_job_set_speed(), Markus Armbruster, 2017/08/07
- [Qemu-block] [RFC PATCH 28/56] block: Widen dirty bitmap granularity to uint64_t for safety, Markus Armbruster, 2017/08/07
- [Qemu-block] [RFC PATCH 50/56] block: Make BLOCK_IMAGE_CORRUPTED offset, size unsigned in QAPI/QMP, Markus Armbruster, 2017/08/07
- [Qemu-block] [RFC PATCH 55/56] block: Make MapEntry offsets and size unsigned in QAPI,
Markus Armbruster <=
- [Qemu-block] [RFC PATCH 56/56] crypto: Make QCryptoBlockInfoLUKS offsets unsigned in QAPI/QMP, Markus Armbruster, 2017/08/07
- [Qemu-block] [RFC PATCH 42/56] blockjob: Lift speed sign conversion out of stream_start(), Markus Armbruster, 2017/08/07
- [Qemu-block] [RFC PATCH 34/56] block: Make BlockDeviceStats sizes, offsets unsigned in QAPI/QMP, Markus Armbruster, 2017/08/07
- [Qemu-block] [RFC PATCH 14/56] migration: Fix migrate-set-cache-size error reporting, Markus Armbruster, 2017/08/07
- [Qemu-block] [RFC PATCH 47/56] blockjob: Make BlockJobInfo and event offsets unsigned in QAPI/QMP, Markus Armbruster, 2017/08/07
- [Qemu-block] [RFC PATCH 20/56] block: Make ImageInfo sizes unsigned in QAPI/QMP, Markus Armbruster, 2017/08/07
- [Qemu-block] [RFC PATCH 51/56] block/nfs: Fix for readahead-size, page-cache-size > INT64_MAX, Markus Armbruster, 2017/08/07
- [Qemu-block] [RFC PATCH 53/56] block: Make blockdev-add byte counts unsigned in QAPI/QMP, Markus Armbruster, 2017/08/07