aboutsummaryrefslogtreecommitdiff
path: root/block/vhdx.c
diff options
context:
space:
mode:
authorStefano Garzarella <sgarzare@redhat.com>2019-03-27 10:56:34 +0100
committerKevin Wolf <kwolf@redhat.com>2019-04-30 15:29:00 +0200
commit0cb98af2187a5c7e1723fc28f8ed359634dff550 (patch)
tree8b30d2fe9ae5b31e97aee692fe6844861a1c5e91 /block/vhdx.c
parente9991e29ea5efb91324a1b1e10fbf553867964df (diff)
block/vhdx: Use IEC binary prefixes for size constants
Using IEC binary prefixes in order to make the code more readable, with the exception of DEFAULT_LOG_SIZE because it's passed to stringify(). Signed-off-by: Stefano Garzarella <sgarzare@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: John Snow <jsnow@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block/vhdx.c')
-rw-r--r--block/vhdx.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/block/vhdx.c b/block/vhdx.c
index 7cd1fc3731..a143a57657 100644
--- a/block/vhdx.c
+++ b/block/vhdx.c
@@ -1175,7 +1175,7 @@ static int vhdx_allocate_block(BlockDriverState *bs, BDRVVHDXState *s,
*new_offset = current_len;
/* per the spec, the address for a block is in units of 1MB */
- *new_offset = ROUND_UP(*new_offset, 1024 * 1024);
+ *new_offset = ROUND_UP(*new_offset, 1 * MiB);
if (*new_offset > INT64_MAX) {
return -EINVAL;
}
@@ -1338,7 +1338,7 @@ static coroutine_fn int vhdx_co_writev(BlockDriverState *bs, int64_t sector_num,
case PAYLOAD_BLOCK_FULLY_PRESENT:
/* if the file offset address is in the header zone,
* there is a problem */
- if (sinfo.file_offset < (1024 * 1024)) {
+ if (sinfo.file_offset < (1 * MiB)) {
ret = -EFAULT;
goto error_bat_restore;
}