libxl: adjust hvm direct boot code
PATCH 1/1 libxl: adjust hvm direct boot code
The -initrd and -append parameters should only be supplied to QEMU iff -kernel parameter is present, because that's how QEMU works.
--- tools/libxl/libxl_dm.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
tools/libxl/libxl_dm.c +6 -5
@@ -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 )
Signature · 1 line
1.7.10.4
Quoted 2 lines · Wei Liu
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?
Quoted 34 lines
Signed-off-by Wei Liu <[email protected]>Cc Ian Campbell <[email protected]>Cc Ian Jackson <[email protected]>Cc Stefano Stabellini <[email protected]>Cc Chunyan Liu <[email protected]>--- tools/libxl/libxl_dm.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)tools/libxl/libxl_dm.c +6
-5@@ -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 )
Quoted 7 lines · Ian Campbell
Quoted 2 lines · Wei Liu
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.
Quoted 35 lines
Quoted 34 lines
Signed-off-by Wei Liu <[email protected]>Cc Ian Campbell <[email protected]>Cc Ian Jackson <[email protected]>Cc Stefano Stabellini <[email protected]>Cc Chunyan Liu <[email protected]>--- tools/libxl/libxl_dm.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)tools/libxl/libxl_dm.c +6
-5@@ -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 )
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
On 1/15/2015 at 10:51 PM, in message
<[email protected]>, Wei Liu <[email protected]>
Quoted 11 lines · wrote:
Quoted 7 lines · Ian Campbell
Quoted 2 lines · Wei Liu
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.
Quoted 43 lines
Wei.
Quoted 9 lines
Quoted 9 lines
Signed-off-by Wei Liu <[email protected]>Cc Ian Campbell <[email protected]>Cc Ian Jackson <[email protected]>Cc Stefano Stabellini <[email protected]>Cc Chunyan Liu <[email protected]>---
tools/libxl/libxl_dm.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)Quoted 5 lines
tools/libxl/libxl_dm.c static char **
Quoted 5 lines
tools/libxl/libxl_dm.c +0
-0@@ -527,14 +527,15 @@ static char **libxl__build_device_model_args_new(libxl__gc *gc,
Quoted 11 lines
tools/libxl/libxl_dm.c static char ** libxl__build_device_model_args_new(libxl__gc *gc,
Quoted 11 lines
tools/libxl/libxl_dm.c +3
-3if (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);
Quoted 5 lines
tools/libxl/libxl_dm.c static char ** libxl__build_device_model_args_new(libxl__gc *gc,
Quoted 5 lines
tools/libxl/libxl_dm.c +2
-2-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);
Quoted 5 lines
Quoted 4 lines
tools/libxl/libxl_dm.c +1
-0+ }if (b_info->u.hvm.serial || b_info->u.hvm.serial_list) {if ( b_info->u.hvm.serial && b_info->u.hvm.serial_list )