]> git.proxmox.com Git - mirror_qemu.git/commitdiff
block-backend: convert blk_co_copy_range to int64_t bytes
authorVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Wed, 6 Oct 2021 13:17:15 +0000 (15:17 +0200)
committerEric Blake <eblake@redhat.com>
Fri, 15 Oct 2021 20:55:28 +0000 (15:55 -0500)
Function is updated so that parameter type becomes wider, so all
callers should be OK with it.

Look at blk_co_copy_range() itself: bytes is passed only to
blk_check_byte_request() and bdrv_co_copy_range(), which already have
int64_t bytes parameter, so we are OK.

Note that requests exceeding INT_MAX are still restricted by
blk_check_byte_request().

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20211006131718.214235-10-vsementsov@virtuozzo.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
[eblake: grammar tweaks]
Signed-off-by: Eric Blake <eblake@redhat.com>
block/block-backend.c
include/sysemu/block-backend.h

index ee20ae5f0f28e3a3c613a61238b58a224ff67ca2..0746be89842b79b21d9829d0a62cacc01efb67b8 100644 (file)
@@ -2418,7 +2418,7 @@ void blk_unregister_buf(BlockBackend *blk, void *host)
 
 int coroutine_fn blk_co_copy_range(BlockBackend *blk_in, int64_t off_in,
                                    BlockBackend *blk_out, int64_t off_out,
-                                   int bytes, BdrvRequestFlags read_flags,
+                                   int64_t bytes, BdrvRequestFlags read_flags,
                                    BdrvRequestFlags write_flags)
 {
     int r;
index 3294d1b07a33cbc6360aaee92ee0958a4b0a5ed6..9ccf9f1a8025bf09f356cdeefb4cc0d3b2a9c179 100644 (file)
@@ -270,7 +270,7 @@ void blk_unregister_buf(BlockBackend *blk, void *host);
 
 int coroutine_fn blk_co_copy_range(BlockBackend *blk_in, int64_t off_in,
                                    BlockBackend *blk_out, int64_t off_out,
-                                   int bytes, BdrvRequestFlags read_flags,
+                                   int64_t bytes, BdrvRequestFlags read_flags,
                                    BdrvRequestFlags write_flags);
 
 const BdrvChild *blk_root(BlockBackend *blk);