Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1ML178-0004n8-Lz for qemu-devel@nongnu.org; Sun, 28 Jun 2009 16:36:38 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1ML173-0004eP-4U for qemu-devel@nongnu.org; Sun, 28 Jun 2009 16:36:37 -0400 Received: from [199.232.76.173] (port=47472 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ML172-0004eD-Vb for qemu-devel@nongnu.org; Sun, 28 Jun 2009 16:36:33 -0400 Received: from verein.lst.de ([213.95.11.210]:33942) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA1:24) (Exim 4.60) (envelope-from ) id 1ML172-0006iE-Hn for qemu-devel@nongnu.org; Sun, 28 Jun 2009 16:36:32 -0400 Date: Sun, 28 Jun 2009 22:36:28 +0200 From: Christoph Hellwig Subject: Re: [Qemu-devel] [PATCH] qemu-io: add aio read/write/flush commands Message-ID: <20090628203628.GB11623@lst.de> References: <20090620191044.GA25835@lst.de> <4A434CF7.7000503@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4A434CF7.7000503@redhat.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: Christoph Hellwig , qemu-devel@nongnu.org On Thu, Jun 25, 2009 at 12:09:59PM +0200, Kevin Wolf wrote: > > +}; > > + > > +static void > > +aio_write_done(void *opaque, int ret) > > +{ > > + struct aio_ctx *ctx = opaque; > > + struct timeval t2; > > + int total; > > + int cnt = 1; > > What is the reason for having the total and cnt variables here which are > never modified and used only once? None really. It's a fallout of just taking the existing write command and aio-ifying it. > > +static int > > +aio_read_f(int argc, char **argv) > > +{ > > + char *p; > > + int count = 0; > > Shouldn't this be size_t? In a perfect would it should be, in qemu it doesn't matter too much because we use a plain int in all kinds of places that should use a size_t (and int64_t for off_t).