From: Michal Novotny <minovotn@redhat.com>
To: "'xen-devel@lists.xensource.com'" <xen-devel@lists.xensource.com>
Subject: [PATCH] pyGrub: Fix default when out of range
Date: Mon, 28 Jun 2010 19:26:15 +0200 [thread overview]
Message-ID: <4C28DB37.1020100@redhat.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 605 bytes --]
Hi,
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).
Michal
Signed-off-by: Michal Novotny <minovotn@redhat.com>
--
Michal Novotny<minovotn@redhat.com>, RHCE
Virtualization Team (xen userspace), Red Hat
[-- Attachment #2: xen-pygrub-fix-default-out-of-range.patch --]
[-- Type: text/x-patch, Size: 560 bytes --]
diff -r 7b00193bd033 tools/pygrub/src/pygrub
--- a/tools/pygrub/src/pygrub Mon Jun 28 17:40:16 2010 +0100
+++ b/tools/pygrub/src/pygrub Mon Jun 28 19:21:20 2010 +0200
@@ -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)
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
next reply other threads:[~2010-06-28 17:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-28 17:26 Michal Novotny [this message]
2010-06-29 13:54 ` [PATCH] pyGrub: Fix default when out of range Ian Jackson
2010-06-29 14:24 ` Michal Novotny
2010-06-29 15:23 ` Ian Jackson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4C28DB37.1020100@redhat.com \
--to=minovotn@redhat.com \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.