From nobody Sun Apr 28 12:44:57 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1497968144961712.5759751764501; Tue, 20 Jun 2017 07:15:44 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E25A9B163; Tue, 20 Jun 2017 14:15:37 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CBEA27D90A; Tue, 20 Jun 2017 14:15:36 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id C627341F77; Tue, 20 Jun 2017 14:15:33 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v5KEFWgo015117 for ; Tue, 20 Jun 2017 10:15:32 -0400 Received: by smtp.corp.redhat.com (Postfix) id 93F897D906; Tue, 20 Jun 2017 14:15:32 +0000 (UTC) Received: from caroline.brq.redhat.com (unknown [10.43.2.67]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1DCBA7D90A for ; Tue, 20 Jun 2017 14:15:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com E25A9B163 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com E25A9B163 From: Martin Kletzander To: libvir-list@redhat.com Date: Tue, 20 Jun 2017 16:15:24 +0200 Message-Id: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] docs: Add callback-related info to virStream{Abort, Finish} 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 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 20 Jun 2017 14:15:39 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" When one has a non-blocking stream and aborts or finishes it without removing the callback, any event loop invocation will trigger that callback, but it cannot be removed any more. We cannot remove the callback automatically from virStream{Abort,Finish} functions due to forward-compatibility. So let's at least document this behaviour, because it is not easy to find out the reason for. Signed-off-by: Martin Kletzander Reviewed-by: John Ferlan --- Notes: The discussion about the reasons: https://www.redhat.com/archives/libvir-list/2017-June/msg00038.html src/libvirt-stream.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/libvirt-stream.c b/src/libvirt-stream.c index d7a8f581608f..c49f20264fd7 100644 --- a/src/libvirt-stream.c +++ b/src/libvirt-stream.c @@ -1131,6 +1131,9 @@ virStreamEventRemoveCallback(virStreamPtr stream) * errors, so if this returns a success code the application can * be sure that all data has been successfully processed. * + * If the stream is non-blocking, any callback must be removed + * beforehand. + * * Returns 0 on success, -1 upon error */ int @@ -1170,6 +1173,9 @@ virStreamFinish(virStreamPtr stream) * streams this can be used to inform the driver that it * should stop sending data. * + * If the stream is non-blocking, any callback must be removed + * beforehand. + * * Returns 0 on success, -1 upon error */ int --=20 2.13.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list