]> git.ipfire.org Git - thirdparty/qemu.git/commit
block/block-copy: refactor interfaces to use bytes instead of end
authorVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Wed, 11 Mar 2020 10:30:01 +0000 (13:30 +0300)
committerMax Reitz <mreitz@redhat.com>
Wed, 11 Mar 2020 11:42:30 +0000 (12:42 +0100)
commitdafaf13593de240724a210e72da66f9d162735c3
treef5cab9399e367e1ae2dc4e41a5a19adeca9a0140
parent17187cb646913356bbd434bebdcddf43f92ce31a
block/block-copy: refactor interfaces to use bytes instead of end

We have a lot of "chunk_end - start" invocations, let's switch to
bytes/cur_bytes scheme instead.

While being here, improve check on block_copy_do_copy parameters to not
overflow when calculating nbytes and use int64_t for bytes in
block_copy for consistency.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Message-Id: <20200311103004.7649-7-vsementsov@virtuozzo.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
block/block-copy.c
include/block/block-copy.h