From patchwork Tue Mar 26 15:11:46 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony Liguori X-Patchwork-Id: 231254 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id A7E932C007E for ; Wed, 27 Mar 2013 02:12:56 +1100 (EST) Received: from localhost ([::1]:56341 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UKVYT-00030M-By for incoming@patchwork.ozlabs.org; Tue, 26 Mar 2013 11:12:53 -0400 Received: from eggs.gnu.org ([208.118.235.92]:57326) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UKVY5-0002uX-QA for qemu-devel@nongnu.org; Tue, 26 Mar 2013 11:12:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UKVY4-0000DP-9t for qemu-devel@nongnu.org; Tue, 26 Mar 2013 11:12:29 -0400 Received: from e23smtp06.au.ibm.com ([202.81.31.148]:33281) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UKVY3-0000DF-Oe for qemu-devel@nongnu.org; Tue, 26 Mar 2013 11:12:28 -0400 Received: from /spool/local by e23smtp06.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 27 Mar 2013 01:07:05 +1000 Received: from d23dlp03.au.ibm.com (202.81.31.214) by e23smtp06.au.ibm.com (202.81.31.212) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 27 Mar 2013 01:07:02 +1000 Received: from d23relay03.au.ibm.com (d23relay03.au.ibm.com [9.190.235.21]) by d23dlp03.au.ibm.com (Postfix) with ESMTP id 03287357804A for ; Wed, 27 Mar 2013 02:12:21 +1100 (EST) Received: from d23av03.au.ibm.com (d23av03.au.ibm.com [9.190.234.97]) by d23relay03.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r2QFBkL855705762 for ; Wed, 27 Mar 2013 02:11:46 +1100 Received: from d23av03.au.ibm.com (loopback [127.0.0.1]) by d23av03.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r2QFBoO7032634 for ; Wed, 27 Mar 2013 02:11:50 +1100 Received: from titi.austin.ibm.com (titi.austin.ibm.com [9.41.105.190]) by d23av03.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id r2QFBl2M032580; Wed, 27 Mar 2013 02:11:49 +1100 From: Anthony Liguori To: qemu-devel@nongnu.org Date: Tue, 26 Mar 2013 10:11:46 -0500 Message-Id: <1364310706-10851-2-git-send-email-aliguori@us.ibm.com> X-Mailer: git-send-email 1.8.0 In-Reply-To: <1364310706-10851-1-git-send-email-aliguori@us.ibm.com> References: <1364310706-10851-1-git-send-email-aliguori@us.ibm.com> x-cbid: 13032615-7014-0000-0000-000002C627DE X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 202.81.31.148 Cc: Peter Maydell , Anthony Liguori Subject: [Qemu-devel] [PATCH 2/2] qtest: use synchronous I/O for char device X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Peter reported that rtc-test would periodically hang. It turns out this was due to an EAGAIN occurring on qemu_chr_fe_write. Instead of heavily refactoring qtest, just use a synchronous version of the write operation for qemu_chr_fe_write to address this problem. Reported-by: Peter Maydell Signed-off-by: Anthony Liguori Reviewed-by: Wenchao Xia --- qtest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qtest.c b/qtest.c index 5e0e9ec..b03b68a 100644 --- a/qtest.c +++ b/qtest.c @@ -191,7 +191,7 @@ static void GCC_FMT_ATTR(2, 3) qtest_send(CharDriverState *chr, len = vsnprintf(buffer, sizeof(buffer), fmt, ap); va_end(ap); - qemu_chr_fe_write(chr, (uint8_t *)buffer, len); + qemu_chr_fe_write_all(chr, (uint8_t *)buffer, len); if (qtest_log_fp && qtest_opened) { fprintf(qtest_log_fp, "%s", buffer); }