qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCHv5] block: add native support for NFS


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCHv5] block: add native support for NFS
Date: Fri, 10 Jan 2014 19:24:15 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130923 Thunderbird/17.0.9

Il 10/01/2014 19:07, Peter Lieven ha scritto:
> 
> 
> 
> Von meinem iPad gesendet
> 
> Am 10.01.2014 um 19:05 schrieb "Paolo Bonzini" <address@hidden>:
> 
>> Il 10/01/2014 18:16, ronnie sahlberg ha scritto:
>>>
>>> There is a common exception though, for the case where you read past
>>> the end of file.
>>> So short reads should normally not happen. Unless QEMU or the guest
>>> sends a request to libnfs to read past the end of the file.
>>
>> Yes, this can happen in QEMU and the various drivers are careful to pad
>> with zeroes.  It could perhaps be moved to block.c, but for now each
>> driver handles it separately.
> 
> ok i will add this as well. however, i thought i had seen code for this in 
> block.c  already?,

No, it corresponds to this code in block/raw-posix.c:

static int aio_worker(void *arg)
{
    RawPosixAIOData *aiocb = arg;
    ssize_t ret = 0;

    switch (aiocb->aio_type & QEMU_AIO_TYPE_MASK) {
    case QEMU_AIO_READ:
        ret = handle_aiocb_rw(aiocb);
        if (ret >= 0 && ret < aiocb->aio_nbytes && aiocb->bs->growable) {
            iov_memset(aiocb->aio_iov, aiocb->aio_niov, ret,
                      0, aiocb->aio_nbytes - ret);

            ret = aiocb->aio_nbytes;
        }
        if (ret == aiocb->aio_nbytes) {
            ret = 0;
        } else if (ret >= 0 && ret < aiocb->aio_nbytes) {
            ret = -EINVAL;
        }
        break;

Paolo



reply via email to

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