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