From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41548) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YLcq8-00032w-HL for qemu-devel@nongnu.org; Wed, 11 Feb 2015 14:20:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YLcq4-0003Pv-Sh for qemu-devel@nongnu.org; Wed, 11 Feb 2015 14:20:48 -0500 Received: from mx1.redhat.com ([209.132.183.28]:35887) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YLcq4-0003Ph-A1 for qemu-devel@nongnu.org; Wed, 11 Feb 2015 14:20:44 -0500 Message-ID: <54DBAB88.2000500@redhat.com> Date: Wed, 11 Feb 2015 14:20:40 -0500 From: Max Reitz MIME-Version: 1.0 References: <1423532117-14490-1-git-send-email-jsnow@redhat.com> <1423532117-14490-13-git-send-email-jsnow@redhat.com> In-Reply-To: <1423532117-14490-13-git-send-email-jsnow@redhat.com> Content-Type: text/plain; charset=iso-8859-15; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v12 12/17] block: Ensure consistent bitmap function prototypes List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: John Snow , qemu-devel@nongnu.org Cc: kwolf@redhat.com, famz@redhat.com, armbru@redhat.com, vsementsov@parallels.com, stefanha@redhat.com On 2015-02-09 at 20:35, John Snow wrote: > We often don't need the BlockDriverState for functions > that operate on bitmaps. Remove it. > > Signed-off-by: John Snow > --- > block.c | 13 ++++++------- > block/backup.c | 2 +- > block/mirror.c | 23 ++++++++++------------- > blockdev.c | 2 +- > include/block/block.h | 11 +++++------ > migration/block.c | 7 +++---- > 6 files changed, 26 insertions(+), 32 deletions(-) [snip] > diff --git a/block/mirror.c b/block/mirror.c > index 271dbf3..04d1710 100644 > --- a/block/mirror.c > +++ b/block/mirror.c > @@ -125,10 +125,9 @@ static void mirror_write_complete(void *opaque, int ret) > MirrorOp *op = opaque; > MirrorBlockJob *s = op->s; > if (ret < 0) { > - BlockDriverState *source = s->common.bs; > BlockErrorAction action; > > - bdrv_set_dirty_bitmap(source, s->dirty_bitmap, op->sector_num, > + bdrv_set_dirty_bitmap(s->dirty_bitmap, op->sector_num, > op->nb_sectors); > action = mirror_error_action(s, false, -ret); > if (action == BLOCK_ERROR_ACTION_REPORT && s->ret >= 0) { > @@ -143,10 +142,9 @@ static void mirror_read_complete(void *opaque, int ret) > MirrorOp *op = opaque; > MirrorBlockJob *s = op->s; > if (ret < 0) { > - BlockDriverState *source = s->common.bs; > BlockErrorAction action; > > - bdrv_set_dirty_bitmap(source, s->dirty_bitmap, op->sector_num, > + bdrv_set_dirty_bitmap(s->dirty_bitmap, op->sector_num, > op->nb_sectors); > action = mirror_error_action(s, true, -ret); > if (action == BLOCK_ERROR_ACTION_REPORT && s->ret >= 0) { > @@ -170,10 +168,10 @@ static uint64_t coroutine_fn mirror_iteration(MirrorBlockJob *s) > > s->sector_num = hbitmap_iter_next(&s->hbi); > if (s->sector_num < 0) { > - bdrv_dirty_iter_init(source, s->dirty_bitmap, &s->hbi); > + bdrv_dirty_iter_init(s->dirty_bitmap, &s->hbi); > s->sector_num = hbitmap_iter_next(&s->hbi); > trace_mirror_restart_iter(s, > - bdrv_get_dirty_count(source, s->dirty_bitmap)); > + bdrv_get_dirty_count(s->dirty_bitmap)); You can probably join those two lines now (maybe there are more places where that's possible, I haven't checked, but this looks awfully suspicious; I see that you did join some lines, so I know that you're not opposed to it in principle). Whether you do that or not (here and in all the places possible): Reviewed-by: Max Reitz