* [PATCH] libxl: adjust hvm direct boot code
@ 2015-01-15 12:29 Wei Liu
2015-01-15 13:50 ` Ian Campbell
0 siblings, 1 reply; 4+ messages in thread
From: Wei Liu @ 2015-01-15 12:29 UTC (permalink / raw)
To: xen-devel
Cc: Chunyan Liu, Ian Jackson, Wei Liu, Ian Campbell,
Stefano Stabellini
The -initrd and -append parameters should only be supplied to QEMU iff
-kernel parameter is present, because that's how QEMU works.
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Chunyan Liu <cyliu@suse.com>
---
tools/libxl/libxl_dm.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index c2b0487..7226f5d 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -527,14 +527,15 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,
if (b_info->type == LIBXL_DOMAIN_TYPE_HVM) {
int ioemu_nics = 0;
- if (b_info->kernel)
+ if (b_info->kernel) {
flexarray_vappend(dm_args, "-kernel", b_info->kernel, NULL);
- if (b_info->ramdisk)
- flexarray_vappend(dm_args, "-initrd", b_info->ramdisk, NULL);
+ if (b_info->ramdisk)
+ flexarray_vappend(dm_args, "-initrd", b_info->ramdisk, NULL);
- if (b_info->cmdline)
- flexarray_vappend(dm_args, "-append", b_info->cmdline, NULL);
+ if (b_info->cmdline)
+ flexarray_vappend(dm_args, "-append", b_info->cmdline, NULL);
+ }
if (b_info->u.hvm.serial || b_info->u.hvm.serial_list) {
if ( b_info->u.hvm.serial && b_info->u.hvm.serial_list )
--
1.7.10.4
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] libxl: adjust hvm direct boot code
2015-01-15 12:29 [PATCH] libxl: adjust hvm direct boot code Wei Liu
@ 2015-01-15 13:50 ` Ian Campbell
2015-01-15 14:51 ` Wei Liu
0 siblings, 1 reply; 4+ messages in thread
From: Ian Campbell @ 2015-01-15 13:50 UTC (permalink / raw)
To: Wei Liu; +Cc: Stefano Stabellini, Ian Jackson, Chunyan Liu, xen-devel
On Thu, 2015-01-15 at 12:29 +0000, Wei Liu wrote:
> The -initrd and -append parameters should only be supplied to QEMU iff
> -kernel parameter is present, because that's how QEMU works.
What do you think of catching this e.g. in the setdefault function and
warning or erroring in this case?
> Signed-off-by: Wei Liu <wei.liu2@citrix.com>
> Cc: Ian Campbell <ian.campbell@citrix.com>
> Cc: Ian Jackson <ian.jackson@eu.citrix.com>
> Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> Cc: Chunyan Liu <cyliu@suse.com>
> ---
> tools/libxl/libxl_dm.c | 11 ++++++-----
> 1 file changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
> index c2b0487..7226f5d 100644
> --- a/tools/libxl/libxl_dm.c
> +++ b/tools/libxl/libxl_dm.c
> @@ -527,14 +527,15 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,
> if (b_info->type == LIBXL_DOMAIN_TYPE_HVM) {
> int ioemu_nics = 0;
>
> - if (b_info->kernel)
> + if (b_info->kernel) {
> flexarray_vappend(dm_args, "-kernel", b_info->kernel, NULL);
>
> - if (b_info->ramdisk)
> - flexarray_vappend(dm_args, "-initrd", b_info->ramdisk, NULL);
> + if (b_info->ramdisk)
> + flexarray_vappend(dm_args, "-initrd", b_info->ramdisk, NULL);
>
> - if (b_info->cmdline)
> - flexarray_vappend(dm_args, "-append", b_info->cmdline, NULL);
> + if (b_info->cmdline)
> + flexarray_vappend(dm_args, "-append", b_info->cmdline, NULL);
> + }
>
> if (b_info->u.hvm.serial || b_info->u.hvm.serial_list) {
> if ( b_info->u.hvm.serial && b_info->u.hvm.serial_list )
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] libxl: adjust hvm direct boot code
2015-01-15 13:50 ` Ian Campbell
@ 2015-01-15 14:51 ` Wei Liu
2015-01-16 1:49 ` Chun Yan Liu
0 siblings, 1 reply; 4+ messages in thread
From: Wei Liu @ 2015-01-15 14:51 UTC (permalink / raw)
To: Ian Campbell
Cc: Ian Jackson, Stefano Stabellini, Wei Liu, Chunyan Liu, xen-devel
On Thu, Jan 15, 2015 at 01:50:27PM +0000, Ian Campbell wrote:
> On Thu, 2015-01-15 at 12:29 +0000, Wei Liu wrote:
> > The -initrd and -append parameters should only be supplied to QEMU iff
> > -kernel parameter is present, because that's how QEMU works.
>
> What do you think of catching this e.g. in the setdefault function and
> warning or erroring in this case?
>
I'm OK with that. Explicitly warning or erroring is more sensible than
silently dropping those values.
Wei.
> > Signed-off-by: Wei Liu <wei.liu2@citrix.com>
> > Cc: Ian Campbell <ian.campbell@citrix.com>
> > Cc: Ian Jackson <ian.jackson@eu.citrix.com>
> > Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> > Cc: Chunyan Liu <cyliu@suse.com>
> > ---
> > tools/libxl/libxl_dm.c | 11 ++++++-----
> > 1 file changed, 6 insertions(+), 5 deletions(-)
> >
> > diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
> > index c2b0487..7226f5d 100644
> > --- a/tools/libxl/libxl_dm.c
> > +++ b/tools/libxl/libxl_dm.c
> > @@ -527,14 +527,15 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,
> > if (b_info->type == LIBXL_DOMAIN_TYPE_HVM) {
> > int ioemu_nics = 0;
> >
> > - if (b_info->kernel)
> > + if (b_info->kernel) {
> > flexarray_vappend(dm_args, "-kernel", b_info->kernel, NULL);
> >
> > - if (b_info->ramdisk)
> > - flexarray_vappend(dm_args, "-initrd", b_info->ramdisk, NULL);
> > + if (b_info->ramdisk)
> > + flexarray_vappend(dm_args, "-initrd", b_info->ramdisk, NULL);
> >
> > - if (b_info->cmdline)
> > - flexarray_vappend(dm_args, "-append", b_info->cmdline, NULL);
> > + if (b_info->cmdline)
> > + flexarray_vappend(dm_args, "-append", b_info->cmdline, NULL);
> > + }
> >
> > if (b_info->u.hvm.serial || b_info->u.hvm.serial_list) {
> > if ( b_info->u.hvm.serial && b_info->u.hvm.serial_list )
>
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] libxl: adjust hvm direct boot code
2015-01-15 14:51 ` Wei Liu
@ 2015-01-16 1:49 ` Chun Yan Liu
0 siblings, 0 replies; 4+ messages in thread
From: Chun Yan Liu @ 2015-01-16 1:49 UTC (permalink / raw)
To: Ian Campbell, Wei Liu; +Cc: xen-devel, Ian Jackson, Stefano Stabellini
>>> On 1/15/2015 at 10:51 PM, in message
<20150115145156.GA3945@zion.uk.xensource.com>, Wei Liu <wei.liu2@citrix.com>
wrote:
> On Thu, Jan 15, 2015 at 01:50:27PM +0000, Ian Campbell wrote:
> > On Thu, 2015-01-15 at 12:29 +0000, Wei Liu wrote:
> > > The -initrd and -append parameters should only be supplied to QEMU iff
> > > -kernel parameter is present, because that's how QEMU works.
> >
> > What do you think of catching this e.g. in the setdefault function and
> > warning or erroring in this case?
> >
>
> I'm OK with that. Explicitly warning or erroring is more sensible than
> silently dropping those values.
Thanks Wei. With the check, can report error to users earlier.
>
> Wei.
>
> > > Signed-off-by: Wei Liu <wei.liu2@citrix.com>
> > > Cc: Ian Campbell <ian.campbell@citrix.com>
> > > Cc: Ian Jackson <ian.jackson@eu.citrix.com>
> > > Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> > > Cc: Chunyan Liu <cyliu@suse.com>
> > > ---
> > > tools/libxl/libxl_dm.c | 11 ++++++-----
> > > 1 file changed, 6 insertions(+), 5 deletions(-)
> > >
> > > diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
> > > index c2b0487..7226f5d 100644
> > > --- a/tools/libxl/libxl_dm.c
> > > +++ b/tools/libxl/libxl_dm.c
> > > @@ -527,14 +527,15 @@ static char **
> libxl__build_device_model_args_new(libxl__gc *gc,
> > > if (b_info->type == LIBXL_DOMAIN_TYPE_HVM) {
> > > int ioemu_nics = 0;
> > >
> > > - if (b_info->kernel)
> > > + if (b_info->kernel) {
> > > flexarray_vappend(dm_args, "-kernel", b_info->kernel, NULL);
> > >
> > > - if (b_info->ramdisk)
> > > - flexarray_vappend(dm_args, "-initrd", b_info->ramdisk, NULL);
> > > + if (b_info->ramdisk)
> > > + flexarray_vappend(dm_args, "-initrd", b_info->ramdisk,
> NULL);
> > >
> > > - if (b_info->cmdline)
> > > - flexarray_vappend(dm_args, "-append", b_info->cmdline, NULL);
> > > + if (b_info->cmdline)
> > > + flexarray_vappend(dm_args, "-append", b_info->cmdline,
> NULL);
> > > + }
> > >
> > > if (b_info->u.hvm.serial || b_info->u.hvm.serial_list) {
> > > if ( b_info->u.hvm.serial && b_info->u.hvm.serial_list )
> >
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-01-16 1:49 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-15 12:29 [PATCH] libxl: adjust hvm direct boot code Wei Liu
2015-01-15 13:50 ` Ian Campbell
2015-01-15 14:51 ` Wei Liu
2015-01-16 1:49 ` Chun Yan Liu
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.