From: Florian Kirstein <xenlist@custom.ray.net>
To: xen-devel@lists.xensource.com
Subject: [PATCH] fix: growing kernel commandline
Date: Fri, 19 Jan 2007 10:41:12 +0100 [thread overview]
Message-ID: <20070119104112.A29181@web.ray.net> (raw)
In-Reply-To: <20070117233659.A22236@web.ray.net>; from xenlist@custom.ray.net on Wed, Jan 17, 2007 at 11:36:59PM +0100
[-- Attachment #1: Type: text/plain, Size: 3475 bytes --]
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 <ray@ray.net>
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 #2: commandline.patch --]
[-- Type: text/plain, Size: 1739 bytes --]
# 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 <ray@ray.net>
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
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
next prev parent reply other threads:[~2007-01-19 9:41 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-17 22:36 Two problems with DomU reboot (cmdline, duplicate domains) Florian Kirstein
2007-01-19 9:41 ` Florian Kirstein [this message]
2007-01-19 10:29 ` [PATCH] fix: growing kernel commandline Ian Campbell
2007-01-19 11:59 ` Florian Kirstein
2007-01-21 8:59 ` Bug: Problematic DomU Duplication on reboot Florian Kirstein
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070119104112.A29181@web.ray.net \
--to=xenlist@custom.ray.net \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.