From: Kevin Wolf <kwolf@redhat.com>
To: qemu-block@nongnu.org
Cc: kwolf@redhat.com, mreitz@redhat.com, berto@igalia.com,
jcody@redhat.com, jsnow@redhat.com, qemu-devel@nongnu.org,
eblake@redhat.com
Subject: [Qemu-devel] [PATCH v3 12/15] backup: Remove bs parameter from backup_do_cow()
Date: Wed, 25 May 2016 14:29:20 +0200 [thread overview]
Message-ID: <1464179363-19821-13-git-send-email-kwolf@redhat.com> (raw)
In-Reply-To: <1464179363-19821-1-git-send-email-kwolf@redhat.com>
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>
---
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
next prev parent reply other threads:[~2016-05-25 12:30 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-25 12:29 [Qemu-devel] [PATCH v3 00/15] block jobs: Convert I/O to BlockBackend Kevin Wolf
2016-05-25 12:29 ` [Qemu-devel] [PATCH v3 01/15] block: Rename blk_write_zeroes() Kevin Wolf
2016-05-25 14:40 ` Max Reitz
2016-05-25 12:29 ` [Qemu-devel] [PATCH v3 02/15] block: keep a list of block jobs Kevin Wolf
2016-05-25 12:29 ` [Qemu-devel] [PATCH v3 03/15] block: Cancel jobs first in bdrv_close_all() Kevin Wolf
2016-05-25 14:44 ` Max Reitz
2016-05-25 12:29 ` [Qemu-devel] [PATCH v3 04/15] block: Default to enabled write cache in blk_new() Kevin Wolf
2016-05-25 12:29 ` [Qemu-devel] [PATCH v3 05/15] block: Convert block job core to BlockBackend Kevin Wolf
2016-05-25 14:51 ` Max Reitz
2016-05-25 12:29 ` [Qemu-devel] [PATCH v3 06/15] block: Make blk_co_preadv/pwritev() public Kevin Wolf
2016-05-25 13:41 ` Alberto Garcia
2016-05-25 14:08 ` Eric Blake
2016-05-25 14:54 ` Max Reitz
2016-05-25 12:29 ` [Qemu-devel] [PATCH v3 07/15] stream: Use BlockBackend for I/O Kevin Wolf
2016-05-25 14:56 ` Max Reitz
2016-05-25 12:29 ` [Qemu-devel] [PATCH v3 08/15] mirror: Allow target that already has a BlockBackend Kevin Wolf
2016-05-25 12:29 ` [Qemu-devel] [PATCH v3 09/15] mirror: Use BlockBackend for I/O Kevin Wolf
2016-05-25 15:02 ` Max Reitz
2016-05-25 12:29 ` [Qemu-devel] [PATCH v3 10/15] backup: Don't leak BackupBlockJob in error path Kevin Wolf
2016-05-25 12:29 ` [Qemu-devel] [PATCH v3 11/15] backup: Pack Notifier within BackupBlockJob Kevin Wolf
2016-05-25 12:29 ` Kevin Wolf [this message]
2016-05-25 12:29 ` [Qemu-devel] [PATCH v3 13/15] backup: Use BlockBackend for I/O Kevin Wolf
2016-05-25 15:17 ` Max Reitz
2016-05-25 12:29 ` [Qemu-devel] [PATCH v3 14/15] commit: " Kevin Wolf
2016-05-25 15:19 ` Max Reitz
2016-05-25 12:29 ` [Qemu-devel] [PATCH v3 15/15] blockjob: Remove BlockJob.bs Kevin Wolf
2016-05-25 15:21 ` Max Reitz
2016-05-25 15:48 ` Eric Blake
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1464179363-19821-13-git-send-email-kwolf@redhat.com \
--to=kwolf@redhat.com \
--cc=berto@igalia.com \
--cc=eblake@redhat.com \
--cc=jcody@redhat.com \
--cc=jsnow@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).