From patchwork Wed Sep 15 13:04:53 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 182552 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o8FD5p3X011574 for ; Wed, 15 Sep 2010 13:05:51 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753687Ab0IONFk (ORCPT ); Wed, 15 Sep 2010 09:05:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50372 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753408Ab0IONFj (ORCPT ); Wed, 15 Sep 2010 09:05:39 -0400 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o8FD4w9B019322 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 15 Sep 2010 09:04:59 -0400 Received: from shalem.localdomain (vpn2-9-107.ams2.redhat.com [10.36.9.107]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o8FD4qfr026022 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 15 Sep 2010 09:04:57 -0400 Message-ID: <4C90C475.4010809@redhat.com> Date: Wed, 15 Sep 2010 15:04:53 +0200 From: Hans de Goede User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.8) Gecko/20100806 Fedora/3.1.2-1.fc13 Thunderbird/3.1.2 MIME-Version: 1.0 To: virtualization@lists.linux-foundation.org CC: kvm@vger.kernel.org, spice-devel@lists.freedesktop.org, amit.shah@redhat.com, rusty@rustcorp.com.au Subject: PATCH: virtio_console: Fix poll blocking even though there is data to read X-Scanned-By: MIMEDefang 2.67 on 10.5.11.21 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Wed, 15 Sep 2010 13:05:52 +0000 (UTC) diff -up linux-2.6.35.x86_64/drivers/char/virtio_console.c~ linux-2.6.35.x86_64/drivers/char/virtio_console.c --- linux-2.6.35.x86_64/drivers/char/virtio_console.c~ 2010-08-02 00:11:14.000000000 +0200 +++ linux-2.6.35.x86_64/drivers/char/virtio_console.c 2010-09-15 13:39:29.043505000 +0200 @@ -642,7 +642,7 @@ static unsigned int port_fops_poll(struc poll_wait(filp, &port->waitqueue, wait); ret = 0; - if (port->inbuf) + if (!will_read_block(port)) ret |= POLLIN | POLLRDNORM; if (!will_write_block(port)) ret |= POLLOUT;