[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 28/31] backup: Remove bs parameter from backup_do_cow
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PULL 28/31] backup: Remove bs parameter from backup_do_cow() |
Date: |
Wed, 25 May 2016 19:39:53 +0200 |
Now that we pass the job to the function, bs is implied by that.
Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Reviewed-by: Alberto Garcia <address@hidden>
---
block/backup.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/block/backup.c b/block/backup.c
index a57288f..670ba50 100644
--- a/block/backup.c
+++ b/block/backup.c
@@ -94,12 +94,12 @@ static void cow_request_end(CowRequest *req)
qemu_co_queue_restart_all(&req->wait_queue);
}
-static int coroutine_fn backup_do_cow(BlockDriverState *bs,
- BackupBlockJob *job,
+static int coroutine_fn backup_do_cow(BackupBlockJob *job,
int64_t sector_num, int nb_sectors,
bool *error_is_read,
bool is_write_notifier)
{
+ BlockDriverState *bs = job->common.bs;
CowRequest cow_request;
struct iovec iov;
QEMUIOVector bounce_qiov;
@@ -203,11 +203,11 @@ static int coroutine_fn backup_before_write_notify(
int64_t sector_num = req->offset >> BDRV_SECTOR_BITS;
int nb_sectors = req->bytes >> BDRV_SECTOR_BITS;
+ assert(req->bs == job->common.bs);
assert((req->offset & (BDRV_SECTOR_SIZE - 1)) == 0);
assert((req->bytes & (BDRV_SECTOR_SIZE - 1)) == 0);
- return backup_do_cow(req->bs, job, sector_num,
- nb_sectors, NULL, true);
+ return backup_do_cow(job, sector_num, nb_sectors, NULL, true);
}
static void backup_set_speed(BlockJob *job, int64_t speed, Error **errp)
@@ -324,7 +324,6 @@ static int coroutine_fn
backup_run_incremental(BackupBlockJob *job)
int64_t end;
int64_t last_cluster = -1;
int64_t sectors_per_cluster = cluster_size_sectors(job);
- BlockDriverState *bs = job->common.bs;
HBitmapIter hbi;
granularity = bdrv_dirty_bitmap_granularity(job->sync_bitmap);
@@ -346,7 +345,7 @@ static int coroutine_fn
backup_run_incremental(BackupBlockJob *job)
if (yield_and_check(job)) {
return ret;
}
- ret = backup_do_cow(bs, job, cluster * sectors_per_cluster,
+ ret = backup_do_cow(job, cluster * sectors_per_cluster,
sectors_per_cluster, &error_is_read,
false);
if ((ret < 0) &&
@@ -446,7 +445,7 @@ static void coroutine_fn backup_run(void *opaque)
}
}
/* FULL sync mode we copy the whole drive. */
- ret = backup_do_cow(bs, job, start * sectors_per_cluster,
+ ret = backup_do_cow(job, start * sectors_per_cluster,
sectors_per_cluster, &error_is_read, false);
if (ret < 0) {
/* Depending on error action, fail now or retry cluster */
--
1.8.3.1
- [Qemu-block] [PULL 12/31] block: Make bdrv_drain() use bdrv_drained_begin/end(), (continued)
- [Qemu-block] [PULL 12/31] block: Make bdrv_drain() use bdrv_drained_begin/end(), Kevin Wolf, 2016/05/25
- [Qemu-block] [PULL 16/31] dma-helpers: change BlockBackend to opaque value in DMAIOFunc, Kevin Wolf, 2016/05/25
- [Qemu-block] [PULL 20/31] block: Default to enabled write cache in blk_new(), Kevin Wolf, 2016/05/25
- [Qemu-block] [PULL 14/31] block: Propagate .drained_begin/end callbacks, Kevin Wolf, 2016/05/25
- [Qemu-block] [PULL 15/31] dma-helpers: change interface to byte-based, Kevin Wolf, 2016/05/25
- [Qemu-block] [PULL 19/31] block: Cancel jobs first in bdrv_close_all(), Kevin Wolf, 2016/05/25
- [Qemu-block] [PULL 18/31] block: keep a list of block jobs, Kevin Wolf, 2016/05/25
- [Qemu-block] [PULL 22/31] block: Make blk_co_preadv/pwritev() public, Kevin Wolf, 2016/05/25
- [Qemu-block] [PULL 17/31] block: Rename blk_write_zeroes(), Kevin Wolf, 2016/05/25
- [Qemu-block] [PULL 23/31] stream: Use BlockBackend for I/O, Kevin Wolf, 2016/05/25
- [Qemu-block] [PULL 28/31] backup: Remove bs parameter from backup_do_cow(),
Kevin Wolf <=
- [Qemu-block] [PULL 21/31] block: Convert block job core to BlockBackend, Kevin Wolf, 2016/05/25
- [Qemu-block] [PULL 27/31] backup: Pack Notifier within BackupBlockJob, Kevin Wolf, 2016/05/25
- [Qemu-block] [PULL 24/31] mirror: Allow target that already has a BlockBackend, Kevin Wolf, 2016/05/25
- [Qemu-block] [PULL 26/31] backup: Don't leak BackupBlockJob in error path, Kevin Wolf, 2016/05/25
- [Qemu-block] [PULL 25/31] mirror: Use BlockBackend for I/O, Kevin Wolf, 2016/05/25
- [Qemu-block] [PULL 29/31] backup: Use BlockBackend for I/O, Kevin Wolf, 2016/05/25
- [Qemu-block] [PULL 30/31] commit: Use BlockBackend for I/O, Kevin Wolf, 2016/05/25
- [Qemu-block] [PULL 31/31] blockjob: Remove BlockJob.bs, Kevin Wolf, 2016/05/25
- Re: [Qemu-block] [Qemu-devel] [PULL 00/31] Block layer patches, Peter Maydell, 2016/05/26