From patchwork Thu Nov 6 10:41:28 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 40273 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9092024237 for ; Thu, 6 Nov 2014 10:43:53 +0000 (UTC) Received: by mail-wi0-f199.google.com with SMTP id r20sf482796wiv.6 for ; Thu, 06 Nov 2014 02:43:52 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:date:from:to:in-reply-to:message-id :references:user-agent:mime-version:cc:subject:precedence:list-id :list-unsubscribe:list-post:list-help:list-subscribe:sender :errors-to:x-original-sender:x-original-authentication-results :mailing-list:list-archive:content-type:content-transfer-encoding; bh=GWvHZ9zMEZFOq71zYR0EjBNnG1tPVdYchYDUthRhvmw=; b=lrvzhymnnh4TJ5QU8qHqkau3YRhABSc6/m/dQ6A2kbtc0q1gAlUYmWjow0qmSFbmU0 h/HQfKy2/IVH6yRfC6wQkxVQ3HFVuK04hjiDQI+v8Etzfq36gzx8EVE6+ajt0XModgv3 ddvNlbkL7YkIp7DnpaDzjbVPOwHZ5qTsamnBamcIA3Z/relYkyf/imV862/1rx+wZ6Et 7qJDXrPmD8kdAhUHa1jdIyQlJlcOq1GfGtnoqKw9Z27ONGKaF7j/klU1271eEvHuNBNF +9idLOBt+SV0h2bs35Wun6UIGRNs8YE8zfbmoAkC/ooUFghLgB7dMWG3F09LyW2mH3+k EDig== X-Gm-Message-State: ALoCoQkjeyL0d5dZYUt5470I09APHuyJeu95M9TiYYgY476iluYEoepXEQsdRVQndQ1F24MCyQdB X-Received: by 10.112.38.101 with SMTP id f5mr593523lbk.7.1415270632841; Thu, 06 Nov 2014 02:43:52 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.23.133 with SMTP id m5ls66469laf.102.gmail; Thu, 06 Nov 2014 02:43:52 -0800 (PST) X-Received: by 10.152.7.175 with SMTP id k15mr4247428laa.58.1415270632475; Thu, 06 Nov 2014 02:43:52 -0800 (PST) Received: from mail-la0-f45.google.com (mail-la0-f45.google.com. [209.85.215.45]) by mx.google.com with ESMTPS id rs4si11112837lbb.12.2014.11.06.02.43.52 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 06 Nov 2014 02:43:52 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.45 as permitted sender) client-ip=209.85.215.45; Received: by mail-la0-f45.google.com with SMTP id pn19so2379211lab.18 for ; Thu, 06 Nov 2014 02:43:52 -0800 (PST) X-Received: by 10.112.77.74 with SMTP id q10mr4245282lbw.66.1415270632397; Thu, 06 Nov 2014 02:43:52 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.184.201 with SMTP id ew9csp24492lbc; Thu, 6 Nov 2014 02:43:51 -0800 (PST) X-Received: by 10.52.170.176 with SMTP id an16mr2022324vdc.32.1415270631152; Thu, 06 Nov 2014 02:43:51 -0800 (PST) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id kn20si4646908vdb.84.2014.11.06.02.43.50 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 06 Nov 2014 02:43:51 -0800 (PST) Received-SPF: none (google.com: xen-devel-bounces@lists.xen.org does not designate permitted sender hosts) client-ip=50.57.142.19; Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XmKVn-00023q-VA; Thu, 06 Nov 2014 10:41:55 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XmKVm-00021i-Hu for xen-devel@lists.xen.org; Thu, 06 Nov 2014 10:41:54 +0000 Received: from [85.158.137.68] by server-13.bemta-3.messagelabs.com id 7D/A0-27623-1705B545; Thu, 06 Nov 2014 10:41:53 +0000 X-Env-Sender: Stefano.Stabellini@citrix.com X-Msg-Ref: server-7.tower-31.messagelabs.com!1415270511!10811840!1 X-Originating-IP: [66.165.176.89] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n X-StarScan-Received: X-StarScan-Version: 6.12.4; banners=-,-,- X-VirusChecked: Checked Received: (qmail 18077 invoked from network); 6 Nov 2014 10:41:52 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-7.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 6 Nov 2014 10:41:52 -0000 X-IronPort-AV: E=Sophos;i="5.07,325,1413244800"; d="scan'208";a="188710164" Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com (10.13.107.78) with Microsoft SMTP Server id 14.3.181.6; Thu, 6 Nov 2014 05:41:36 -0500 Received: from kaball.uk.xensource.com ([10.80.2.59]) by ukmail1.uk.xensource.com with esmtp (Exim 4.69) (envelope-from ) id 1XmKVU-0003n5-Ds; Thu, 06 Nov 2014 10:41:36 +0000 Date: Thu, 6 Nov 2014 10:41:28 +0000 From: Stefano Stabellini X-X-Sender: sstabellini@kaball.uk.xensource.com To: In-Reply-To: <5447D30A.4040704@crc.id.au> Message-ID: References: <544678FE.2000801@crc.id.au> <5446CF1D.6030307@crc.id.au> <1413968436.20604.53.camel@citrix.com> <20141022095906.GG3659@type.bordeaux.inria.fr> <1413974439.18118.1.camel@citrix.com> <1413979542.19198.14.camel@citrix.com> <5447CBE4.6090104@crc.id.au> <1413992405.19198.24.camel@citrix.com> <5447D30A.4040704@crc.id.au> User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 X-DLP: MIA2 Cc: netwiz@crc.id.au, Ian Campbell , Stefano Stabellini , xen-devel@lists.xen.org, Anthony Perard Subject: [Xen-devel] [PATCH] pvgrub: ignore NUL X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Post: , List-Help: , List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: stefano.stabellini@eu.citrix.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.45 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Archive: When using pvgrub in graphical mode with vnc, the grub timeout doesn't work: the countdown doesn't even start. With a serial terminal the problem doesn't occur and the countdown works as expected. It turns out that the problem is that when using a graphical terminal, checkkey () returns 0 instead of -1 when there is no activity on the mouse or keyboard. As a consequence grub thinks that the user typed something and interrupts the count down. To fix the issue simply ignore keystrokes returning 0, that is the NUL character anyway. Add a patch to grub.patches to do that. Signed-off-by: Stefano Stabellini Tested-by: Steven Haigh Acked-by: Samuel Thibault diff --git a/stubdom/grub.patches/11graphics-keyboard.diff b/stubdom/grub.patches/11graphics-keyboard.diff new file mode 100644 index 0000000..fe17b20 --- /dev/null +++ b/stubdom/grub.patches/11graphics-keyboard.diff @@ -0,0 +1,13 @@ +diff --git a/stage2/stage2.c b/stage2/stage2.c +index 9d9fcc3..8353a3b 100644 +--- a/stage2/stage2.c ++++ b/stage2/stage2.c +@@ -395,7 +395,7 @@ restart: + pressed. + This avoids polling (relevant in the grub-shell and later on + in grub if interrupt driven I/O is done). */ +- if (checkkey () >= 0 || grub_timeout < 0) ++ if (checkkey () > 0 || grub_timeout < 0) + { + /* Key was pressed, show which entry is selected before GETKEY, + since we're comming in here also on GRUB_TIMEOUT == -1 and