From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: [PATCH 16/16] arm: use /chosen/module1-args for domain 0 command line Date: Mon, 3 Sep 2012 13:30:56 +0000 Message-ID: <1346679056-8108-16-git-send-email-ian.campbell@citrix.com> References: <1346678886.32462.9.camel@zakaz.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1346678886.32462.9.camel@zakaz.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xen.org Cc: Ian Campbell List-Id: xen-devel@lists.xenproject.org Ideally this would use module1-args iff the kernel came from module1-{start,end} and the existing xen,dom0-bootargs if the kernel came from flash, but this approach is simpler and has the sme effect in practice. Signed-off-by: Ian Campbell --- xen/arch/arm/domain_build.c | 23 ++++++++++++++++++++--- 1 files changed, 20 insertions(+), 3 deletions(-) diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c index e96ed10..2b65637 100644 --- a/xen/arch/arm/domain_build.c +++ b/xen/arch/arm/domain_build.c @@ -88,6 +88,8 @@ static int write_properties(struct domain *d, struct kernel_info *kinfo, { int prop; + int had_mod1_args = 0; + for ( prop = fdt_first_property_offset(fdt, node); prop >= 0; prop = fdt_next_property_offset(fdt, prop) ) @@ -104,15 +106,30 @@ static int write_properties(struct domain *d, struct kernel_info *kinfo, prop_len = fdt32_to_cpu(p->len); /* - * In chosen node: replace bootargs with value from - * xen,dom0-bootargs. + * In chosen node: + * + * * replace bootargs with value from module1-args, falling + * back to xen,dom0-bootargs if not present. + * * remove all other module*. */ if ( device_tree_node_matches(fdt, node, "chosen") ) { if ( strcmp(prop_name, "bootargs") == 0 ) continue; - if ( strcmp(prop_name, "xen,dom0-bootargs") == 0 ) + if ( strcmp(prop_name, "module1-args") == 0 ) + { prop_name = "bootargs"; + had_mod1_args = 1; + } + if ( strncmp(prop_name, "module", strlen("module")) == 0 ) + continue; + if ( strcmp(prop_name, "xen,dom0-bootargs") == 0 ) + { + if ( had_mod1_args ) + continue; + else + prop_name = "bootargs"; + } } /* * In a memory node: adjust reg property. -- 1.7.9.1