On 12/12/2012 06:46 AM, Paolo Bonzini wrote: > There is really no change in the behavior of the job here, since > there is still a maximum of one in-flight I/O operation between > the source and the target. However, this patch already introduces > the AIO callbacks (which are unmodified in the next patch) > and some of the logic to count in-flight operations and only > complete the job when there is none. > > Signed-off-by: Paolo Bonzini <pbonz...@redhat.com> > --- > block/mirror.c | 155 > +++++++++++++++++++++++++++++++++++++++++++-------------- > trace-events | 2 + > 2 files changed, 119 insertions(+), 38 deletions(-) >
> @@ -87,31 +143,30 @@ static int coroutine_fn mirror_iteration(MirrorBlockJob > *s, > > end = s->common.len >> BDRV_SECTOR_BITS; > nb_sectors = MIN(nb_sectors, end - sector_num); > + > + /* Allocate a MirrorOp that is used as an AIO callback. */ > + op = g_slice_new(MirrorOp); > + op->s = s; > + op->iov.iov_base = s->buf; > + op->iov.iov_len = nb_sectors * 512; Why two spaces? I'm not an expert in this area of code, so my review is weak; but I didn't spot anything obviously wrong, so feel free to add my: Reviewed-by: Eric Blake <ebl...@redhat.com> -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature