[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 12/22] qemu-img: Explicit number replaced by a constant
From: |
Max Reitz |
Subject: |
[PULL 12/22] qemu-img: Explicit number replaced by a constant |
Date: |
Tue, 15 Sep 2020 12:46:17 +0200 |
From: Yi Li <yili@winhong.com>
Signed-off-by: Yi Li <yili@winhong.com>
Message-Id: <20200819013607.32280-1-yili@winhong.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
---
qemu-img.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/qemu-img.c b/qemu-img.c
index 37365d06fa..1d8c5cd778 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -1201,10 +1201,10 @@ static int is_allocated_sectors(const uint8_t *buf, int
n, int *pnum,
*pnum = 0;
return 0;
}
- is_zero = buffer_is_zero(buf, 512);
+ is_zero = buffer_is_zero(buf, BDRV_SECTOR_SIZE);
for(i = 1; i < n; i++) {
- buf += 512;
- if (is_zero != buffer_is_zero(buf, 512)) {
+ buf += BDRV_SECTOR_SIZE;
+ if (is_zero != buffer_is_zero(buf, BDRV_SECTOR_SIZE)) {
break;
}
}
@@ -2513,8 +2513,8 @@ static int img_convert(int argc, char **argv)
}
}
- qemu_opt_set_number(opts, BLOCK_OPT_SIZE, s.total_sectors * 512,
- &error_abort);
+ qemu_opt_set_number(opts, BLOCK_OPT_SIZE,
+ s.total_sectors * BDRV_SECTOR_SIZE, &error_abort);
ret = add_old_style_options(out_fmt, opts, out_baseimg, NULL);
if (ret < 0) {
goto out;
--
2.26.2
- [PULL 01/22] qemu-iotests: Fix FilePaths cleanup, (continued)
- [PULL 01/22] qemu-iotests: Fix FilePaths cleanup, Max Reitz, 2020/09/15
- [PULL 02/22] qemu-iotests: Fix FilePaths docstring, Max Reitz, 2020/09/15
- [PULL 03/22] qemu-iotests: Support varargs syntax in FilePaths, Max Reitz, 2020/09/15
- [PULL 04/22] qemu-iotests: Merge FilePaths and FilePath, Max Reitz, 2020/09/15
- [PULL 05/22] qemu-iotests: Simplify FilePath __init__, Max Reitz, 2020/09/15
- [PULL 06/22] block/quorum.c: stable children names, Max Reitz, 2020/09/15
- [PULL 07/22] qemu-img: avoid unaligned read requests during convert, Max Reitz, 2020/09/15
- [PULL 08/22] qcow2: Use macros for the L1, refcount and bitmap table entry sizes, Max Reitz, 2020/09/15
- [PULL 10/22] qcow2: Don't check nb_clusters when removing l2meta from the list, Max Reitz, 2020/09/15
- [PULL 11/22] qcow2: Rewrite the documentation of qcow2_alloc_cluster_offset(), Max Reitz, 2020/09/15
- [PULL 12/22] qemu-img: Explicit number replaced by a constant,
Max Reitz <=
- [PULL 09/22] qcow2: Fix removal of list members from BDRVQcow2State.cluster_allocs, Max Reitz, 2020/09/15
- [PULL 13/22] iotests: Skip test_stream_parallel in test 030 when doing "make check", Max Reitz, 2020/09/15
- [PULL 14/22] block/vhdx: Support vhdx image only with 512 bytes logical sector size, Max Reitz, 2020/09/15
- [PULL 15/22] qcow2: Handle QCowL2Meta on error in preallocate_co(), Max Reitz, 2020/09/15
- [PULL 16/22] qcow2: Make qcow2_free_any_clusters() free only one cluster, Max Reitz, 2020/09/15
- [PULL 17/22] qcow2: Return the original error code in qcow2_co_pwrite_zeroes(), Max Reitz, 2020/09/15
- [PULL 18/22] block/rbd: remove runtime_opts, Max Reitz, 2020/09/15
- [PULL 19/22] block/qcow: remove runtime opts, Max Reitz, 2020/09/15
- [PULL 22/22] block/rbd: add 'namespace' to qemu_rbd_strong_runtime_opts[], Max Reitz, 2020/09/15
- [PULL 21/22] qcow2: Convert qcow2_alloc_cluster_offset() into qcow2_alloc_host_offset(), Max Reitz, 2020/09/15