[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] Instead of knowing explicitly about the pygrub entry option, allow



# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 40cd49c88d691d3c33c4bafb136055c5700aca00
# Parent  42a70a5297531270612557e49908597e5ddb9ba3
Instead of knowing explicitly about the pygrub entry option, allow
passing arbitrary options to the bootloader and deprecate the bootentry
option.

Signed-off-by: Jeremy Katz <katzj@xxxxxxxxxx>

diff -r 42a70a529753 -r 40cd49c88d69 tools/python/xen/xend/XendBootloader.py
--- a/tools/python/xen/xend/XendBootloader.py   Wed May 03 11:00:57 2006 +0100
+++ b/tools/python/xen/xend/XendBootloader.py   Wed May 03 11:02:30 2006 +0100
@@ -19,13 +19,13 @@ from XendLogging import log
 from XendLogging import log
 from XendError import VmError
 
-def bootloader(blexec, disk, quiet = 0, entry = None):
+def bootloader(blexec, disk, quiet = 0, blargs = None):
     """Run the boot loader executable on the given disk and return a
     config image.
     @param blexec  Binary to use as the boot loader
     @param disk Disk to run the boot loader on.
     @param quiet Run in non-interactive mode, just booting the default.
-    @param entry Default entry to boot."""
+    @param blargs Arguments to pass to the bootloader."""
     
     if not os.access(blexec, os.X_OK):
         msg = "Bootloader isn't executable"
@@ -48,8 +48,8 @@ def bootloader(blexec, disk, quiet = 0, 
         if quiet:
             args.append("-q")
         args.append("--output=%s" %(fifo,))
-        if entry is not None:
-            args.append("--entry=%s" %(entry,))
+        if blargs is not None:
+            args.extend(blargs.split())
         args.append(disk)
 
         try:
diff -r 42a70a529753 -r 40cd49c88d69 tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py   Wed May 03 11:00:57 2006 +0100
+++ b/tools/python/xen/xend/XendDomainInfo.py   Wed May 03 11:02:30 2006 +0100
@@ -132,6 +132,7 @@ ROUNDTRIPPING_CONFIG_ENTRIES = [
     ('memory',     int),
     ('maxmem',     int),
     ('bootloader', str),
+    ('bootloader_args', str),
     ('features', str),
     ]
 
@@ -571,6 +572,7 @@ class XendDomainInfo:
             defaultInfo('memory',       lambda: 0)
             defaultInfo('maxmem',       lambda: 0)
             defaultInfo('bootloader',   lambda: None)
+            defaultInfo('bootloader_args', lambda: None)            
             defaultInfo('backend',      lambda: [])
             defaultInfo('device',       lambda: [])
             defaultInfo('image',        lambda: None)
@@ -1630,7 +1632,8 @@ class XendDomainInfo:
             if disk is None:
                 continue
             fn = blkdev_uname_to_file(disk)
-            blcfg = bootloader(self.info['bootloader'], fn, 1)
+            blcfg = bootloader(self.info['bootloader'], fn, 1,
+                               self.info['bootloader_args'])
             break
         if blcfg is None:
             msg = "Had a bootloader specified, but can't find disk"
diff -r 42a70a529753 -r 40cd49c88d69 tools/python/xen/xm/create.py
--- a/tools/python/xen/xm/create.py     Wed May 03 11:00:57 2006 +0100
+++ b/tools/python/xen/xm/create.py     Wed May 03 11:02:30 2006 +0100
@@ -122,9 +122,13 @@ gopts.var('bootloader', val='FILE',
           fn=set_value, default=None,
           use="Path to bootloader.")
 
+gopts.var('bootargs', val='NAME',
+          fn=set_value, default=None,
+          use="Arguments to pass to boot loader")
+
 gopts.var('bootentry', val='NAME',
           fn=set_value, default=None,
-          use="Entry to boot via boot loader")
+          use="DEPRECATED.  Entry to boot via boot loader.  Use bootargs.")
 
 gopts.var('kernel', val='FILE',
           fn=set_value, default=None,
@@ -620,8 +624,13 @@ def run_bootloader(vals):
     (uname, dev, mode, backend) = vals.disk[0]
     file = blkif.blkdev_uname_to_file(uname)
 
+    if vals.bootentry:
+        warn("The bootentry option is deprecated.  Use bootargs and pass "
+             "--entry= directly.")
+        vals.bootargs = "--entry=%s" %(vals.bootentry,)
+
     return bootloader(vals.bootloader, file, not vals.console_autoconnect,
-                      vals.bootentry)
+                      vals.bootargs)
 
 def make_config(vals):
     """Create the domain configuration.
@@ -654,8 +663,10 @@ def make_config(vals):
         config.append(['backend', ['tpmif']])
 
     if vals.bootloader:
+        config_image = run_bootloader(vals)
         config.append(['bootloader', vals.bootloader])
-        config_image = run_bootloader(vals)
+        if vals.bootargs:
+            config.append(['bootloader_args'], vals.bootargs)
     else:
         config_image = configure_image(vals)
     config.append(['image', config_image])

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.