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