WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] tools/pygrub: Fix default when out of ran

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] tools/pygrub: Fix default when out of range
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 08 Jul 2010 02:10:28 -0700
Delivery-date: Thu, 08 Jul 2010 02:15:06 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
# Date 1277824993 -3600
# Node ID 2083a4146013ae2dc2029fa3f24ad1fed9e170ea
# Parent  51160a8ecf7d1c3ea19173a4960a0b962b479908
tools/pygrub: Fix default when out of range

This is the patch to fix pyGrub default value when it's being set out of
range. This patch makes the quiet and interactive mode select the same
default image when the default value for boot entry is out of range,
i.e. when the guest is having wrong configuration in it's boot loader
(like 3 entries with default mistakenly set to 10 etc).

When the boot entry number is being set out of range it falls back to 0
(first entry of boot loader).

Signed-off-by: Michal Novotny <minovotn@xxxxxxxxxx>
---
 tools/pygrub/src/pygrub |    3 +++
 1 files changed, 3 insertions(+)

diff -r 51160a8ecf7d -r 2083a4146013 tools/pygrub/src/pygrub
--- a/tools/pygrub/src/pygrub   Tue Jun 29 16:21:20 2010 +0100
+++ b/tools/pygrub/src/pygrub   Tue Jun 29 16:23:13 2010 +0100
@@ -415,6 +415,9 @@ class Grub:
         timeout = int(self.cf.timeout)
 
         self.selected_image = self.cf.default
+        # If the selected (default) image doesn't exist we select the first 
entry
+        if self.selected_image > len(self.cf.images):
+            self.selected_image = 0
         self.isdone = False
         while not self.isdone:
             self.run_main(timeout)

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] tools/pygrub: Fix default when out of range, Xen patchbot-unstable <=