[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/2] ide: convert ide_sector_read() to asynchron
From: |
Michael Tokarev |
Subject: |
Re: [Qemu-devel] [PATCH 1/2] ide: convert ide_sector_read() to asynchronous I/O |
Date: |
Thu, 29 Mar 2012 10:46:56 +0400 |
User-agent: |
Mozilla/5.0 (X11; Linux i686 on x86_64; rv:8.0) Gecko/20120216 Icedove/8.0 |
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
- [Qemu-devel] [PATCH 0/2] ide: convert pio code path to asynchronous I/O, Stefan Hajnoczi, 2012/03/28
- [Qemu-devel] [PATCH 2/2] ide: convert ide_sector_write() to asynchronous I/O, Stefan Hajnoczi, 2012/03/28
- Re: [Qemu-devel] [PATCH 0/2] ide: convert pio code path to asynchronous I/O, Chris Webb, 2012/03/28
- Re: [Qemu-devel] [PATCH 0/2] ide: convert pio code path to asynchronous I/O, Paolo Bonzini, 2012/03/28
- Re: [Qemu-devel] [PATCH 0/2] ide: convert pio code path to asynchronous I/O, Zhi Yong Wu, 2012/03/28
- Re: [Qemu-devel] [PATCH 0/2] ide: convert pio code path to asynchronous I/O, Chris Webb, 2012/03/29