From mboxrd@z Thu Jan 1 00:00:00 1970 From: Florian Kirstein Subject: [PATCH] fix: growing kernel commandline Date: Fri, 19 Jan 2007 10:41:12 +0100 Message-ID: <20070119104112.A29181@web.ray.net> References: <20070117233659.A22236@web.ray.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="AqsLC8rIMeq19msA" Return-path: Content-Disposition: inline In-Reply-To: <20070117233659.A22236@web.ray.net>; from xenlist@custom.ray.net on Wed, Jan 17, 2007 at 11:36:59PM +0100 List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --AqsLC8rIMeq19msA Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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@sun.com # 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@build.ray.net # 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 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 --AqsLC8rIMeq19msA Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="commandline.patch" # HG changeset patch # User ray@build.ray.net # 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 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 --AqsLC8rIMeq19msA Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --AqsLC8rIMeq19msA--