From patchwork Mon Feb 4 12:50:47 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Shah X-Patchwork-Id: 217900 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 5D7152C02A5 for ; Mon, 4 Feb 2013 23:51:37 +1100 (EST) Received: from localhost ([::1]:58661 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U2LWJ-0005mr-IA for incoming@patchwork.ozlabs.org; Mon, 04 Feb 2013 07:51:35 -0500 Received: from eggs.gnu.org ([208.118.235.92]:50084) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U2LW6-0005fm-JC for qemu-devel@nongnu.org; Mon, 04 Feb 2013 07:51:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U2LW5-0003JV-B3 for qemu-devel@nongnu.org; Mon, 04 Feb 2013 07:51:22 -0500 Received: from mx1.redhat.com ([209.132.183.28]:56107) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U2LW5-0003JR-3i for qemu-devel@nongnu.org; Mon, 04 Feb 2013 07:51:21 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r14CpJdG021352 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 4 Feb 2013 07:51:19 -0500 Received: from localhost ([10.3.113.7]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r14CpERF026628; Mon, 4 Feb 2013 07:51:16 -0500 From: Amit Shah To: Anthony Liguori Date: Mon, 4 Feb 2013 18:20:47 +0530 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Amit Shah , qemu list Subject: [Qemu-devel] [PATCH 1/4] char: poll a frontend only if it's writable 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 If the frontend reports it's not writable, don't start polling it for data yet. Signed-off-by: Amit Shah --- qemu-char.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qemu-char.c b/qemu-char.c index 2b714cf..5731d02 100644 --- a/qemu-char.c +++ b/qemu-char.c @@ -569,7 +569,7 @@ static gboolean io_watch_poll_prepare(GSource *source, gint *timeout_) iwp->max_size = iwp->fd_can_read(iwp->opaque); if (iwp->max_size == 0) { - return TRUE; + return FALSE; } return g_io_watch_funcs.prepare(source, timeout_);