From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:37269) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QjSJy-00071s-Ta for qemu-devel@nongnu.org; Wed, 20 Jul 2011 04:40:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QjSJo-0003qE-PU for qemu-devel@nongnu.org; Wed, 20 Jul 2011 04:39:57 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51824) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QjSJn-0003py-Sn for qemu-devel@nongnu.org; Wed, 20 Jul 2011 04:39:48 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p6K8dknK017947 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 20 Jul 2011 04:39:46 -0400 Date: Wed, 20 Jul 2011 14:09:02 +0530 From: Amit Shah Message-ID: <20110720083742.GA11592@amit-x200.redhat.com> References: <5444cc7ab1e9654fa953e626da1a50ce54a72ac7.1310462934.git.amit.shah@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH v2 1/1] virtio-console: Prevent abort()s in case of host chardev close List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: Juan Quintela , qemu list , Gerd Hoffmann On (Wed) 20 Jul 2011 [09:10:41], Markus Armbruster wrote: > Amit Shah writes: > > > A host chardev could close just before the guest sends some data to be > > written. This will cause an -EPIPE error. This shouldn't be propagated > > to virtio-serial-bus. > > > > Ideally we should close the port once -EPIPE is received, but since the > > chardev interface doesn't return such meaningful values to its users, > > all we get is -1 for any kind of error. Just return 0 for now and wait > > for chardevs to return better error messages to act better on the return > > messages. > > > > Signed-off-by: Amit Shah > > Besides qemu_chr_write() returning meaningful errors, it would be nice > to have less harsh error handing in do_flush_queued_data(), wouldn't it? I wanted to keep the interfaces cleanly separated: virtio-console.c deals with errors from chardevs. virtio-serial-bus is only a transport between the host and guest; and shouldn't have to deal with chardev errors. It can at most throttle the guest if the host can't consume any more data (which is what it now does on errors). > Short of that, we can either suppress real write errors, or turn a > perfectly normal condition into an error. This patch does the latter, > because it's a much lesser evil. > > Reviewed-by: Markus Armbruster Thanks; Anthony merged this yesterday. Amit