* [Patch] tweak error reporting for bootloader errors in xm
@ 2006-11-06 15:14 Daniel P. Berrange
2006-12-07 12:10 ` Ewan Mellor
0 siblings, 1 reply; 2+ messages in thread
From: Daniel P. Berrange @ 2006-11-06 15:14 UTC (permalink / raw)
To: xen-devel
[-- 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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Patch] tweak error reporting for bootloader errors in xm
2006-11-06 15:14 [Patch] tweak error reporting for bootloader errors in xm Daniel P. Berrange
@ 2006-12-07 12:10 ` Ewan Mellor
0 siblings, 0 replies; 2+ messages in thread
From: Ewan Mellor @ 2006-12-07 12:10 UTC (permalink / raw)
To: Daniel P. Berrange; +Cc: xen-devel
On Mon, Nov 06, 2006 at 03:14:33PM +0000, Daniel P. Berrange wrote:
> 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>
Applied, thanks, and sorry for the delay.
Ewan.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-12-07 12:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-06 15:14 [Patch] tweak error reporting for bootloader errors in xm Daniel P. Berrange
2006-12-07 12:10 ` Ewan Mellor
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.