From: Samuel Thibault Subject: Re: [PATCH] pvgrub: ignore NUL Date: Thu, 6 Nov 2014 12:39:23 +0100 Message-ID: <20141106113923.GA3182@type.bordeaux.inria.fr> References: <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> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Stefano Stabellini Cc: Anthony Perard , netwiz@crc.id.au, Ian Campbell , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org Stefano Stabellini, le Thu 06 Nov 2014 10:41:28 +0000, a =E9crit : > 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 () >=3D 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 =3D=3D -1 and > = -- = Samuel "And the next time you consider complaining that running Lucid Emacs 19.05 via NFS from a remote Linux machine in Paraguay doesn't seem to get the background colors right, you'll know who to thank." (By Matt Welsh)