From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:51195) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tjnku-0003Hl-B5 for qemu-devel@nongnu.org; Sat, 15 Dec 2012 04:10:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tjnkt-0001Rd-55 for qemu-devel@nongnu.org; Sat, 15 Dec 2012 04:10:00 -0500 Received: from mx4-phx2.redhat.com ([209.132.183.25]:51427) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tjnks-0001RT-UW for qemu-devel@nongnu.org; Sat, 15 Dec 2012 04:09:59 -0500 Date: Sat, 15 Dec 2012 04:09:58 -0500 (EST) From: Paolo Bonzini Message-ID: <40005758.24993535.1355562598071.JavaMail.root@redhat.com> In-Reply-To: <50CBA3F6.5060003@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 09/20] mirror: switch mirror_iteration to AIO List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: kwolf@redhat.com, jcody@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com ----- Messaggio originale ----- > Da: "Eric Blake" > A: "Paolo Bonzini" > Cc: qemu-devel@nongnu.org, kwolf@redhat.com, stefanha@redhat.com, jcody@r= edhat.com > Inviato: Venerd=C3=AC, 14 dicembre 2012 23:11:02 > Oggetto: Re: [PATCH 09/20] mirror: switch mirror_iteration to AIO >=20 > 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. > >=20 > > Signed-off-by: Paolo Bonzini > > --- > > block/mirror.c | 155 > > +++++++++++++++++++++++++++++++++++++++++++-------------- > > trace-events | 2 + > > 2 files changed, 119 insertions(+), 38 deletions(-) > >=20 >=20 > > @@ -87,31 +143,30 @@ static int coroutine_fn > > mirror_iteration(MirrorBlockJob *s, > > =20 > > end =3D s->common.len >> BDRV_SECTOR_BITS; > > nb_sectors =3D MIN(nb_sectors, end - sector_num); > > + > > + /* Allocate a MirrorOp that is used as an AIO callback. */ > > + op =3D g_slice_new(MirrorOp); > > + op->s =3D s; > > + op->iov.iov_base =3D s->buf; > > + op->iov.iov_len =3D nb_sectors * 512; >=20 > Why two spaces? To align the equal signs. :) Paolo > 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: >=20 > Reviewed-by: Eric Blake >=20 > -- > Eric Blake eblake redhat com +1-919-301-3266 > Libvirt virtualization library http://libvirt.org >=20 >=20