[XEND] Fix order of kernel argument construction to prevent arg repeat bug
authorAlastair Tse <atse@xensource.com>
Thu, 18 Jan 2007 15:04:59 +0000 (15:04 +0000)
committerAlastair Tse <atse@xensource.com>
Thu, 18 Jan 2007 15:04:59 +0000 (15:04 +0000)
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>
tools/python/xen/xend/XendConfig.py

index fd9afb0b3a25a8629cd44c5cce45f66ffce804a2..93781120454c0bc26a1199f280d8b49f9043173c 100644 (file)
@@ -1115,19 +1115,17 @@ class XendConfig(dict):
         # configuration
         log.debug("update_with_image_sxp(%s)" % scrub_password(image_sxp))
 
-        kernel_args = ""
+        # 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', '')
 
         # attempt to extract extra arguments from SXP config
         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
+            kernel_args = 'ip=%s ' % arg_ip + kernel_args
         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 = 'root=%s ' % arg_root + kernel_args
 
         if bootloader:
             self['_temp_using_bootloader'] = '1'