[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH] Fix pygrub handling non-default entry


  • To: xen-devel@xxxxxxxxxxxxx
  • From: Miroslav Rezanina <mrezanin@xxxxxxxxxx>
  • Date: Wed, 9 Jan 2013 14:29:29 +0100
  • Delivery-date: Wed, 09 Jan 2013 13:30:38 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xen.org>

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@xxxxxxxxxx>
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:

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.