qcow2: use DIV_ROUND_UP

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>
master
Marc-André Lureau 2017-06-22 13:04:16 +02:00
parent 6fb0022b48
commit 21cf3e1201
1 changed files with 1 additions and 1 deletions

View File

@ -61,7 +61,7 @@ int qcow2_grow_l1_table(BlockDriverState *bs, uint64_t min_size,
new_l1_size = 1;
}
while (min_size > new_l1_size) {
new_l1_size = (new_l1_size * 3 + 1) / 2;
new_l1_size = DIV_ROUND_UP(new_l1_size * 3, 2);
}
}