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

Re: [libvirt] [PATCH v2 3/6] fdstream: Emit stream abort callback even if poll() doesnt.



On 12/07/2011 11:08 AM, Peter Krempa wrote:
> This patch causes the fdstream driver to call the stream event callback
> if virStreamAbort() is issued on a stream using this driver. This
> prohibited to abort streams from the daemon, as the daemon remote
> handler installs a callback to watch for stream errors as the only mean
> of detecting changes in the stream.
> 
> * src/fdstream.c:
>         - modify close function to call stream event callback
> ---
>  src/fdstream.c |   56 ++++++++++++++++++++++++++++++++++++++++++++++++++------
>  1 files changed, 50 insertions(+), 6 deletions(-)

> 
> +    /* aborting the stream, ensure the callback is called if it's
> +     * registered for stream error event */
> +    if (streamAbort &&
> +        fdst->cb &&
> +        (fdst->events & (VIR_STREAM_EVENT_READABLE |
> +                         VIR_STREAM_EVENT_WRITABLE))) {
> +        /* don't enter this function accidentaly from the callback again */

s/accidentaly/accidentally/

> +        if (fdst->abortCallbackCalled) {
> +            virMutexUnlock(&fdst->lock);
> +            return 0;
> +        }
> +
> +        fdst->abortCallbackCalled = true;
> +        fdst->abortCallbackDispatching = true;
> +        virMutexUnlock(&fdst->lock);
> +
> +        /* call failure callback, poll does report nothing on closed fd */

s/does report/reports/

I've read this for sanity, and it seems to make sense, but I'd feel more
comfortable if Dan Berrange gives the final ack.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


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