From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:54680) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SD98S-0000gm-6O for qemu-devel@nongnu.org; Thu, 29 Mar 2012 02:47:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SD98N-0007XN-K9 for qemu-devel@nongnu.org; Thu, 29 Mar 2012 02:47:03 -0400 Received: from isrv.corpit.ru ([86.62.121.231]:55411) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SD98N-0007X3-Cf for qemu-devel@nongnu.org; Thu, 29 Mar 2012 02:46:59 -0400 Message-ID: <4F740560.5080507@msgid.tls.msk.ru> Date: Thu, 29 Mar 2012 10:46:56 +0400 From: Michael Tokarev MIME-Version: 1.0 References: <1332949439-6781-1-git-send-email-stefanha@linux.vnet.ibm.com> <1332949439-6781-2-git-send-email-stefanha@linux.vnet.ibm.com> In-Reply-To: <1332949439-6781-2-git-send-email-stefanha@linux.vnet.ibm.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/2] ide: convert ide_sector_read() to asynchronous I/O List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Kevin Wolf , Richard Davies , Chris Webb , qemu-devel@nongnu.org, Zhi Yong Wu , Paolo Bonzini On 28.03.2012 19:43, Stefan Hajnoczi wrote: ... > void ide_sector_read(IDEState *s) > { ... > + s->iov.iov_base = s->io_buffer; > + s->iov.iov_len = n * BDRV_SECTOR_SIZE; > + qemu_iovec_init_external(&s->qiov, &s->iov, 1); > + bdrv_aio_readv(s->bs, sector_num, &s->qiov, n, > + ide_sector_read_cb, s); > } > > @@ -383,6 +383,8 @@ struct IDEState { > int cd_sector_size; > int atapi_dma; /* true if dma is requested for the packet cmd */ > BlockAcctCookie acct; > + struct iovec iov; > + QEMUIOVector qiov; > /* ATA DMA state */ > int io_buffer_size; > QEMUSGList sg; You don't actually need iov here, it can be a local variable just as well. The same applies to ide_sector_write() in the next patch. The state structure usually holds stuff which is actually needed to be keept across several calls, iov is not one of them. Thanks, /mjt