From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:43766) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SD9Ln-0003CQ-52 for qemu-devel@nongnu.org; Thu, 29 Mar 2012 03:00:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SD9Lg-00024J-Lj for qemu-devel@nongnu.org; Thu, 29 Mar 2012 03:00:50 -0400 Received: from isrv.corpit.ru ([86.62.121.231]:38734) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SD9Lg-000243-B0 for qemu-devel@nongnu.org; Thu, 29 Mar 2012 03:00:44 -0400 Message-ID: <4F740899.8060800@msgid.tls.msk.ru> Date: Thu, 29 Mar 2012 11:00:41 +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> <4F740560.5080507@msgid.tls.msk.ru> In-Reply-To: <4F740560.5080507@msgid.tls.msk.ru> 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 29.03.2012 10:46, Michael Tokarev wrote: > 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. Please ignore this one ;) For qemu_iovec_init_external(), the real iov is ofcourse needed. Thanks, /mjt