mirror of https://github.com/xemu-project/xemu.git
backup: Remove bs parameter from backup_do_cow()
Now that we pass the job to the function, bs is implied by that. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Alberto Garcia <berto@igalia.com>
This commit is contained in:
parent
12b3e52e48
commit
8543c27414
|
@ -94,12 +94,12 @@ static void cow_request_end(CowRequest *req)
|
||||||
qemu_co_queue_restart_all(&req->wait_queue);
|
qemu_co_queue_restart_all(&req->wait_queue);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int coroutine_fn backup_do_cow(BlockDriverState *bs,
|
static int coroutine_fn backup_do_cow(BackupBlockJob *job,
|
||||||
BackupBlockJob *job,
|
|
||||||
int64_t sector_num, int nb_sectors,
|
int64_t sector_num, int nb_sectors,
|
||||||
bool *error_is_read,
|
bool *error_is_read,
|
||||||
bool is_write_notifier)
|
bool is_write_notifier)
|
||||||
{
|
{
|
||||||
|
BlockDriverState *bs = job->common.bs;
|
||||||
CowRequest cow_request;
|
CowRequest cow_request;
|
||||||
struct iovec iov;
|
struct iovec iov;
|
||||||
QEMUIOVector bounce_qiov;
|
QEMUIOVector bounce_qiov;
|
||||||
|
@ -203,11 +203,11 @@ static int coroutine_fn backup_before_write_notify(
|
||||||
int64_t sector_num = req->offset >> BDRV_SECTOR_BITS;
|
int64_t sector_num = req->offset >> BDRV_SECTOR_BITS;
|
||||||
int nb_sectors = req->bytes >> 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->offset & (BDRV_SECTOR_SIZE - 1)) == 0);
|
||||||
assert((req->bytes & (BDRV_SECTOR_SIZE - 1)) == 0);
|
assert((req->bytes & (BDRV_SECTOR_SIZE - 1)) == 0);
|
||||||
|
|
||||||
return backup_do_cow(req->bs, job, sector_num,
|
return backup_do_cow(job, sector_num, nb_sectors, NULL, true);
|
||||||
nb_sectors, NULL, true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void backup_set_speed(BlockJob *job, int64_t speed, Error **errp)
|
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 end;
|
||||||
int64_t last_cluster = -1;
|
int64_t last_cluster = -1;
|
||||||
int64_t sectors_per_cluster = cluster_size_sectors(job);
|
int64_t sectors_per_cluster = cluster_size_sectors(job);
|
||||||
BlockDriverState *bs = job->common.bs;
|
|
||||||
HBitmapIter hbi;
|
HBitmapIter hbi;
|
||||||
|
|
||||||
granularity = bdrv_dirty_bitmap_granularity(job->sync_bitmap);
|
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)) {
|
if (yield_and_check(job)) {
|
||||||
return ret;
|
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,
|
sectors_per_cluster, &error_is_read,
|
||||||
false);
|
false);
|
||||||
if ((ret < 0) &&
|
if ((ret < 0) &&
|
||||||
|
@ -446,7 +445,7 @@ static void coroutine_fn backup_run(void *opaque)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* FULL sync mode we copy the whole drive. */
|
/* 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);
|
sectors_per_cluster, &error_is_read, false);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
/* Depending on error action, fail now or retry cluster */
|
/* Depending on error action, fail now or retry cluster */
|
||||||
|
|
Loading…
Reference in New Issue