From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58195) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fV9Hx-0005Et-8U for qemu-devel@nongnu.org; Tue, 19 Jun 2018 01:34:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fV9Hw-0003aC-GS for qemu-devel@nongnu.org; Tue, 19 Jun 2018 01:34:45 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:53672 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fV9Hw-0003a2-CH for qemu-devel@nongnu.org; Tue, 19 Jun 2018 01:34:44 -0400 From: Peter Xu Date: Tue, 19 Jun 2018 13:34:20 +0800 Message-Id: <20180619053426.13065-2-peterx@redhat.com> In-Reply-To: <20180619053426.13065-1-peterx@redhat.com> References: <20180619053426.13065-1-peterx@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH v4 1/7] chardev: comment details for CLOSED event List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , "Daniel P . Berrange" , Thomas Huth , Christian Borntraeger , Fam Zheng , Kevin Wolf , Max Reitz , peterx@redhat.com, Eric Auger , Eric Blake , John Snow , Peter Maydell , Markus Armbruster , Stefan Hajnoczi , "Dr . David Alan Gilbert" , Paolo Bonzini It was unclear before on what does the CLOSED event mean. Meanwhile we add a TODO to fix up the CLOSED event in the future when the in/out ports are different for a chardev. CC: Paolo Bonzini CC: "Marc-Andr=C3=A9 Lureau" CC: Stefan Hajnoczi CC: Markus Armbruster Reviewed-by: Stefan Hajnoczi Signed-off-by: Peter Xu --- include/chardev/char.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/include/chardev/char.h b/include/chardev/char.h index 04de45795e..6f0576e214 100644 --- a/include/chardev/char.h +++ b/include/chardev/char.h @@ -22,7 +22,16 @@ typedef enum { CHR_EVENT_OPENED, /* new connection established */ CHR_EVENT_MUX_IN, /* mux-focus was set to this terminal */ CHR_EVENT_MUX_OUT, /* mux-focus will move on */ - CHR_EVENT_CLOSED /* connection closed */ + CHR_EVENT_CLOSED /* connection closed. NOTE: currently this event + * is only bound to the read port of the chardev. + * Normally the read port and write port of a + * chardev should be the same, but it can be + * different, e.g., for fd chardevs, when the two + * fds are different. So when we received the + * CLOSED event it's still possible that the out + * port is still open. TODO: we should only send + * the CLOSED event when both ports are closed. + */ } QEMUChrEvent; =20 #define CHR_READ_BUF_LEN 4096 --=20 2.17.1