From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:59331) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TjdTJ-0000G0-IY for qemu-devel@nongnu.org; Fri, 14 Dec 2012 17:11:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TjdTF-000820-FD for qemu-devel@nongnu.org; Fri, 14 Dec 2012 17:11:09 -0500 Received: from mx1.redhat.com ([209.132.183.28]:7259) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TjdTF-00081u-7E for qemu-devel@nongnu.org; Fri, 14 Dec 2012 17:11:05 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qBEMB4XI002639 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 14 Dec 2012 17:11:04 -0500 Message-ID: <50CBA3F6.5060003@redhat.com> Date: Fri, 14 Dec 2012 15:11:02 -0700 From: Eric Blake MIME-Version: 1.0 References: <1355319999-30627-1-git-send-email-pbonzini@redhat.com> <1355319999-30627-10-git-send-email-pbonzini@redhat.com> In-Reply-To: <1355319999-30627-10-git-send-email-pbonzini@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enigCE279591AB33A1E3EA0B8C45" 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: Paolo Bonzini Cc: kwolf@redhat.com, jcody@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigCE279591AB33A1E3EA0B8C45 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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 > @@ -87,31 +143,30 @@ static int coroutine_fn mirror_iteration(MirrorBlo= ckJob *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; 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 --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --------------enigCE279591AB33A1E3EA0B8C45 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with undefined - http://www.enigmail.net/ iQEcBAEBCAAGBQJQy6P2AAoJEKeha0olJ0Nq/G8H/iSq9LPsOFkYf/zZFH6k0yFf sSqchnsxQUyBFO9BU6ionsl000pKcKH95lbejy1lxFalPxvXF4GsDAEHZJG7+AQJ GaerumUIQSSjJcmhXk8E8jJBT7EnNVNu6z3QahTmjYxQf2iMAhXvqvzgRyRPVSb8 SxN9AEXtBtnXoykf8Op6tckrdGKGakOuCFSenkHShQ2adYi2LZLC+2jgHNhx4A/k EQMb2tCfL4GmIv30kK10kv3hrCCvBkiWElBpWsi4ly3Hd08saPt1IcXo66q6opGu jcmlV81ZKrwQLeTKMtLIMv8MXoOE6uGnPilP7KNTUI+ZY/YNP8+muX/jjhnmq2U= =SRCp -----END PGP SIGNATURE----- --------------enigCE279591AB33A1E3EA0B8C45--