qemu-devel
[Top][All Lists]
Advanced

[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 11:00:41 +0400
User-agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:8.0) Gecko/20120216 Icedove/8.0

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]