From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O4ClK-0000ye-MM for qemu-devel@nongnu.org; Tue, 20 Apr 2010 08:41:10 -0400 Received: from [140.186.70.92] (port=48931 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O4ClE-0000tG-O7 for qemu-devel@nongnu.org; Tue, 20 Apr 2010 08:41:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O4Ckw-0006mL-JS for qemu-devel@nongnu.org; Tue, 20 Apr 2010 08:40:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:27209) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O4Ckw-0006mE-7j for qemu-devel@nongnu.org; Tue, 20 Apr 2010 08:40:46 -0400 Date: Tue, 20 Apr 2010 18:09:01 +0530 From: Amit Shah Subject: Re: [Qemu-devel] [PATCH v3 2/4] char: Add ability to provide a callback when write won't return -EAGAIN Message-ID: <20100420123901.GA21150@amit-x200.redhat.com> References: <1271319378-9811-1-git-send-email-amit.shah@redhat.com> <4BCD90C2.7050009@redhat.com> <20100420114420.GA20123@amit-x200.redhat.com> <201004201328.48953.paul@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201004201328.48953.paul@codesourcery.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paul Brook Cc: Gerd Hoffmann , qemu list On (Tue) Apr 20 2010 [13:28:48], Paul Brook wrote: > > It would be useful to have a debugging mode where the chardev layer > deliberately returns spurious EAGAIN and short writes. Otherwise you've got a > lot of very poorly tested device fallback code. I have low confidence in > getting this right first time :-) Ah, hm, I'll see how I can do that. BTW I test this a couple of ways: 1. make the guest write till the host blocks because the chardev can't accept any more data. I ascertain this during development using some fprintfs. Any more data that gets written fills the guest's vq and then the write() in the guest starts blocking. Once this happens, my testcase succeeds. 2. Send a huge file from the guest to the host and compare the sha1sums at the end of the file transfer. This always results in the chardev returning -eagain a few times (confirm during testing via fprintfs again). The testcase passes if the sha1sums match. The test suite is at http://fedorapeople.org/gitweb?p=amitshah/public_git/test-virtserial.git Amit