From: Marc-André Lureau Date: Thu, 22 Jun 2017 11:04:16 +0000 (+0200) Subject: vhdx: use QEMU_ALIGN_DOWN X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=cf7a09c1e4e4869c1257c1490e770b8801f8ec43;p=qemu.git vhdx: use QEMU_ALIGN_DOWN I used the clang-tidy qemu-round check to generate the fix: https://github.com/elmarco/clang-tools-extra Signed-off-by: Marc-André Lureau Reviewed-by: Eric Blake Reviewed-by: Richard Henderson --- diff --git a/block/vhdx-log.c b/block/vhdx-log.c index 14b724ef7b..0ac4863b25 100644 --- a/block/vhdx-log.c +++ b/block/vhdx-log.c @@ -902,7 +902,7 @@ static int vhdx_log_write(BlockDriverState *bs, BDRVVHDXState *s, } sector_offset = offset % VHDX_LOG_SECTOR_SIZE; - file_offset = (offset / VHDX_LOG_SECTOR_SIZE) * VHDX_LOG_SECTOR_SIZE; + file_offset = QEMU_ALIGN_DOWN(offset, VHDX_LOG_SECTOR_SIZE); aligned_length = length;