Am 17.01.2013 09:33, schrieb Michael Tokarev:
> 17.01.2013 00:19, Kevin Wolf пишет:
>> Copying data in the right direction really helps a lot!
>>
>> Cc: qemu-sta...@nongnu.org
>> Signed-off-by: Kevin Wolf <kw...@redhat.com>
>> ---
>>   block/win32-aio.c |    2 +-
>>   1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/block/win32-aio.c b/block/win32-aio.c
>> index 46a5db7..53b82e6 100644
>> --- a/block/win32-aio.c
>> +++ b/block/win32-aio.c
>> @@ -84,7 +84,7 @@ static void win32_aio_process_completion(QEMUWin32AIOState 
>> *s,
>>               int i;
>>
>>               for (i = 0; i < qiov->niov; ++i) {
>> -                memcpy(p, qiov->iov[i].iov_base, qiov->iov[i].iov_len);
>> +                memcpy(qiov->iov[i].iov_base, p, qiov->iov[i].iov_len);
>>                   p += qiov->iov[i].iov_len;
>>               }
>>               g_free(waiocb->buf);
> 
> Actually this is just
> 
>     iov_from_buf(qiov->iov, qiov->niov, 0, waiocb->buf, -1);

True. Let's keep fix and cleanup separate, though. Feel free to send a
cleanup patch on top of this.

By the way, I think qiov->size instead of -1 would be nicer.

> Or is it iov_to_buf() ? :)

The corrected version is from.

Kevin

Reply via email to