From patchwork Mon Apr 25 18:46:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 66599 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp1196372qge; Mon, 25 Apr 2016 11:49:22 -0700 (PDT) X-Received: by 10.194.112.167 with SMTP id ir7mr35141860wjb.14.1461610162606; Mon, 25 Apr 2016 11:49:22 -0700 (PDT) Return-Path: Received: from mx6-phx2.redhat.com (mx6-phx2.redhat.com. [209.132.183.39]) by mx.google.com with ESMTPS id a7si25776413wjn.75.2016.04.25.11.49.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Apr 2016 11:49:22 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.39 as permitted sender) client-ip=209.132.183.39; Authentication-Results: mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.39 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx6-phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u3PIl1uL029027; Mon, 25 Apr 2016 14:47:01 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id u3PIkf2X022124 for ; Mon, 25 Apr 2016 14:46:41 -0400 Received: from colepc.redhat.com (ovpn-113-101.phx2.redhat.com [10.3.113.101]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u3PIkclB012964; Mon, 25 Apr 2016 14:46:41 -0400 From: Cole Robinson To: libvirt-list@redhat.com Date: Mon, 25 Apr 2016 14:46:31 -0400 Message-Id: <31e26aeb170e4b2367ec1ab7df0ea7040588015a.1461609759.git.crobinso@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 5/9] daemon: stream: don't update events if stream->closed X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com 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 | 2 ++ 1 file changed, 2 insertions(+) -- 2.7.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list diff --git a/daemon/stream.c b/daemon/stream.c index f072a17..8a97260 100644 --- a/daemon/stream.c +++ b/daemon/stream.c @@ -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)