* [PATCH for-4.6] libxl: use correct command line for arm guests.
@ 2015-08-06 10:55 Ian Campbell
2015-08-06 11:10 ` Wei Liu
0 siblings, 1 reply; 3+ messages in thread
From: Ian Campbell @ 2015-08-06 10:55 UTC (permalink / raw)
To: ian.jackson, wei.liu2, xen-devel
Cc: julien.grall, Ian Campbell, stefano.stabellini
We need to use libxl__domain_build_state.pv_cmdline in order to pickup
the correct args when using pygrub. libxl_domain_build_info.cmdline is
any args statically configured by the user.
This is consistent with the call to xc_domain_allocate, which takes
the cmdline too (in that case for x86/PV usage).
state->pv_cmdline is also set for non-pygrub guests, since
libxl_bootloader_run propagates info->cmdline if no bootloader is
condfigured.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
For 4.6: This makes pygrub work on ARM.
Should also be backported.
---
tools/libxl/libxl_arm.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/tools/libxl/libxl_arm.c b/tools/libxl/libxl_arm.c
index 42ab6d8..a310737 100644
--- a/tools/libxl/libxl_arm.c
+++ b/tools/libxl/libxl_arm.c
@@ -260,6 +260,7 @@ static int make_root_properties(libxl__gc *gc,
}
static int make_chosen_node(libxl__gc *gc, void *fdt, bool ramdisk,
+ libxl__domain_build_state *state,
const libxl_domain_build_info *info)
{
int res;
@@ -268,8 +269,9 @@ static int make_chosen_node(libxl__gc *gc, void *fdt, bool ramdisk,
res = fdt_begin_node(fdt, "chosen");
if (res) return res;
- if (info->cmdline) {
- res = fdt_property_string(fdt, "bootargs", info->cmdline);
+ if (state->pv_cmdline) {
+ LOG(DEBUG, "/chosen/bootargs = %s", state->pv_cmdline);
+ res = fdt_property_string(fdt, "bootargs", state->pv_cmdline);
if (res) return res;
}
@@ -831,7 +833,7 @@ next_resize:
FDT( fdt_begin_node(fdt, "") );
FDT( make_root_properties(gc, vers, fdt) );
- FDT( make_chosen_node(gc, fdt, !!dom->ramdisk_blob, info) );
+ FDT( make_chosen_node(gc, fdt, !!dom->ramdisk_blob, state, info) );
FDT( make_cpus_node(gc, fdt, info->max_vcpus, ainfo) );
FDT( make_psci_node(gc, fdt) );
--
2.1.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH for-4.6] libxl: use correct command line for arm guests.
2015-08-06 10:55 [PATCH for-4.6] libxl: use correct command line for arm guests Ian Campbell
@ 2015-08-06 11:10 ` Wei Liu
2015-08-06 12:58 ` Ian Campbell
0 siblings, 1 reply; 3+ messages in thread
From: Wei Liu @ 2015-08-06 11:10 UTC (permalink / raw)
To: Ian Campbell
Cc: julien.grall, wei.liu2, stefano.stabellini, ian.jackson,
xen-devel
On Thu, Aug 06, 2015 at 11:55:57AM +0100, Ian Campbell wrote:
> We need to use libxl__domain_build_state.pv_cmdline in order to pickup
> the correct args when using pygrub. libxl_domain_build_info.cmdline is
> any args statically configured by the user.
>
> This is consistent with the call to xc_domain_allocate, which takes
> the cmdline too (in that case for x86/PV usage).
>
> state->pv_cmdline is also set for non-pygrub guests, since
> libxl_bootloader_run propagates info->cmdline if no bootloader is
libxl__bootloader_run
> condfigured.
>
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
> ---
> For 4.6: This makes pygrub work on ARM.
>
It's very low risk. Apply as you see fit.
> Should also be backported.
> ---
> tools/libxl/libxl_arm.c | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/tools/libxl/libxl_arm.c b/tools/libxl/libxl_arm.c
> index 42ab6d8..a310737 100644
> --- a/tools/libxl/libxl_arm.c
> +++ b/tools/libxl/libxl_arm.c
> @@ -260,6 +260,7 @@ static int make_root_properties(libxl__gc *gc,
> }
>
> static int make_chosen_node(libxl__gc *gc, void *fdt, bool ramdisk,
> + libxl__domain_build_state *state,
> const libxl_domain_build_info *info)
> {
> int res;
> @@ -268,8 +269,9 @@ static int make_chosen_node(libxl__gc *gc, void *fdt, bool ramdisk,
> res = fdt_begin_node(fdt, "chosen");
> if (res) return res;
>
> - if (info->cmdline) {
> - res = fdt_property_string(fdt, "bootargs", info->cmdline);
> + if (state->pv_cmdline) {
> + LOG(DEBUG, "/chosen/bootargs = %s", state->pv_cmdline);
> + res = fdt_property_string(fdt, "bootargs", state->pv_cmdline);
> if (res) return res;
> }
>
> @@ -831,7 +833,7 @@ next_resize:
> FDT( fdt_begin_node(fdt, "") );
>
> FDT( make_root_properties(gc, vers, fdt) );
> - FDT( make_chosen_node(gc, fdt, !!dom->ramdisk_blob, info) );
> + FDT( make_chosen_node(gc, fdt, !!dom->ramdisk_blob, state, info) );
> FDT( make_cpus_node(gc, fdt, info->max_vcpus, ainfo) );
> FDT( make_psci_node(gc, fdt) );
>
> --
> 2.1.4
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH for-4.6] libxl: use correct command line for arm guests.
2015-08-06 11:10 ` Wei Liu
@ 2015-08-06 12:58 ` Ian Campbell
0 siblings, 0 replies; 3+ messages in thread
From: Ian Campbell @ 2015-08-06 12:58 UTC (permalink / raw)
To: Wei Liu; +Cc: julien.grall, stefano.stabellini, ian.jackson, xen-devel
On Thu, 2015-08-06 at 12:10 +0100, Wei Liu wrote:
> On Thu, Aug 06, 2015 at 11:55:57AM +0100, Ian Campbell wrote:
> > We need to use libxl__domain_build_state.pv_cmdline in order to pickup
> > the correct args when using pygrub. libxl_domain_build_info.cmdline is
> > any args statically configured by the user.
> >
> > This is consistent with the call to xc_domain_allocate, which takes
> > the cmdline too (in that case for x86/PV usage).
> >
> > state->pv_cmdline is also set for non-pygrub guests, since
> > libxl_bootloader_run propagates info->cmdline if no bootloader is
>
> libxl__bootloader_run
Fixed.
> > condfigured.
... and this.
> >
> > Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
>
> Acked-by: Wei Liu <wei.liu2@citrix.com>
Thanks.
>
> > ---
> > For 4.6: This makes pygrub work on ARM.
> >
>
> It's very low risk. Apply as you see fit.
Done, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-08-06 12:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-06 10:55 [PATCH for-4.6] libxl: use correct command line for arm guests Ian Campbell
2015-08-06 11:10 ` Wei Liu
2015-08-06 12:58 ` Ian Campbell
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.