From a9262f551eba44d4d0f9e396d7124c059a93e204 Mon Sep 17 00:00:00 2001 From: Alberto Faria Date: Tue, 5 Jul 2022 17:15:11 +0100 Subject: block: Change blk_{pread,pwrite}() param order Swap 'buf' and 'bytes' around for consistency with blk_co_{pread,pwrite}(), and in preparation to implement these functions using generated_co_wrapper. Callers were updated using this Coccinelle script: @@ expression blk, offset, buf, bytes, flags; @@ - blk_pread(blk, offset, buf, bytes, flags) + blk_pread(blk, offset, bytes, buf, flags) @@ expression blk, offset, buf, bytes, flags; @@ - blk_pwrite(blk, offset, buf, bytes, flags) + blk_pwrite(blk, offset, bytes, buf, flags) It had no effect on hw/block/nand.c, presumably due to the #if, so that file was updated manually. Overly-long lines were then fixed by hand. Signed-off-by: Alberto Faria Reviewed-by: Eric Blake Reviewed-by: Hanna Reitz Message-Id: <20220705161527.1054072-4-afaria@redhat.com> Signed-off-by: Hanna Reitz --- migration/block.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'migration') diff --git a/migration/block.c b/migration/block.c index 5362230..9e5aae5 100644 --- a/migration/block.c +++ b/migration/block.c @@ -569,7 +569,7 @@ static int mig_save_device_dirty(QEMUFile *f, BlkMigDevState *bmds, blk_mig_unlock(); } else { ret = blk_pread(bmds->blk, sector * BDRV_SECTOR_SIZE, - blk->buf, nr_sectors * BDRV_SECTOR_SIZE, 0); + nr_sectors * BDRV_SECTOR_SIZE, blk->buf, 0); if (ret < 0) { goto error; } @@ -976,8 +976,8 @@ static int block_load(QEMUFile *f, void *opaque, int version_id) cluster_size, BDRV_REQ_MAY_UNMAP); } else { - ret = blk_pwrite(blk, cur_addr, cur_buf, - cluster_size, 0); + ret = blk_pwrite(blk, cur_addr, cluster_size, cur_buf, + 0); } if (ret < 0) { break; -- cgit v1.1