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-devel

[Xen-devel] [RFC] bootloader improvements - pygrub-automatic

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [RFC] bootloader improvements - pygrub-automatic
From: John Levon <levon@xxxxxxxxxxxxxxxxx>
Date: Thu, 9 Nov 2006 19:21:46 +0000
Delivery-date: Thu, 09 Nov 2006 11:22:04 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <20061109192017.GA16487@xxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <20061109192017.GA16487@xxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.9i
# HG changeset patch
# User john.levon@xxxxxxx
# Date 1163095747 28800
# Node ID 6750c8c56b5f139c2b227472d8b9e1f9555fdb6f
# Parent  e2c100dfcb05d8f29d612c29af2edf1dcfd3f7fc
Use pygrub automatically if no kernel is specified.

Signed-off-by: John Levon <john.levon@xxxxxxx>

diff --git a/tools/python/xen/xend/osdep.py b/tools/python/xen/xend/osdep.py
--- a/tools/python/xen/xend/osdep.py
+++ b/tools/python/xen/xend/osdep.py
@@ -20,17 +20,20 @@ import os
 import os
 
 _scripts_dir = {
-    "Linux": "/etc/xen/scripts",
     "SunOS": "/usr/lib/xen/scripts",
 }
 
 _xend_autorestart = {
-    "Linux": True,
     "SunOS": False,
+}
+
+_pygrub_path = {
+    "SunOS": "/usr/lib/xen/bin/pygrub"
 }
 
 def _get(var, default=None):
     return var.get(os.uname()[0], default)
 
 scripts_dir = _get(_scripts_dir, "/etc/xen/scripts")
-xend_autorestart = _get(_xend_autorestart)
+xend_autorestart = _get(_xend_autorestart, True)
+pygrub_path = _get(_pygrub_path, "/usr/bin/pygrub")
diff --git a/tools/python/xen/xm/create.py b/tools/python/xen/xm/create.py
--- a/tools/python/xen/xm/create.py
+++ b/tools/python/xen/xm/create.py
@@ -27,6 +27,7 @@ import xmlrpclib
 import xmlrpclib
 
 from xen.xend import sxp
+from xen.xend import osdep
 from xen.xend import PrettyPrint
 import xen.xend.XendClient
 from xen.xend.XendClient import server
@@ -951,7 +952,7 @@ def preprocess_vnc(vals):
     
 def preprocess(vals):
     if not vals.kernel and not vals.bootloader:
-        err("No kernel specified")
+        vals.bootloader = osdep.pygrub_path
     preprocess_disk(vals)
     preprocess_pci(vals)
     preprocess_ioports(vals)

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