aboutsummaryrefslogtreecommitdiffstats
path: root/tools/pygrub
diff options
context:
space:
mode:
authorMiroslav Rezanina <mrezanin@redhat.com>2013-01-17 13:53:07 +0000
committerMiroslav Rezanina <mrezanin@redhat.com>2013-01-17 13:53:07 +0000
commit0289e710ca443cd4d8698bcac9203c194e764510 (patch)
tree489cf1d136e0d945ba738f8a7a316243a92ab56b /tools/pygrub
parentcc5434c933153c4b8812d1df901f8915c22830a8 (diff)
downloadxen-0289e710ca443cd4d8698bcac9203c194e764510.tar.gz
xen-0289e710ca443cd4d8698bcac9203c194e764510.tar.bz2
xen-0289e710ca443cd4d8698bcac9203c194e764510.zip
Fix pygrub handling non-default entry
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-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
Diffstat (limited to 'tools/pygrub')
-rw-r--r--tools/pygrub/src/pygrub2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/pygrub/src/pygrub b/tools/pygrub/src/pygrub
index 1845485a04..eedfdb2fbf 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: