Received: from eggs.gnu.org ([2001:4830:134:3::10]:33838) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YO1k2-0007dC-3T for qemu-devel@nongnu.org; Wed, 18 Feb 2015 05:20:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YO1jw-0003bj-O4 for qemu-devel@nongnu.org; Wed, 18 Feb 2015 05:20:26 -0500 Received: from mx1.redhat.com ([209.132.183.28]:52334) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YO1jw-0003bf-F8 for qemu-devel@nongnu.org; Wed, 18 Feb 2015 05:20:20 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t1IAKJJ6010622 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Wed, 18 Feb 2015 05:20:19 -0500 Date: Wed, 18 Feb 2015 10:20:17 +0000 From: Stefan Hajnoczi Message-ID: <20150218102017.GB6564@stefanha-thinkpad.redhat.com> References: <1424183959-16897-1-git-send-email-stefanha@redhat.com> <54E3687D.3050309@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ZfOjI3PrQbgiZnxM" Content-Disposition: inline In-Reply-To: <54E3687D.3050309@redhat.com> Subject: Re: [Qemu-devel] [PATCH v2] block: move I/O request processing to block/io.c List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: Kevin Wolf , qemu-devel@nongnu.org --ZfOjI3PrQbgiZnxM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Feb 17, 2015 at 09:12:45AM -0700, Eric Blake wrote: > On 02/17/2015 07:39 AM, Stefan Hajnoczi wrote: > > -void bdrv_drain_all(void) > > -{ > > - /* Always run first iteration so any pending completion BHs run */ > > - bool busy =3D true; > > - BlockDriverState *bs; > > - > > - while (busy) { > > - busy =3D false; > > - > > - QTAILQ_FOREACH(bs, &bdrv_states, device_list) { > > - AioContext *aio_context =3D bdrv_get_aio_context(bs); > > - >=20 > > +void bdrv_drain_all(void) > > +{ > > + /* Always run first iteration so any pending completion BHs run */ > > + bool busy =3D true; > > + BlockDriverState *bs =3D NULL; > > + > > + while (busy) { > > + busy =3D false; > > + > > + while ((bs =3D bdrv_next(bs))) { > > + AioContext *aio_context =3D bdrv_get_aio_context(bs); > > + >=20 > You switched iteration from QTAILQ_FOREACH to a while(bdrv_next()) loop, > here, and in bdrv_flush_all. Forgot about that, sorry. This change is necessary because bdrv_states is a static variable in block.c. Use the bdrv_next() API to iterate over BDS devices. Kevin: Please add this to the commit message. --ZfOjI3PrQbgiZnxM Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJU5GdhAAoJEJykq7OBq3PIdI4H/2CH3Uwo5Ix6TXCt5LVyPAJg 2G1pA7b48x2+lj9kv2SwRZEGffAjCoLgM2w4tMA1tGdRm5FLz+VzVlKrJDgw6Yuk w13eKEvvhRR/Qg77Y8OvhjTMTsKTh0p0zNPoZU+6BpHZACCrQBoZOKanP4dgQJeS xIHyYKvsR2AZmRjgeDPeHdedelPATuQ0/9W22lekNC6JQhmN7B7ZeRS+FKasmnCi 1utKBsvPD4KSxs7xk/M7+4UQBOpHyAC8ZjT1LywGQyHbJBk/eM3HB+o/209SGncF StxUbUpjnmp+cFw6rWFkO0FatSPQkLj0wMXNExOGKz99g1eNrxxCvTFNtU9IpS0= =Mkjn -----END PGP SIGNATURE----- --ZfOjI3PrQbgiZnxM--