ia64/xen-unstable

changeset 13483:fd0f2b4b7071

[XEND] Fix order of kernel argument construction to prevent arg repeat bug

Make sure user specified kernel args are appended at the end but also
make sure that we do not duplicate root= and ip=.

Signed-off-by: Alastair Tse <atse@xensource.com>
author Alastair Tse <atse@xensource.com>
date Thu Jan 18 15:04:59 2007 +0000 (2007-01-18)
parents 8e79d8d87ecd
children a18ae238eb53
files tools/python/xen/xend/XendConfig.py
line diff
     1.1 --- a/tools/python/xen/xend/XendConfig.py	Thu Jan 18 09:24:40 2007 +0000
     1.2 +++ b/tools/python/xen/xend/XendConfig.py	Thu Jan 18 15:04:59 2007 +0000
     1.3 @@ -1115,19 +1115,17 @@ class XendConfig(dict):
     1.4          # configuration
     1.5          log.debug("update_with_image_sxp(%s)" % scrub_password(image_sxp))
     1.6  
     1.7 -        kernel_args = ""
     1.8 +        # user-specified args must come last: previous releases did this and
     1.9 +        # some domU kernels rely upon the ordering.
    1.10 +        kernel_args = sxp.child_value(image_sxp, 'args', '')
    1.11  
    1.12          # attempt to extract extra arguments from SXP config
    1.13          arg_ip = sxp.child_value(image_sxp, 'ip')
    1.14          if arg_ip and not re.search(r'ip=[^ ]+', kernel_args):
    1.15 -            kernel_args += 'ip=%s ' % arg_ip
    1.16 +            kernel_args = 'ip=%s ' % arg_ip + kernel_args
    1.17          arg_root = sxp.child_value(image_sxp, 'root')
    1.18          if arg_root and not re.search(r'root=', kernel_args):
    1.19 -            kernel_args += 'root=%s ' % arg_root
    1.20 -
    1.21 -        # user-specified args must come last: previous releases did this and
    1.22 -        # some domU kernels rely upon the ordering.
    1.23 -        kernel_args += sxp.child_value(image_sxp, 'args', '')
    1.24 +            kernel_args = 'root=%s ' % arg_root + kernel_args
    1.25  
    1.26          if bootloader:
    1.27              self['_temp_using_bootloader'] = '1'