On 05/24/2016 07:47 AM, Kevin Wolf wrote: > This changes the mirror block job to use the job's BlockBackend for > performing its I/O. job->bs isn't used by the mirroring code any more > afterwards. > > Signed-off-by: Kevin Wolf > --- > block/mirror.c | 74 ++++++++++++++++++++++++++++++++-------------------------- > blockdev.c | 4 +--- > 2 files changed, 42 insertions(+), 36 deletions(-) > > @@ -295,18 +297,19 @@ static void mirror_do_zero_or_discard(MirrorBlockJob *s, > s->in_flight++; > s->sectors_in_flight += nb_sectors; > if (is_discard) { > - bdrv_aio_discard(s->target, sector_num, op->nb_sectors, > - mirror_write_complete, op); > + blk_aio_discard(s->target, sector_num, op->nb_sectors, > + mirror_write_complete, op); Eventually, discard should be converted to bytes. (Did I just get volunteered?) > } else { > - bdrv_aio_write_zeroes(s->target, sector_num, op->nb_sectors, > - s->unmap ? BDRV_REQ_MAY_UNMAP : 0, > - mirror_write_complete, op); > + blk_aio_write_zeroes(s->target, sector_num * BDRV_SECTOR_SIZE, > + op->nb_sectors * BDRV_SECTOR_SIZE, > + s->unmap ? BDRV_REQ_MAY_UNMAP : 0, > + mirror_write_complete, op); Conflicts with the write_zeroes stuff I just posted, let me know if I need to rebase mine. Reviewed-by: Eric Blake -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org