support xen HVM direct kernel boot
v2 cover support xen HVM direct kernel boot
After your valuable suggestions, I'll continue the work to support stubdom. But since stubdom currently uses qemu-xen-traditional and will switch to qemu upstream in future, in a period of time, stubdom HVM direct kernel boot won't be in working status. So, before continuing the stubdom support work, I updated existing patch series, adding proper error messages for rombios and stubdom limitation, adding man page descriptions and other trival updates to make it a complete working patch series. For those using seabios and non stubdom, they can use now.
xen side patch: pass kernel/initrd/append parameters to qemu-dm qemu side patch: reuse load_linux() for xen hvm direct kernel boot.
Different from pc_memory_init which does lots of ram alloc work and rom/bios loading work, for xen, we only need to init a basic fw_cfg device used by load_linux() to store ADDRs and linuxboot.bin/multiboot.bin to retrive ADDRs, then load_linux(), after that, do real add option rom work to add linuxboot.bin/multiboot.bin to system option rom. Other things would be done by seabios smoothly.
v1 is here:
http://lists.gnu.org/archive/html/qemu-devel/2014-05/msg06233.html
Chunyan Liu (2):
xen: pass kernel initrd to qemu
qemu: support xen hvm direct kernel boot
RFC PATCH v2 1/2 xen: pass kernel initrd to qemu
xen side patch to support xen HVM direct kernel boot:
support 'kernel', 'ramdisk', 'root', 'extra' in HVM config file, parse config file, pass -kernel, -initrd, -append parameters to qemu. It's working with seabios and non-stubdom. Rombios and stubdom cases are currently not supported.
[config example] kernel="/mnt/vmlinuz-3.0.13-0.27-default" ramdisk="/mnt/initrd-3.0.13-0.27-default" root="/dev/hda2"
extra="console=tty0 console=ttyS0"
disk=[ 'file:/mnt/images/bjz_04_sles11_sp2/disk0.raw,hda,w', ]
---
Changes:
* update man page to document the new parameters for HVM guests (move them from PV special options to general options) and note current limitation
* rombios and stubdom are not working yet, add libxl error messages to inform that.
* extract "parse commandline" code to a common helper for both HVM and PV parse_config_data to use.
docs/man/xl.cfg.pod.5 | 50 ++++++++++++++++++++++++---------------- tools/libxl/libxl_dm.c | 15 ++++++++++++ tools/libxl/libxl_types.idl | 3 +++ tools/libxl/xl_cmdimpl.c | 56 +++++++++++++++++++++++++++------------------ 4 files changed, 82 insertions(+), 42 deletions(-)
docs/man/xl.cfg.pod.5 +30 -20
@@ -304,6 +304,34 @@ Action to take if the domain crashes. Default is C<destroy>. =back +=head3 Direct Kernel Boot + +Currently, direct kernel boot can be supported by PV guests, and HVM guests +in limitation. For HVM guests, in case of stubdom-dm and old rombios, +direct kernel boot is not supported. + +=over 4 + +=item B<kernel="PATHNAME"> + +Load the specified file as the kernel image. + +=item B<ramdisk="PATHNAME"> + +Load the specified file as the ramdisk. + +=item B<root="STRING"> + +Append B<root="STRING"> to the kernel command line (Note: it is guest +specific what meaning this has). + +=item B<extra="STRING"> + +Append B<STRING> to the kernel command line. (Note: it is guest +specific what meaning this has). + +=back + =head3 Other Options =over 4
@@ -647,20 +675,12 @@ The following options apply only to Paravirtual guests. =over 4 -=item B<kernel="PATHNAME"> - -Load the specified file as the kernel image. Either B<kernel> or -B<bootloader> must be specified for PV guests. - -=item B<ramdisk="PATHNAME"> - -Load the specified file as the ramdisk. - =item B<bootloader="PROGRAM"> Run C<PROGRAM> to find the kernel image and ramdisk to use. Normally C<PROGRAM> would be C<pygrub>, which is an emulation of -grub/grub2/syslinux. +grub/grub2/syslinux. Either B<kernel> or B<bootloader> must be specified +for PV guests. =item B<bootloader_args=[ "ARG", "ARG", ...]>
@@ -668,16 +688,6 @@ Append B<ARG>s to the arguments to the B<bootloader> program. Alternatively if the argument is a simple string then it will be split into words at whitespace (this second option is deprecated). -=item B<root="STRING"> - -Append B<root="STRING"> to the kernel command line (Note: it is guest -specific what meaning this has). - -=item B<extra="STRING"> - -Append B<STRING> to the kernel command line. Note: it is guest -specific what meaning this has). - =item B<e820_host=BOOLEAN> Selects whether to expose the host e820 (memory map) to the guest via
tools/libxl/libxl_dm.c +15 -0
@@ -196,6 +196,12 @@ static char ** libxl__build_device_model_args_old(libxl__gc *gc,int nr_set_cpus =0 ;char *s; +if (b_info->u.hvm.kernel) { +LOG (ERROR ,"%s: direct kernel boot is not supported by %s" , + __func__, dm); +return NULL ; + } +if (b_info->u.hvm.serial) {flexarray_vappend (dm_args,"-serial" , b_info->u.hvm.serial,NULL ); }
@@ -479,6 +485,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->u.hvm.kernel) +flexarray_vappend (dm_args,"-kernel" , b_info->u.hvm.kernel,NULL ); + +if (b_info->u.hvm.ramdisk) +flexarray_vappend (dm_args,"-initrd" , b_info->u.hvm.ramdisk,NULL ); + +if (b_info->u.hvm.cmdline) +flexarray_vappend (dm_args,"-append" , b_info->u.hvm.cmdline,NULL ); +if (b_info->u.hvm.serial) {flexarray_vappend (dm_args,"-serial" , b_info->u.hvm.serial,NULL ); }
tools/libxl/libxl_types.idl +3 -0
@@ -336,6 +336,9 @@ libxl_domain_build_info = Struct("domain_build_info",[ ("event_channels", uint32), ("u", KeyedUnion(None, libxl_domain_type, "type", [("hvm", Struct(None, [("firmware", string), + ("kernel", string), + ("cmdline", string), + ("ramdisk", string), ("bios", libxl_bios_type), ("pae", libxl_defbool), ("apic", libxl_defbool),
tools/libxl/xl_cmdimpl.c +34 -22
82 lines not on this page · raw message
Signature · 1 line
1.8.4.5
Re: [Qemu-devel] [RFC PATCH V2 1/2] xen: pass kernel initrd to qemu
On Wed, 2014-06-04 at 15:34 +0800, Chunyan Liu wrote:
Please can you remember to CC Ian Jackson on these patches in the future as a) he's a toolstack maintainer and b) he's the one doing work on upstream qemu stubdom so he may have concerns about this stuff.
Thanks,
Ian.
Quoted 245 lines
xen side patch to support xen HVM direct kernel boot:
support 'kernel', 'ramdisk', 'root', 'extra' in HVM config file, parse config file, pass -kernel, -initrd, -append parameters to qemu. It's working with seabios and non-stubdom. Rombios and stubdom cases are currently not supported.[config example] kernel="/mnt/vmlinuz-3.0.13-0.27-default" ramdisk="/mnt/initrd-3.0.13-0.27-default" root="/dev/hda2"
extra="console=tty0 console=ttyS0"
disk=[ 'file:/mnt/images/bjz_04_sles11_sp2/disk0.raw,hda,w', ]Signed-off-by Chunyan Liu <[email protected]>---
Changes:
* update man page to document the new parameters for HVM guests (move them from PV special options to general options) and note current limitation
* rombios and stubdom are not working yet, add libxl error messages to inform that.
* extract "parse commandline" code to a common helper for both HVM and PVparse_config_datato use.docs/man/xl.cfg.pod.5 | 50 ++++++++++++++++++++++++---------------- tools/libxl/libxl_dm.c | 15 ++++++++++++ tools/libxl/libxl_types.idl | 3 +++ tools/libxl/xl_cmdimpl.c | 56 +++++++++++++++++++++++++++------------------ 4 files changed, 82 insertions(+), 42 deletions(-)docs/man/xl.cfg.pod.5 +30
-20@@ -304,6 +304,34 @@ Action to take if the domain crashes. Default is C<destroy>. =back +=head3 Direct Kernel Boot + +Currently, direct kernel boot can be supported by PV guests, and HVM guests +in limitation. For HVM guests, in case of stubdom-dm and old rombios, +direct kernel boot is not supported. + +=over 4 + +=item B<kernel="PATHNAME"> + +Load the specified file as the kernel image. + +=item B<ramdisk="PATHNAME"> + +Load the specified file as the ramdisk. + +=item B<root="STRING"> + +Append B<root="STRING"> to the kernel command line (Note: it is guest +specific what meaning this has). + +=item B<extra="STRING"> + +Append B<STRING> to the kernel command line. (Note: it is guest +specific what meaning this has). + +=back + =head3 Other Options =over 4@@ -647,20 +675,12 @@ The following options apply only to Paravirtual guests. =over 4 -=item B<kernel="PATHNAME"> - -Load the specified file as the kernel image. Either B<kernel> or -B<bootloader> must be specified for PV guests. - -=item B<ramdisk="PATHNAME"> - -Load the specified file as the ramdisk. - =item B<bootloader="PROGRAM"> Run C<PROGRAM> to find the kernel image and ramdisk to use. Normally C<PROGRAM> would be C<pygrub>, which is an emulation of -grub/grub2/syslinux. +grub/grub2/syslinux. Either B<kernel> or B<bootloader> must be specified +for PV guests. =item B<bootloader_args=[ "ARG", "ARG", ...]>@@ -668,16 +688,6 @@ Append B<ARG>s to the arguments to the B<bootloader> program. Alternatively if the argument is a simple string then it will be split into words at whitespace (this second option is deprecated). -=item B<root="STRING"> - -Append B<root="STRING"> to the kernel command line (Note: it is guest -specific what meaning this has). - -=item B<extra="STRING"> - -Append B<STRING> to the kernel command line. Note: it is guest -specific what meaning this has). - =item B<e820_host=BOOLEAN> Selects whether to expose the host e820 (memory map) to the guest viatools/libxl/libxl_dm.c +15
-0@@ -196,6 +196,12 @@ static char ** libxl__build_device_model_args_old(libxl__gc *gc,int nr_set_cpus =0 ;char *s; +if (b_info->u.hvm.kernel) { +LOG (ERROR ,"%s: direct kernel boot is not supported by %s" , + __func__, dm); +return NULL ; + } +if (b_info->u.hvm.serial) {flexarray_vappend (dm_args,"-serial" , b_info->u.hvm.serial,NULL ); }@@ -479,6 +485,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->u.hvm.kernel) +flexarray_vappend (dm_args,"-kernel" , b_info->u.hvm.kernel,NULL ); + +if (b_info->u.hvm.ramdisk) +flexarray_vappend (dm_args,"-initrd" , b_info->u.hvm.ramdisk,NULL ); + +if (b_info->u.hvm.cmdline) +flexarray_vappend (dm_args,"-append" , b_info->u.hvm.cmdline,NULL ); +if (b_info->u.hvm.serial) {flexarray_vappend (dm_args,"-serial" , b_info->u.hvm.serial,NULL ); }tools/libxl/libxl_types.idl +3
-0@@ -336,6 +336,9 @@ libxl_domain_build_info = Struct("domain_build_info",[ ("event_channels", uint32), ("u", KeyedUnion(None, libxl_domain_type, "type", [("hvm", Struct(None, [("firmware", string), + ("kernel", string), + ("cmdline", string), + ("ramdisk", string), ("bios", libxl_bios_type), ("pae", libxl_defbool), ("apic", libxl_defbool),tools/libxl/xl_cmdimpl.c +34
-22@@ -725,6 +725,29 @@ static void parse_top_level_sdl_options(XLU_Config *config,xlu_cfg_replace_string (config,"xauthority" , &sdl->xauthority,0 ); } +static char *parse_cmdline (XLU_Config *config) +{ +char *cmdline =NULL ; +const char *root =NULL , *extra ="" ; + +xlu_cfg_get_string (config,"root" , &root,0 ); +xlu_cfg_get_string (config,"extra" , &extra,0 ); + +if (root) { +if (asprintf (&cmdline,"root=%s %s" , root, extra) ==-1 ) + cmdline =NULL ; + }else { + cmdline =strdup (extra); + } + +if ((root || extra) && !cmdline) { +fprintf (stderr,"Failed to allocate memory for cmdline\n" ); +exit (1 ); + } + +return cmdline; +} + static void parse_config_data(const char *config_source, const char *config_data, int config_len,@@ -1007,9 +1030,16 @@ static void parse_config_data(const char *config_source,switch (b_info->type) {case LIBXL_DOMAIN_TYPE_HVM : -if (!xlu_cfg_get_string (config,"kernel" , &buf,0 )) -fprintf (stderr,"WARNING: ignoring \"kernel\" directive for HVM guest. " -"Use \"firmware_override\" instead if you really want a non-default firmware\n" ); +if (!xlu_cfg_get_string (config,"kernel" , &buf,0 )) { +if (strstr (buf,"hvmloader" )) +fprintf (stderr,"WARNING: ignoring \"kernel\" directive for HVM guest. " +"Use \"firmware_override\" instead if you really want a non-default firmware\n" ); +else + b_info->u.hvm.kernel =strdup (buf); + } + + b_info->u.hvm.cmdline =parse_cmdline (config); +xlu_cfg_replace_string (config,"ramdisk" , &b_info->u.hvm.ramdisk,0 );xlu_cfg_replace_string (config,"firmware_override" , &b_info->u.hvm.firmware,0 );@@ -1061,26 +1091,8 @@ static void parse_config_data(const char *config_source,break ;case LIBXL_DOMAIN_TYPE_PV : { -char *cmdline =NULL ; -const char *root =NULL , *extra ="" ; -xlu_cfg_replace_string (config,"kernel" , &b_info->u.pv.kernel,0 ); -xlu_cfg_get_string (config,"root" , &root,0 ); -xlu_cfg_get_string (config,"extra" , &extra,0 ); - -if (root) { -if (asprintf (&cmdline,"root=%s %s" , root, extra) ==-1 ) - cmdline =NULL ; - }else { - cmdline =strdup (extra); - } - -if ((root || extra) && !cmdline) { -fprintf (stderr,"Failed to allocate memory for cmdline\n" ); -exit (1 ); - } -xlu_cfg_replace_string (config,"bootloader" , &b_info->u.pv.bootloader,0 ); switch (xlu_cfg_get_list_as_string_list(config, "bootloader_args", &b_info->u.pv.bootloader_args, 1))@@ -1108,7 +1120,7 @@ static void parse_config_data(const char *config_source,exit (1 ); } - b_info->u.pv.cmdline = cmdline; + b_info->u.pv.cmdline =parse_cmdline (config);xlu_cfg_replace_string (config,"ramdisk" , &b_info->u.pv.ramdisk,0 );break ; }
Re: [Qemu-devel] [RFC PATCH V2 1/2] xen: pass kernel initrd to qemu
In reply to Chunyan LiuQuoted 5 lines · Chunyan Liu
xen side patch to support xen HVM direct kernel boot:
support 'kernel', 'ramdisk', 'root', 'extra' in HVM config file, parse config file, pass -kernel, -initrd, -append parameters to qemu. It's working with seabios and non-stubdom. Rombios and stubdom cases are currently not supported.
I think everywhere you say "rombios" here and in the patch you actually mean "qemu-xen-traditional" and likewise when you say "seabios" you should really say "qemu-xen". The BIOS which happens to be used with the qemu is rather secondary/incidental.
With that said does this stuff work with OVMF? If not then you might have to say "qemu-xen when using the default BIOS (seabios)" etc.
Quoted 29 lines
[config example] kernel="/mnt/vmlinuz-3.0.13-0.27-default" ramdisk="/mnt/initrd-3.0.13-0.27-default" root="/dev/hda2"
extra="console=tty0 console=ttyS0"
disk=[ 'file:/mnt/images/bjz_04_sles11_sp2/disk0.raw,hda,w', ]Signed-off-by Chunyan Liu <[email protected]>---
Changes:
* update man page to document the new parameters for HVM guests (move them from PV special options to general options) and note current limitation
* rombios and stubdom are not working yet, add libxl error messages to inform that.
* extract "parse commandline" code to a common helper for both HVM and PVparse_config_datato use.docs/man/xl.cfg.pod.5 | 50 ++++++++++++++++++++++++---------------- tools/libxl/libxl_dm.c | 15 ++++++++++++ tools/libxl/libxl_types.idl | 3 +++ tools/libxl/xl_cmdimpl.c | 56 +++++++++++++++++++++++++++------------------ 4 files changed, 82 insertions(+), 42 deletions(-)docs/man/xl.cfg.pod.5 +0
-0
docs/man/xl.cfg.pod.5 Action to take if the domain crashes. Default is C<destroy>. · line 310
Quoted 7 lines
docs/man/xl.cfg.pod.5 +4
-0@@ -304,6 +304,34 @@ Action to take if the domain crashes. Default is C<destroy>. =back +=head3 Direct Kernel Boot + +Currently, direct kernel boot can be supported by PV guests, and HVM guests +in limitation.
"with limitations" or "in some configurations".
tools/libxl/libxl_dm.c static char ** libxl__build_device_model_args_old(libxl__gc *gc, · line 201
Quoted 11 lines
tools/libxl/libxl_dm.c +3
-0@@ -196,6 +196,12 @@ static char ** libxl__build_device_model_args_old(libxl__gc *gc,int nr_set_cpus =0 ;char *s; +if (b_info->u.hvm.kernel) { +LOG (ERROR ,"%s: direct kernel boot is not supported by %s" , + __func__, dm);
I know there are existing example in this file, but using __func__ like this is wrong, the LOG macro already adds it.
Also instead of printing dm (the full path to the binary) I think you should just print "qemu-xen-traditional" here.
Quoted 8 lines
tools/libxl/libxl_dm.c +3
-0+return NULL ; + } +if (b_info->u.hvm.serial) {flexarray_vappend (dm_args,"-serial" , b_info->u.hvm.serial,NULL ); }@@ -479,6 +485,15 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,if (b_info->type ==LIBXL_DOMAIN_TYPE_HVM ) {
tools/libxl/libxl_dm.c static char ** libxl__build_device_model_args_new(libxl__gc *gc, · line 495
Quoted 10 lines
tools/libxl/libxl_dm.c +8
-0int ioemu_nics =0 ; +if (b_info->u.hvm.kernel) +flexarray_vappend (dm_args,"-kernel" , b_info->u.hvm.kernel,NULL ); + +if (b_info->u.hvm.ramdisk) +flexarray_vappend (dm_args,"-initrd" , b_info->u.hvm.ramdisk,NULL ); + +if (b_info->u.hvm.cmdline) +flexarray_vappend (dm_args,"-append" , b_info->u.hvm.cmdline,NULL );
You could use flexarray_append_pair here, but I appreciate you might want to go for consistency with the existing code here. I don't mind either way.
Quoted 9 lines
tools/libxl/libxl_dm.c +1
-0+if (b_info->u.hvm.serial) {flexarray_vappend (dm_args,"-serial" , b_info->u.hvm.serial,NULL ); }tools/libxl/libxl_types.idl +0
-0
tools/libxl/libxl_types.idl libxl_domain_build_info = Struct("domain_build_info",[ · line 341
Quoted 6 lines
tools/libxl/libxl_types.idl +3
-0@@ -336,6 +336,9 @@ libxl_domain_build_info = Struct("domain_build_info",[ ("event_channels", uint32), ("u", KeyedUnion(None, libxl_domain_type, "type", [("hvm", Struct(None, [("firmware", string), + ("kernel", string), + ("cmdline", string), + ("ramdisk", string),
You need to add a suitable LIBXL_HAVE_FOO define to libxl.h to indicate that this new functionality is available, see the comment and existing examples in libxl.h.
A single one to cover all three would be fine. LIBXL_HAVE_BUILDINFO_HVM_DIRECT_KERNEL_BOOT perhaps?
Quoted 8 lines
tools/libxl/libxl_types.idl +0
-0("bios", libxl_bios_type), ("pae", libxl_defbool), ("apic", libxl_defbool),tools/libxl/xl_cmdimpl.c +0
-0
tools/libxl/xl_cmdimpl.c static void parse_top_level_sdl_options(XLU_Config *config, · line 734
Quoted 10 lines
tools/libxl/xl_cmdimpl.c +7
-0@@ -725,6 +725,29 @@ static void parse_top_level_sdl_options(XLU_Config *config,xlu_cfg_replace_string (config,"xauthority" , &sdl->xauthority,0 ); } +static char *parse_cmdline (XLU_Config *config) +{ +char *cmdline =NULL ; +const char *root =NULL , *extra ="" ; + +xlu_cfg_get_string (config,"root" , &root,0 ); +xlu_cfg_get_string (config,"extra" , &extra,0 );
I sort of hate this root=/extra= stuff which comes from the PV world, since it is sort of exposing Linux-isms (e.g. root=%s etc).
I'd far rather just have cmdline=. Since for PV this is needed for xm cfg file compatibility we are sort of stuck with it but for this new HVM functionality we don't have those backward compat concerns.
If you want to just do xlu_cfg_get_string(..., "cmdline", ...) for the HVM case I would be OK with that but if you feel like it would you mind very much going a bit further and implementing cmdline for PV, such that it takes precedence over root/extra? Something like:
xlu_cfg_get_string (config, "cmdline", &cmdline, 0);
xlu_cfg_get_string (config, "root", &root, 0);
xlu_cfg_get_string (config, "extra", &extra, 0);
if (cmdline && root)
fprintf(stderr, "Warning: ignoring deprecated root= in favour of cmdline=\n");
if (cmdline && extra)
fprintf(stderr, "Warning: ignoring deprecated extra= in favour of cmdline=\n");
if (!cmdline) {
/* The existing code for dealing with extra/root etc */
...asprintf(&cmdline, ...)
}
return cmdline? (In doing this I think it would be simpler to allow root=/extra= for HVM guests too even though they are immediately deprecated rather than making all of the above conditional)
tools/libxl/xl_cmdimpl.c static void parse_config_data(const char *config_source, · line 1036
Quoted 11 lines
tools/libxl/xl_cmdimpl.c +4
-3@@ -1007,9 +1030,16 @@ static void parse_config_data(const char *config_source,switch (b_info->type) {case LIBXL_DOMAIN_TYPE_HVM : -if (!xlu_cfg_get_string (config,"kernel" , &buf,0 )) -fprintf (stderr,"WARNING: ignoring \"kernel\" directive for HVM guest. " -"Use \"firmware_override\" instead if you really want a non-default firmware\n" ); +if (!xlu_cfg_get_string (config,"kernel" , &buf,0 )) { +if (strstr (buf,"hvmloader" )) +fprintf (stderr,"WARNING: ignoring \"kernel\" directive for HVM guest. " +"Use \"firmware_override\" instead if you really want a non-default firmware\n" );
I think we've had this for a few releases now, I wonder if it has served its purpose? Especially since the strstr check could have false positives and negatives.
IOW perhaps we should just delete this check and handle kernel the
natural way. Trouble is I cannot estimate what sort of support burden
this will make for us. Perhaps keep the warning but continue on having
set u.hvm.kernel? e.g.
fprintf(stderr,
"WARNING: You seem to be using the \"kernel\" directive to override the firmware (hvmloader) for an HVM guest.\n" "This option will boot the named kernel directly with no firmware present.\n"
"Use \"firmware_override\" instread if you really want a non-default firmware.\n");
?
Ian.
Re: [Qemu-devel] [Xen-devel] [RFC PATCH V2 1/2] xen: pass kernel initrd to qemu
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
On 6/12/2014 at 05:58 PM, in message
<[email protected]>, Ian Campbell
Quoted 7 lines · <[email protected]> wrote:
Quoted 5 lines · Chunyan Liu
xen side patch to support xen HVM direct kernel boot:
support 'kernel', 'ramdisk', 'root', 'extra' in HVM config file, parse config file, pass -kernel, -initrd, -append parameters to qemu. It's working with seabios and non-stubdom. Rombios and stubdom cases are currently not supported.
Quoted 6 lines
I think everywhere you say "rombios" here and in the patch you actually mean "qemu-xen-traditional" and likewise when you say "seabios" you should really say "qemu-xen". The BIOS which happens to be used with the qemu is rather secondary/incidental.
With that said does this stuff work with OVMF?
Not tried.
Quoted 2 lines
If not then you might
have to say "qemu-xen when using the default BIOS (seabios)" etc.
Yes, that's clearer. I'll update.
Quoted 36 lines
Quoted 9 lines
[config example] kernel="/mnt/vmlinuz-3.0.13-0.27-default" ramdisk="/mnt/initrd-3.0.13-0.27-default" root="/dev/hda2"
extra="console=tty0 console=ttyS0"
disk=[ 'file:/mnt/images/bjz_04_sles11_sp2/disk0.raw,hda,w', ]Quoted 4 lines
Signed-off-by Chunyan Liu <[email protected]>---
Changes:
* update man page to document the new parameters for HVM guests (movethem
docs/man/xl.cfg.pod.5 Action to take if the domain crashes. Default is
Quoted 18 lines
from PV special options to general options) and note current limitation
* rombios and stubdom are not working yet, add libxl error messages to inform that.
* extract "parse commandline" code to a common helper for both HVM and PVparse_config_datato use.docs/man/xl.cfg.pod.5 | 50 ++++++++++++++++++++++++---------------- tools/libxl/libxl_dm.c | 15 ++++++++++++ tools/libxl/libxl_types.idl | 3 +++ tools/libxl/xl_cmdimpl.c | 56 +++++++++++++++++++++++++++------------------ 4 files changed, 82 insertions(+), 42 deletions(-)docs/man/xl.cfg.pod.5 +0
-0@@ -304,6 +304,34 @@ Action to take if the domain crashes. Default isC<destroy>.
Quoted 3 lines
docs/man/xl.cfg.pod.5 +0
-0=back
Quoted 7 lines
docs/man/xl.cfg.pod.5 Action to take if the domain crashes. Default is C<destroy>.
Quoted 3 lines
docs/man/xl.cfg.pod.5 +3
-0+=head3 Direct Kernel Boot + +Currently, direct kernel boot can be supported by PV guests, and HVMguests
docs/man/xl.cfg.pod.5 Action to take if the domain crashes. Default is · line 309
Quoted 1 line
docs/man/xl.cfg.pod.5 +1
-0+in limitation."with limitations" or "in some configurations".
Will update.
Quoted 14 lines
tools/libxl/libxl_dm.c static char **
Quoted 6 lines
tools/libxl/libxl_dm.c +0
-0@@ -196,6 +196,12 @@ static char **libxl__build_device_model_args_old(libxl__gc *gc,
tools/libxl/libxl_dm.c static char ** libxl__build_device_model_args_old(libxl__gc *gc, · line 201
Quoted 6 lines
tools/libxl/libxl_dm.c +3
-0int nr_set_cpus =0 ;char *s; +if (b_info->u.hvm.kernel) { +LOG (ERROR ,"%s: direct kernel boot is not supported by %s" , + __func__, dm);
Quoted 5 lines
I know there are existing example in this file, but using
__func__like this is wrong, the LOG macro already adds it.Also instead of printing dm (the full path to the binary) I think you should just print "qemu-xen-traditional" here.
Will update.
Quoted 32 lines
tools/libxl/libxl_dm.c static char ** libxl__build_device_model_args_old(libxl__gc *gc,
Quoted 5 lines
tools/libxl/libxl_dm.c +3
-0+return NULL ; + } +if (b_info->u.hvm.serial) { flexarray_vappend(dm_args, "-serial", b_info->u.hvm.serial,NULL);
tools/libxl/libxl_dm.c static char **
Quoted 2 lines
tools/libxl/libxl_dm.c +0
-0}@@ -479,6 +485,15 @@ static char **libxl__build_device_model_args_new(libxl__gc *gc,
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
-0if (b_info->type ==LIBXL_DOMAIN_TYPE_HVM ) {int ioemu_nics =0 ; +if (b_info->u.hvm.kernel) + flexarray_vappend(dm_args, "-kernel", b_info->u.hvm.kernel,NULL);
tools/libxl/libxl_dm.c static char ** libxl__build_device_model_args_new(libxl__gc *gc,
Quoted 3 lines
tools/libxl/libxl_dm.c +3
-0+ +if (b_info->u.hvm.ramdisk) + flexarray_vappend(dm_args, "-initrd", b_info->u.hvm.ramdisk,NULL);
tools/libxl/libxl_dm.c static char ** libxl__build_device_model_args_new(libxl__gc *gc,
Quoted 3 lines
tools/libxl/libxl_dm.c +3
-0+ +if (b_info->u.hvm.cmdline) + flexarray_vappend(dm_args, "-append", b_info->u.hvm.cmdline,NULL);
You could use
flexarray_append_pairhere, but I appreciate you might want to go for consistency with the existing code here. I don't mind either way.tools/libxl/libxl_dm.c static char ** libxl__build_device_model_args_old(libxl__gc *gc,
Quoted 3 lines
tools/libxl/libxl_dm.c +1
-0+if (b_info->u.hvm.serial) { flexarray_vappend(dm_args, "-serial", b_info->u.hvm.serial,NULL);
Quoted 16 lines
tools/libxl/libxl_types.idl libxl_domain_build_info = Struct("domain_build_info",[ · line 341
Quoted 12 lines
tools/libxl/libxl_dm.c +0
-0}tools/libxl/libxl_types.idl +3
-0@@ -336,6 +336,9 @@ libxl_domain_build_info = Struct("domain_build_info",[ ("event_channels", uint32), ("u", KeyedUnion(None, libxl_domain_type, "type", [("hvm", Struct(None, [("firmware", string), + ("kernel", string), + ("cmdline", string), + ("ramdisk", string),You need to add a suitable
LIBXL_HAVE_FOOdefine tolibxl.hto indicate that this new functionality is available, see the comment and existing examples inlibxl.h.
Yeah. Will update.
Quoted 55 lines
A single one to cover all three would be fine.
LIBXL_HAVE_BUILDINFO_HVM_DIRECT_KERNEL_BOOTperhaps?tools/libxl/libxl_types.idl libxl_domain_build_info = Struct("domain_build_info",[ · line 342
Quoted 1 line
tools/libxl/libxl_types.idl +0
-0("bios",
libxl_bios_type),tools/libxl/libxl_types.idl libxl_domain_build_info = Struct("domain_build_info",[ · line 343
Quoted 1 line
tools/libxl/libxl_types.idl +0
-0("pae",
libxl_defbool),tools/libxl/libxl_types.idl libxl_domain_build_info = Struct("domain_build_info",[ · line 344
Quoted 1 line
tools/libxl/libxl_types.idl +0
-0("apic",
libxl_defbool),tools/libxl/xl_cmdimpl.c static void parse_top_level_sdl_options(XLU_Config
Quoted 5 lines
tools/libxl/xl_cmdimpl.c +0
-0@@ -725,6 +725,29 @@ static void parse_top_level_sdl_options(XLU_Config*config,
tools/libxl/xl_cmdimpl.c static void parse_top_level_sdl_options(XLU_Config *config, · line 734
Quoted 10 lines
tools/libxl/xl_cmdimpl.c +7
-0xlu_cfg_replace_string (config,"xauthority" , &sdl->xauthority,0 ); } +static char *parse_cmdline (XLU_Config *config) +{ +char *cmdline =NULL ; +const char *root =NULL , *extra ="" ; + +xlu_cfg_get_string (config,"root" , &root,0 ); +xlu_cfg_get_string (config,"extra" , &extra,0 );I sort of hate this root=/extra= stuff which comes from the PV world, since it is sort of exposing Linux-isms (e.g. root=%s etc).
I'd far rather just have cmdline=. Since for PV this is needed for xm cfg file compatibility we are sort of stuck with it but for this new HVM functionality we don't have those backward compat concerns.
If you want to just do
xlu_cfg_get_string(..., "cmdline", ...)for the HVM case I would be OK with that but if you feel like it would you mind very much going a bit further and implementing cmdline for PV, such that it takes precedence over root/extra? Something like:xlu_cfg_get_string (config, "cmdline", &cmdline, 0); xlu_cfg_get_string (config, "root", &root, 0); xlu_cfg_get_string (config, "extra", &extra, 0); if (cmdline && root) fprintf(stderr, "Warning: ignoring deprecated root= in favour of cmdline=\n"); if (cmdline && extra) fprintf(stderr, "Warning: ignoring deprecated extra= in favour of cmdline=\n"); if (!cmdline) { /* The existing code for dealing with extra/root etc */ ...asprintf(&cmdline, ...) } return cmdline
Quoted 4 lines
? (In doing this I think it would be simpler to allow root=/extra= for HVM guests too even though they are immediately deprecated rather than making all of the above conditional)
I'll take this way and update code, and update manpage as well.
Quoted 13 lines
tools/libxl/xl_cmdimpl.c static void parse_config_data(const char
Quoted 1 line
tools/libxl/xl_cmdimpl.c +0
-0@@ -1007,9 +1030,16 @@ static void parse_config_data(const char
*config_source,tools/libxl/xl_cmdimpl.c static void parse_config_data(const char *config_source,
Quoted 5 lines
tools/libxl/xl_cmdimpl.c +0
-2switch (b_info->type) {case LIBXL_DOMAIN_TYPE_HVM : -if (!xlu_cfg_get_string (config,"kernel" , &buf,0 )) - fprintf(stderr, "WARNING: ignoring \"kernel\" directive for HVMguest. "
tools/libxl/xl_cmdimpl.c static void parse_config_data(const char · line 1011
Quoted 1 line
tools/libxl/xl_cmdimpl.c +0
-1- "Use \"firmware_override\" instead if you really want anon-default firmware\n");
tools/libxl/xl_cmdimpl.c static void parse_config_data(const char *config_source,
Quoted 3 lines
tools/libxl/xl_cmdimpl.c +3
-0+if (!xlu_cfg_get_string (config,"kernel" , &buf,0 )) { +if (strstr (buf,"hvmloader" )) + fprintf(stderr, "WARNING: ignoring \"kernel\" directive
Quoted 7 lines
for HVM guest. "
tools/libxl/xl_cmdimpl.c static void parse_config_data(const char · line 1035
Quoted 1 line
tools/libxl/xl_cmdimpl.c +1
-0+ "Use \"firmware_override\" instead if you reallywant a non-default firmware\n");
I think we've had this for a few releases now, I wonder if it has served its purpose? Especially since the strstr check could have false positives and negatives.
I think it's mainly to handle the old config file format, like:
kernel="/usr/lib/xen/boot/hvmloader"
in fact, in most of our hvm config files, this line still exists.
Quoted 13 lines
IOW perhaps we should just delete this check and handle kernel the natural way. Trouble is I cannot estimate what sort of support burden this will make for us. Perhaps keep the warning but continue on having set u.hvm.kernel? e.g.
fprintf(stderr,
"WARNING: You seem to be using the \"kernel\" directive to
override the firmware (hvmloader) for an HVM guest.\n"
"This option will boot the named kernel directly with no
firmware present.\n"
"Use \"firmware_override\" instread if you really want a
non-default firmware.\n");
?
Guest behavior will change for those using config file including:
kernel="/usr/lib/xen/boot/hvmloader" (as does in xm config file) Till now, this is allowed and guest can be booted normally. Without check and set u.hvm.kernel, guest will fail to boot. I'm afraid this is too risky?
Quoted 10 lines
Ian.
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Re: [Qemu-devel] [Xen-devel] [RFC PATCH V2 1/2] xen: pass kernel initrd to qemu
Quoted 36 lines · Chun Yan Liu
Quoted 36 lines
tools/libxl/xl_cmdimpl.c static void parse_top_level_sdl_options(XLU_Config *config, · line 734
Quoted 7 lines
tools/libxl/xl_cmdimpl.c +7
-0+static char *parse_cmdline (XLU_Config *config) +{ +char *cmdline =NULL ; +const char *root =NULL , *extra ="" ; + +xlu_cfg_get_string (config,"root" , &root,0 ); +xlu_cfg_get_string (config,"extra" , &extra,0 );I sort of hate this root=/extra= stuff which comes from the PV world, since it is sort of exposing Linux-isms (e.g. root=%s etc).
I'd far rather just have cmdline=. Since for PV this is needed for xm cfg file compatibility we are sort of stuck with it but for this new HVM functionality we don't have those backward compat concerns.
If you want to just do
xlu_cfg_get_string(..., "cmdline", ...)for the HVM case I would be OK with that but if you feel like it would you mind very much going a bit further and implementing cmdline for PV, such that it takes precedence over root/extra? Something like:xlu_cfg_get_string (config, "cmdline", &cmdline, 0); xlu_cfg_get_string (config, "root", &root, 0); xlu_cfg_get_string (config, "extra", &extra, 0); if (cmdline && root) fprintf(stderr, "Warning: ignoring deprecated root= in favour of cmdline=\n"); if (cmdline && extra) fprintf(stderr, "Warning: ignoring deprecated extra= in favour of cmdline=\n"); if (!cmdline) { /* The existing code for dealing with extra/root etc */ ...asprintf(&cmdline, ...) } return cmdline
Quoted 5 lines
Quoted 4 lines
? (In doing this I think it would be simpler to allow root=/extra= for HVM guests too even though they are immediately deprecated rather than making all of the above conditional)
I'll take this way and update code, and update manpage as well.
Awesome, thank you!
Quoted 17 lines
Quoted 17 lines
Review static void parse_config_data(const char
Quoted 1 line
(quoted diff) +0
-0@@ -1007,9 +1030,16 @@ static void parse_config_data(const char
*config_source,tools/libxl/xl_cmdimpl.c static void parse_config_data(const char *config_source,
Quoted 5 lines
tools/libxl/xl_cmdimpl.c +0
-2switch (b_info->type) {case LIBXL_DOMAIN_TYPE_HVM : -if (!xlu_cfg_get_string (config,"kernel" , &buf,0 )) - fprintf(stderr, "WARNING: ignoring \"kernel\" directive for HVMguest. "
Review static void parse_config_data(const char · line 1011
Quoted 1 line
(quoted diff) +0
-1- "Use \"firmware_override\" instead if you really want anon-default firmware\n");
tools/libxl/xl_cmdimpl.c static void parse_config_data(const char *config_source,
Quoted 3 lines
tools/libxl/xl_cmdimpl.c +3
-0+if (!xlu_cfg_get_string (config,"kernel" , &buf,0 )) { +if (strstr (buf,"hvmloader" )) + fprintf(stderr, "WARNING: ignoring \"kernel\" directivefor HVM guest. "
Review static void parse_config_data(const char · line 1035
Quoted 1 line
(quoted diff) +1
-0+ "Use \"firmware_override\" instead if you reallywant a non-default firmware\n");
Quoted 7 lines
Quoted 3 lines
I think we've had this for a few releases now, I wonder if it has served its purpose? Especially since the strstr check could have false positives and negatives.
I think it's mainly to handle the old config file format, like:
kernel="/usr/lib/xen/boot/hvmloader"
in fact, in most of our hvm config files, this line still exists.
Hrm. I wonder if we could check for that specific string then? Perhaps also $FOODIR/.../hvmloader (where $FOODIR is whichever bit of that path comes from autoconf)?
Quoted 13 lines
Quoted 4 lines
IOW perhaps we should just delete this check and handle kernel the natural way. Trouble is I cannot estimate what sort of support burden this will make for us. Perhaps keep the warning but continue on having set u.hvm.kernel? e.g.
Quoted 8 lines
fprintf(stderr,
"WARNING: You seem to be using the \"kernel\" directive to
override the firmware (hvmloader) for an HVM guest.\n"
"This option will boot the named kernel directly with no
firmware present.\n"
"Use \"firmware_override\" instread if you really want a
non-default firmware.\n");
?
Quoted 5 lines
Guest behavior will change for those using config file including:
kernel="/usr/lib/xen/boot/hvmloader" (as does in xm config file) Till now, this is allowed and guest can be booted normally. Without check and set u.hvm.kernel, guest will fail to boot. I'm afraid this is too risky?
If you guys still have config files with that in around then yes I think it is a bit risky.
Ian.
Re: [Qemu-devel] [Xen-devel] [RFC PATCH V2 1/2] xen: pass kernel initrd to qemu
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
On 6/13/2014 at 04:28 PM, in message
<[email protected]>, Ian Campbell
Quoted 70 lines · <[email protected]> wrote:
Quoted 36 lines · Chun Yan Liu
Quoted 36 lines
tools/libxl/xl_cmdimpl.c static void parse_top_level_sdl_options(XLU_Config *config, · line 734
Quoted 7 lines
tools/libxl/xl_cmdimpl.c +7
-0+static char *parse_cmdline (XLU_Config *config) +{ +char *cmdline =NULL ; +const char *root =NULL , *extra ="" ; + +xlu_cfg_get_string (config,"root" , &root,0 ); +xlu_cfg_get_string (config,"extra" , &extra,0 );I sort of hate this root=/extra= stuff which comes from the PV world, since it is sort of exposing Linux-isms (e.g. root=%s etc).
I'd far rather just have cmdline=. Since for PV this is needed for xm cfg file compatibility we are sort of stuck with it but for this new HVM functionality we don't have those backward compat concerns.
If you want to just do
xlu_cfg_get_string(..., "cmdline", ...)for the HVM case I would be OK with that but if you feel like it would you mind very much going a bit further and implementing cmdline for PV, such that it takes precedence over root/extra? Something like:xlu_cfg_get_string (config, "cmdline", &cmdline, 0); xlu_cfg_get_string (config, "root", &root, 0); xlu_cfg_get_string (config, "extra", &extra, 0); if (cmdline && root) fprintf(stderr, "Warning: ignoring deprecated root= in favour of cmdline=\n"); if (cmdline && extra) fprintf(stderr, "Warning: ignoring deprecated extra= in favour of cmdline=\n"); if (!cmdline) { /* The existing code for dealing with extra/root etc */ ...asprintf(&cmdline, ...) } return cmdlineQuoted 5 lines
Quoted 4 lines
? (In doing this I think it would be simpler to allow root=/extra= for HVM guests too even though they are immediately deprecated rather than making all of the above conditional)
I'll take this way and update code, and update manpage as well.
Awesome, thank you!
Quoted 7 lines
Quoted 7 lines
Review static void parse_config_data(const char
Quoted 1 line
(quoted diff) +0
-0@@ -1007,9 +1030,16 @@ static void parse_config_data(const char
*config_source,Quoted 5 lines
tools/libxl/xl_cmdimpl.c +0
-2switch (b_info->type) {case LIBXL_DOMAIN_TYPE_HVM : -if (!xlu_cfg_get_string (config,"kernel" , &buf,0 )) - fprintf(stderr, "WARNING: ignoring \"kernel\" directive forHVM
Quoted 2 lines
Quoted 2 lines
guest. "
Quoted 1 line
(quoted diff) +0
-1- "Use \"firmware_override\" instead if you reallywant a
Quoted 14 lines
Quoted 13 lines
non-default firmware\n");
tools/libxl/xl_cmdimpl.c static void parse_config_data(const char *config_source,
Quoted 3 lines
tools/libxl/xl_cmdimpl.c +3
-0+if (!xlu_cfg_get_string (config,"kernel" , &buf,0 )) { +if (strstr (buf,"hvmloader" )) + fprintf(stderr, "WARNING: ignoring \"kernel\" directivefor HVM guest. "
Review static void parse_config_data(const char · line 1035
Quoted 1 line
(quoted diff) +1
-0+ "Use \"firmware_override\" instead if you reallywant a non-default firmware\n");
I think we've had this for a few releases now, I wonder if it has served its purpose? Especially since the strstr check could have false positives and negatives.
Quoted 7 lines
Quoted 3 lines
I think it's mainly to handle the old config file format, like:
kernel="/usr/lib/xen/boot/hvmloader"
in fact, in most of our hvm config files, this line still exists.Hrm. I wonder if we could check for that specific string then? Perhaps also $FOODIR/.../hvmloader (where $FOODIR is whichever bit of that path comes from autoconf)?
Or simply check basename="hvmloader".
Quoted 27 lines
Quoted 14 lines
Quoted 13 lines
IOW perhaps we should just delete this check and handle kernel the natural way. Trouble is I cannot estimate what sort of support burden this will make for us. Perhaps keep the warning but continue on having set u.hvm.kernel? e.g.
fprintf(stderr,
"WARNING: You seem to be using the \"kernel\" directive to
override the firmware (hvmloader) for an HVM guest.\n"
"This option will boot the named kernel directly with no
firmware present.\n"
"Use \"firmware_override\" instread if you really want a
non-default firmware.\n");
?Quoted 5 lines
Guest behavior will change for those using config file including:
kernel="/usr/lib/xen/boot/hvmloader" (as does in xm config file) Till now, this is allowed and guest can be booted normally. Without check and set u.hvm.kernel, guest will fail to boot. I'm afraid this is too risky?If you guys still have config files with that in around then yes I think it is a bit risky.
Ian.
Re: [Qemu-devel] [Xen-devel] [RFC PATCH V2 1/2] xen: pass kernel initrd to qemu
Quoted 29 lines · Chun Yan Liu
Quoted 29 lines
Quoted 7 lines
Quoted 7 lines
Review static void parse_config_data(const char
Quoted 1 line
(quoted diff) +0
-0@@ -1007,9 +1030,16 @@ static void parse_config_data(const char
*config_source,Quoted 5 lines
tools/libxl/xl_cmdimpl.c +0
-2switch (b_info->type) {case LIBXL_DOMAIN_TYPE_HVM : -if (!xlu_cfg_get_string (config,"kernel" , &buf,0 )) - fprintf(stderr, "WARNING: ignoring \"kernel\" directive forHVM
Quoted 2 lines
Quoted 2 lines
guest. "
Quoted 1 line
(quoted diff) +0
-1- "Use \"firmware_override\" instead if you reallywant a
Quoted 17 lines
Quoted 5 lines
non-default firmware\n");
tools/libxl/xl_cmdimpl.c static void parse_config_data(const char *config_source,
Quoted 3 lines
tools/libxl/xl_cmdimpl.c +3
-0+if (!xlu_cfg_get_string (config,"kernel" , &buf,0 )) { +if (strstr (buf,"hvmloader" )) + fprintf(stderr, "WARNING: ignoring \"kernel\" directiveQuoted 8 lines
for HVM guest. "
Review static void parse_config_data(const char · line 1035
Quoted 1 line
(quoted diff) +1
-0+ "Use \"firmware_override\" instead if you reallywant a non-default firmware\n");
I think we've had this for a few releases now, I wonder if it has served its purpose? Especially since the strstr check could have false positives and negatives.
I think it's mainly to handle the old config file format, like:
kernel="/usr/lib/xen/boot/hvmloader"
in fact, in most of our hvm config files, this line still exists.
Quoted 5 lines
Quoted 3 lines
Hrm. I wonder if we could check for that specific string then? Perhaps also $FOODIR/.../hvmloader (where $FOODIR is whichever bit of that path comes from autoconf)?
Or simply check basename="hvmloader".
I think that would work. Rather than writing a basename function it might be sufficient to check that the tail of the string is/isn't "/hvmloader".
Ian.
RFC PATCH v2 2/2 qemu: support xen hvm direct kernel boot
In reply to Chunyan Liuqemu side patch to support xen HVM direct kernel boot:
if -kernel exists, calls xen_load_linux(), which will read kernel/initrd and add a linuxboot.bin or multiboot.bin option rom. The linuxboot.bin/multiboot.bin will load kernel/initrd and jump to execute kernel directly. It's working when xen uses seabios.
---
Changes:
* remove kvmvpaic.bin from xen option_rom by hacking:
+ s->vapic_control = 0;
rather than the way of checking and bypassing it in xen_load_linux().
hw/i386/pc.c | 22 ++++++++++++++++++++++ hw/i386/pc_piix.c | 7 +++++++ hw/i386/xen/xen_apic.c | 1 + include/hw/i386/pc.h | 5 +++++ 4 files changed, 35 insertions(+)
hw/i386/pc.c +22 -0
@@ -1187,6 +1187,28 @@ void pc_acpi_init(const char *default_dsdt) } } +FWCfgState *xen_load_linux (const char *kernel_filename, +const char *kernel_cmdline, +const char *initrd_filename, +ram_addr_t below_4g_mem_size, +PcGuestInfo *guest_info) +{ +int i; +FWCfgState *fw_cfg; + +assert (kernel_filename !=NULL ); + + fw_cfg =fw_cfg_init (BIOS_CFG_IOPORT ,BIOS_CFG_IOPORT +1 ,0 ,0 ); +rom_set_fw (fw_cfg); + +load_linux (fw_cfg, kernel_filename, initrd_filename, kernel_cmdline, below_4g_mem_size); +for (i =0 ; i < nb_option_roms; i++) { +rom_add_option (option_rom[i].name, option_rom[i].bootindex); + } + guest_info->fw_cfg = fw_cfg; +return fw_cfg; +} + FWCfgState *pc_memory_init(MemoryRegion *system_memory, const char *kernel_filename, const char *kernel_cmdline,
hw/i386/pc_piix.c +7 -0
@@ -158,6 +158,13 @@ static void pc_init1(MachineState *machine, machine->initrd_filename, below_4g_mem_size, above_4g_mem_size, rom_memory, &ram_memory, guest_info); + }else if (args->kernel_filename !=NULL ) { +/* For xen HVM direct kernel boot, load linux here */ + fw_cfg =xen_load_linux (args->kernel_filename, + args->kernel_cmdline, + args->initrd_filename, + below_4g_mem_size, + guest_info); } gsi_state =g_malloc0 (sizeof (*gsi_state));
hw/i386/xen/xen_apic.c +1 -0
@@ -40,6 +40,7 @@ static void xen_apic_realize(DeviceState *dev, Error **errp) {APICCommonState *s =APIC_COMMON (dev); + s->vapic_control =0 ;memory_region_init_io (&s->io_memory,OBJECT (s), &xen_apic_io_ops, s,"xen-apic-msi" ,APIC_SPACE_SIZE );
include/hw/i386/pc.h +5 -0
@@ -134,6 +134,11 @@ PcGuestInfo *pc_guest_info_init(ram_addr_t below_4g_mem_size,void pc_pci_as_mapping_init (Object *owner,MemoryRegion *system_memory,MemoryRegion *pci_address_space); +FWCfgState *xen_load_linux (const char *kernel_filename, +const char *kernel_cmdline, +const char *initrd_filename, +ram_addr_t below_4g_mem_size, +PcGuestInfo *guest_info); FWCfgState *pc_memory_init(MemoryRegion *system_memory, const char *kernel_filename, const char *kernel_cmdline,
Signature · 1 line
1.8.4.5
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
On 6/4/2014 at 03:34 PM, in message
<[email protected]>, Chunyan Liu <[email protected]>
Quoted 9 lines · wrote:
After your valuable suggestions, I'll continue the work to support stubdom. But since stubdom currently uses qemu-xen-traditional and will switch to qemu upstream in future, in a period of time, stubdom HVM direct kernel boot won't be in working status. So, before continuing the stubdom support work, I updated existing patch series, adding proper error messages for rombios and stubdom limitation, adding man page descriptions and other trival updates to make it a complete working patch series. For those using seabios and non stubdom, they can use now.
Hi, Stefan, Ian J. & Ian C.,
I don't know if it's proper but could we merge current patch series first and stubdom compatible work continued next? We do have some customers they want to use it in guest installation. And considering: a) current patch series and future stubdom compatible version will keep same user interface. b) stubdom HVM direct kernel boot won't really work until stubdom-dm switches to qemu upstream, maybe not soon? (I didn't see it in xen 4.5 development). c) how many users will actually use stubdom and at the same time using direct kernel boot?
Regards,
Chunyan
Quoted 23 lines
xen side patch: pass
kernel/initrd/appendparameters to qemu-dm qemu side patch: reuseload_linux()for xen hvm direct kernel boot.
Different frompc_memory_initwhich does lots of ram alloc work and rom/bios loading work, for xen, we only need to init a basicfw_cfgdevice used byload_linux()to store ADDRs and linuxboot.bin/multiboot.bin to retrive ADDRs, thenload_linux(), after that, do real add option rom work to add linuxboot.bin/multiboot.bin to system option rom. Other things would be done by seabios smoothly.v1 is here:
http://lists.gnu.org/archive/html/qemu-devel/2014-05/msg06233.htmlChunyan Liu (2):
xen: pass kernel initrd to qemu
qemu: support xen hvm direct kernel boot_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel