From: "Daniel P. Berrange" <berrange@redhat.com>
To: xen-devel@lists.xensource.com
Subject: [Patch] tweak error reporting for bootloader errors in xm
Date: Mon, 6 Nov 2006 15:14:33 +0000 [thread overview]
Message-ID: <20061106151430.GA9932@redhat.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 974 bytes --]
The xm command does some basic validation of the 'bootloader' parameter
before trying to run it, however, the level of detail reported isn't as
clear as it could be.
For example if I typo the bootloader param it says:
# xm create XenGuest1
Using config file "XenGuest1".
Error: Bootloader isn't executable
The attached patch makes it do an explicit check for path existance prior
to the one for executable permissions. It also prints out the path being
tested.
# xm create XenGuest1
Using config file "XenGuest1".
Error: Bootloader '/usr/sbin/pygrub' does not exist
Signed-off-by: Daniel P, Berrange <berrange@redhat.com>
Regards,
Dan.
--
|=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=|
|=- Perl modules: http://search.cpan.org/~danberr/ -=|
|=- Projects: http://freshmeat.net/~danielpb/ -=|
|=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|
[-- Attachment #2: xm-bootloader-errors.patch --]
[-- Type: text/plain, Size: 756 bytes --]
diff -r 20204db0891b tools/python/xen/xm/create.py
--- a/tools/python/xen/xm/create.py Thu Nov 02 18:52:04 2006 +0000
+++ b/tools/python/xen/xm/create.py Mon Nov 06 10:11:05 2006 -0500
@@ -671,8 +671,10 @@ def configure_hvm(config_image, vals):
config_image.append(['vncpasswd', vals.vncpasswd])
def run_bootloader(vals, config_image):
+ if not os.access(vals.bootloader, os.F_OK):
+ err("Bootloader '%s' does not exist" % vals.bootloader)
if not os.access(vals.bootloader, os.X_OK):
- err("Bootloader isn't executable")
+ err("Bootloader '%s' isn't executable" % vals.bootloader)
if len(vals.disk) < 1:
err("No disks configured and boot loader requested")
(uname, dev, mode, backend) = vals.disk[0]
[-- 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:[~2006-11-06 15:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-06 15:14 Daniel P. Berrange [this message]
2006-12-07 12:10 ` [Patch] tweak error reporting for bootloader errors in xm Ewan Mellor
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=20061106151430.GA9932@redhat.com \
--to=berrange@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.