* [PATCH] Fix pygrub handling non-default entry
@ 2013-01-09 13:29 Miroslav Rezanina
2013-01-10 8:36 ` Matt Wilson
0 siblings, 1 reply; 3+ messages in thread
From: Miroslav Rezanina @ 2013-01-09 13:29 UTC (permalink / raw)
To: xen-devel
If we pass 0 as pygrub --entry argument (i.e. we want to boot first item), default value is used instead. This is dueto wrong check for range of allowed values of index - 0 is index of first item.
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
Patch:
---
diff --git a/tools/pygrub/src/pygrub b/tools/pygrub/src/pygrub
index 1845485..eedfdb2 100644
--- a/tools/pygrub/src/pygrub
+++ b/tools/pygrub/src/pygrub
@@ -613,7 +613,7 @@ def run_grub(file, entry, fs, cfg_args):
# set the entry to boot as requested
if entry is not None:
idx = get_entry_idx(g.cf, entry)
- if idx is not None and idx > 0 and idx < len(g.cf.images):
+ if idx is not None and idx >= 0 and idx < len(g.cf.images):
sel = idx
if sel == -1:
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] Fix pygrub handling non-default entry
2013-01-09 13:29 [PATCH] Fix pygrub handling non-default entry Miroslav Rezanina
@ 2013-01-10 8:36 ` Matt Wilson
2013-01-17 13:53 ` Ian Campbell
0 siblings, 1 reply; 3+ messages in thread
From: Matt Wilson @ 2013-01-10 8:36 UTC (permalink / raw)
To: Miroslav Rezanina; +Cc: xen-devel
On Wed, Jan 09, 2013 at 02:29:29PM +0100, Miroslav Rezanina wrote:
> If we pass 0 as pygrub --entry argument (i.e. we want to boot first
> item), default value is used instead. This is dueto wrong check for
> range of allowed values of index - 0 is index of first item.
>
> Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
Acked-by: Matt Wilson <msw@amazon.com>
> Patch:
> ---
> diff --git a/tools/pygrub/src/pygrub b/tools/pygrub/src/pygrub
> index 1845485..eedfdb2 100644
> --- a/tools/pygrub/src/pygrub
> +++ b/tools/pygrub/src/pygrub
> @@ -613,7 +613,7 @@ def run_grub(file, entry, fs, cfg_args):
> # set the entry to boot as requested
> if entry is not None:
> idx = get_entry_idx(g.cf, entry)
> - if idx is not None and idx > 0 and idx < len(g.cf.images):
> + if idx is not None and idx >= 0 and idx < len(g.cf.images):
> sel = idx
>
> if sel == -1:
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Fix pygrub handling non-default entry
2013-01-10 8:36 ` Matt Wilson
@ 2013-01-17 13:53 ` Ian Campbell
0 siblings, 0 replies; 3+ messages in thread
From: Ian Campbell @ 2013-01-17 13:53 UTC (permalink / raw)
To: Matt Wilson; +Cc: Miroslav Rezanina, xen-devel@lists.xen.org
On Thu, 2013-01-10 at 08:36 +0000, Matt Wilson wrote:
> On Wed, Jan 09, 2013 at 02:29:29PM +0100, Miroslav Rezanina wrote:
> > If we pass 0 as pygrub --entry argument (i.e. we want to boot first
> > item), default value is used instead. This is dueto wrong check for
> > range of allowed values of index - 0 is index of first item.
> >
> > Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
>
> Acked-by: Matt Wilson <msw@amazon.com>
Acked + applied, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-01-17 13:53 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-09 13:29 [PATCH] Fix pygrub handling non-default entry Miroslav Rezanina
2013-01-10 8:36 ` Matt Wilson
2013-01-17 13:53 ` Ian Campbell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).