qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v4 2/3] linux-aio: implement io plug, unplug and


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH v4 2/3] linux-aio: implement io plug, unplug and flush io queue
Date: Thu, 03 Jul 2014 12:04:58 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0

Il 03/07/2014 11:51, Ming Lei ha scritto:
>> +int laio_io_unplug(BlockDriverState *bs, void *aio_ctx, bool unplug)
>> +{
>> +    struct qemu_laio_state *s = aio_ctx;
>> +    int ret = 0;
>> +
>
> How about an assert(s->io_q.plugged > 0); here?
how about just adding a warning because flush io queue uses
the function too?

This suggest that there is a smaller piece of code that both laio_io_unplug ad flush io queue should use. However, not that flush io queue is not necessary. The only place where you're using it (before a call to bdrv_aio_flush) does not need it.

Paolo


Also that is why 'plugged' is defined as signed.

>
>> +    if (unplug && --s->io_q.plugged > 0)
>> +        return 0;
>
> Missing braces.
>
>> +
>> +    if (s->io_q.idx > 0) {
>> +        ret = ioq_submit(s);
>> +    }
>> +
>> +    return ret;




reply via email to

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