aboutsummaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2017-06-22 13:04:16 +0200
committerMarc-André Lureau <marcandre.lureau@redhat.com>2017-08-31 12:29:07 +0200
commitcf7a09c1e4e4869c1257c1490e770b8801f8ec43 (patch)
tree005c50e9506e330bd2b2881fd07d258503ba607d /block
parent5a3804db616634779be8e5ebcc6409c2bd9b58b5 (diff)
downloadqemu-cf7a09c1e4e4869c1257c1490e770b8801f8ec43.zip
qemu-cf7a09c1e4e4869c1257c1490e770b8801f8ec43.tar.gz
qemu-cf7a09c1e4e4869c1257c1490e770b8801f8ec43.tar.bz2
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 <marcandre.lureau@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Richard Henderson <rth@twiddle.net>
Diffstat (limited to 'block')
-rw-r--r--block/vhdx-log.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/block/vhdx-log.c b/block/vhdx-log.c
index 14b724e..0ac4863 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;