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

[Xen-devel] [PATCH] fix: growing kernel commandline



Hi,

replying to myself... Obviously my problem No.1 (growing commandline)
is already known, but I didn't find much besides a small comment from
Ewan Mellor yesterday here on the list about it, after finding the
relevant source parts responsible.

So for the interested few, it's caused by John's Patch...
# User john.levon@xxxxxxx                                                       
# Date 1167936545 28800                                                         
# Node ID acda3f65d9797126035cc8cae65d8804415c6036                              
...and is already fixed in xen-3.0-unstable. But unfortunately the released
3.0.4.1 is broken, so I transfered the patch from 3.0-unstable and modified
it a bit, so the commandline really remains in the same order as in
previous xen versions (in testing ip= and root= are swapped). Whoever
needs that, my scripts don't :). 

Oh, and one more thing: what's the idea behind the ip=[^ ] regexp
in the test? Different from the root= parameter check, this only matches
non-empty ip parameters, so if there's an empty ip= parameter, we add
our ip parameter anyway. Which won't change a thing in the "new order",
as I think the kernel uses the last ip= parameter it finds, which then
still is the empty one? However, I left this unchanged...

So: I'm not sure if users are supposed to post patches also for the 
xen-3.0.4-testing.hg repository, but as most productive environments
are probably using that instead of -unstable, here's the patch for
those who are annoyed by this problem and want to patch their local
sources:

# HG changeset patch
# User ray@xxxxxxxxxxxxx
# Node ID c25e4e8a9668fc25c0424c2936d2e4f94345ab89
# Parent  f98a6a9df1b4ea6022d05cdb2d189cb7645408d2
Fix kernel commandline generation to prevent duplication of ip= and 
root= parameters on reboot, while preserving the parameter ordering
known from previous versions

Signed-off-by: Florian Kirstein <ray@xxxxxxx>

diff -r f98a6a9df1b4 -r c25e4e8a9668 tools/python/xen/xend/XendConfig.py
--- a/tools/python/xen/xend/XendConfig.py       Mon Jan  8 12:54:41 2007 -0800
+++ b/tools/python/xen/xend/XendConfig.py       Fri Jan 19 10:12:20 2007 +0100
@@ -1104,19 +1104,15 @@ class XendConfig(dict):
 
         self['PV_kernel'] = sxp.child_value(image_sxp, 'kernel','')
         self['PV_ramdisk'] = sxp.child_value(image_sxp, 'ramdisk','')
-        kernel_args = ""
+        kernel_args = sxp.child_value(image_sxp, 'args', '')
         
         # attempt to extract extra arguments from SXP config
+        arg_root = sxp.child_value(image_sxp, 'root')
+        if arg_root and not re.search(r'root=', kernel_args):
+            kernel_args = 'root=%s ' % arg_root + kernel_args
         arg_ip = sxp.child_value(image_sxp, 'ip')
         if arg_ip and not re.search(r'ip=[^ ]+', kernel_args):
-            kernel_args += 'ip=%s ' % arg_ip
-        arg_root = sxp.child_value(image_sxp, 'root')
-        if arg_root and not re.search(r'root=', kernel_args):
-            kernel_args += 'root=%s ' % arg_root
-
-        # user-specified args must come last: previous releases did this and
-        # some domU kernels rely upon the ordering.
-        kernel_args += sxp.child_value(image_sxp, 'args', '')
+            kernel_args = 'ip=%s ' % arg_ip + kernel_args
 
         self['PV_args'] = kernel_args

Now I'm still stuck with my other (duplicate created DomUs shreddering the
filesystem) problem, will do tests to reproduce that later today...

(:ul8er, r@y

Attachment: commandline.patch
Description: Text document

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

 


Rackspace

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