From patchwork Wed Sep 15 15:18:23 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: 183002 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 o8FFIcQx032756 for ; Wed, 15 Sep 2010 15:18:38 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754200Ab0IOPSg (ORCPT ); Wed, 15 Sep 2010 11:18:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52842 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754074Ab0IOPSf (ORCPT ); Wed, 15 Sep 2010 11:18:35 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o8FFIQFq016821 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 15 Sep 2010 11:18:26 -0400 Received: from shalem.localdomain (vpn2-9-107.ams2.redhat.com [10.36.9.107]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o8FFINZ0002514 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 15 Sep 2010 11:18:24 -0400 Message-ID: <4C90E3BF.4000408@redhat.com> Date: Wed, 15 Sep 2010 17:18:23 +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 (version 2) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 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 15:18:38 +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 (port_has_data(port)) ret |= POLLIN | POLLRDNORM; if (!will_write_block(port)) ret |= POLLOUT;