@@ -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' } }
##
@@ -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('}');
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 <armbru@redhat.com> --- qapi/block-core.json | 4 ++-- qemu-img.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)