aboutsummaryrefslogtreecommitdiff
path: root/qemu-img.c
diff options
context:
space:
mode:
Diffstat (limited to 'qemu-img.c')
-rw-r--r--qemu-img.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/qemu-img.c b/qemu-img.c
index 498fbf42fe..4548dbff82 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -3210,12 +3210,9 @@ static int img_map(int argc, char **argv)
curr.start = start_offset;
while (curr.start + curr.length < length) {
int64_t offset = curr.start + curr.length;
- int64_t n;
+ int64_t n = length - offset;
- /* Probe up to 1 GiB at a time. */
- n = MIN(1 * GiB, length - offset);
ret = get_block_status(bs, offset, n, &next);
-
if (ret < 0) {
error_report("Could not read file metadata: %s", strerror(-ret));
goto out;