Received: from eggs.gnu.org ([2001:4830:134:3::10]:50590) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZCmwe-0006cl-A7 for qemu-devel@nongnu.org; Wed, 08 Jul 2015 06:51:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZCmwd-0003u3-AO for qemu-devel@nongnu.org; Wed, 08 Jul 2015 06:51:16 -0400 Date: Wed, 8 Jul 2015 11:51:08 +0100 From: Stefan Hajnoczi Message-ID: <20150708105108.GB25442@stefanha-thinkpad.redhat.com> References: <1435670385-625-1-git-send-email-famz@redhat.com> <1435670385-625-4-git-send-email-famz@redhat.com> <20150707143549.GF28673@stefanha-thinkpad.redhat.com> <20150708011557.GE10382@ad.nay.redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="+pHx0qQiF2pBVqBT" Content-Disposition: inline In-Reply-To: <20150708011557.GE10382@ad.nay.redhat.com> Subject: Re: [Qemu-devel] [PATCH RFC 3/4] aio: Introduce aio_context_setup List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: Kevin Wolf , pbonzini@redhat.com, qemu-devel@nongnu.org, qemu-block@nongnu.org --+pHx0qQiF2pBVqBT Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jul 08, 2015 at 09:15:57AM +0800, Fam Zheng wrote: > On Tue, 07/07 15:35, Stefan Hajnoczi wrote: > > On Tue, Jun 30, 2015 at 09:19:44PM +0800, Fam Zheng wrote: > > > diff --git a/async.c b/async.c > > > index 06971f4..1d70cfd 100644 > > > --- a/async.c > > > +++ b/async.c > > > @@ -290,12 +290,17 @@ AioContext *aio_context_new(Error **errp) > > > { > > > int ret; > > > AioContext *ctx; > > > + Error *local_err =3D NULL; > > > + > > > ctx =3D (AioContext *) g_source_new(&aio_source_funcs, sizeof(Ai= oContext)); > > > + aio_context_setup(ctx, &local_err); > > > + if (local_err) { > > > + error_propagate(errp, local_err); > >=20 > > Is there any reason to introduce local_err? errp can be passed directly > > into aio_context_setup(). >=20 > It's used for catching failure of aio_context_setup, because the conventi= on is > errp can be NULL. You are right, I missed that aio_context_setup() has a void return type. --+pHx0qQiF2pBVqBT Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJVnQCcAAoJEJykq7OBq3PI4gEH/i6unk1c25wbQLKk8t5xBbtS eGjAk3jEMs4aqPBzr/vZVL+i2UD1z3De14pezKHCP3wzafrpObuYerfIWQGh/B71 4XOGnZtMsn5Jwv8ALclChXUiy9k+oYR14IKk9i64J0/KjVh139yVVq6oY9SEWcCW ITDWtr1qHaG9zNM1OBanMzaRV8NZBEed2/jdV90JOWCyYwA46wdqVmxgMmOAfbrs tQY7RRnt/QulS0yNhnurBnqLYHY+HGebdOHeIGEuKnMRv28rA15z3qGIydDOLRuR p53jjefVV7is1m2L0jWUmaCee46V4hPx+mN0Zz6IWkOvyvB01cd7xHw+V8wEQU8= =eVAh -----END PGP SIGNATURE----- --+pHx0qQiF2pBVqBT--