From: Michal Novotny <minovotn@redhat.com>
To: xen-devel@lists.xensource.com
Subject: [PATCH] Make PyGrub run first entry in grub config when invalid default boot option provided
Date: Fri, 20 Mar 2009 15:14:46 +0100 [thread overview]
Message-ID: <49C3A4D6.5050501@redhat.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 410 bytes --]
Hello everybody,
I have created a patch for pygrub and I am sending it as an attachment.
This patch mainly solves the issue of invalid default boot option in
VM's configuration. If the entry doesn't exist, it doesn't exit with
IndexError python exception but it uses first entry there to boot up the
machine - same way like standard (real) grub does...
Signed-off-by: Michal Novotny <minovotn@redhat.com>
[-- Attachment #2: xen-pygrub-invalid-default-configuration.patch --]
[-- Type: text/plain, Size: 532 bytes --]
diff -r e1562a36094e tools/pygrub/src/pygrub
--- a/tools/pygrub/src/pygrub Thu Mar 19 17:04:06 2009 +0000
+++ b/tools/pygrub/src/pygrub Fri Mar 20 15:09:31 2009 +0100
@@ -530,7 +530,11 @@
print "No kernel image selected!"
sys.exit(1)
- img = g.cf.images[sel]
+ try:
+ img = g.cf.images[sel]
+ except:
+ log.debug("PyGrub: Default selection is not valid, using first boot configuration...")
+ img = g.cf.images[0]
grubcfg = { "kernel": None, "ramdisk": None, "args": None }
[-- 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:[~2009-03-20 14:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-20 14:14 Michal Novotny [this message]
2009-03-23 17:08 ` [PATCH] Make PyGrub run first entry in grub config when invalid default boot option provided Ian Jackson
2009-03-24 9:21 ` Michal Novotny
2009-03-24 13:33 ` 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=49C3A4D6.5050501@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.