]> xenbits.xensource.com Git - libvirt.git/commitdiff
daemon: stream: don't update events if stream->closed
authorCole Robinson <crobinso@redhat.com>
Mon, 25 Apr 2016 17:18:26 +0000 (13:18 -0400)
committerCole Robinson <crobinso@redhat.com>
Mon, 2 May 2016 14:13:04 +0000 (10:13 -0400)
Calling virStreamFinish prematurely seems to trigger this code path
even after the stream is closed, which ends up hitting this error
message later:

error : virFDStreamUpdateCallback:127 : internal error: stream is not open

Skip this function if stream->closed, which is used in many other places
like read/write handlers

daemon/stream.c

index f072a17842a8b00477f6b7beb8cc553640281734..8a9726059f9b08809d2d8387735506eb07e819ec 100644 (file)
@@ -76,6 +76,8 @@ static void
 daemonStreamUpdateEvents(daemonClientStream *stream)
 {
     int newEvents = 0;
+    if (stream->closed)
+        return;
     if (stream->rx)
         newEvents |= VIR_STREAM_EVENT_WRITABLE;
     if (stream->tx && !stream->recvEOF)