libxl: change default QEMU machine to pc-i440fx-1.6
PATCH v2 1/1 libxl: change default QEMU machine to pc-i440fx-1.6
Choose pc-i440fx-1.6 instead of pc for HVM guests, so that we know for sure what is the machine that we are emulating.
Use pc-i440fx-1.6 regardless of the xen_platform_pci option. Add the xen-platform device if requested. Move the machine options earlier, before any emulated devices options so that QEMU will assign slot 2 to the xen-platform device, maintaining compatibility with current installations.
In case of Intel graphic passthrough, slot 2 might be needed by the grafics card. However it is easy to change the position of the xen-platform device on the PCI bus if graphic passthrough is enabled, by passing "addr=desired_slot_number".
Specify PIIX4_PM.acpi-pci-hotplug-with-bridge-support=off, because differently from xenfv, the other QEMU machines do not have that option off by default.
This patch does not change the emulated environment in the guest, unless soundhw='hda' is specified, in that case the xen-platform device is moved to slot 3 (used to be always slot 2). This change might cause problems to guests with soundhw='hda', migrating from 4.4 to 4.5.
---
Changes in v2:
- note the dependency on QEMU >= 1.6.1 in the README;
- move the -machine options even earlier and drop the explicit ",slot=0x2".
README +4 -0
@@ -73,6 +73,10 @@ disabled at compile time: * markdown * figlet (for generating the traditional Xen start of day banner) +As a runtime requirement, you need a QEMU binary newer than v1.6.1, +compiled with Xen support. By default the Xen build system will clone +and build one for you. + Second, you need to acquire a suitable kernel for use in domain 0. If possible you should use a kernel provided by your OS distributor. If no suitable kernel is available from your OS distributor then refer to
tools/libxl/libxl_dm.c +21 -23
56 lines not on this page · raw message
2014-06-12 16:33 GMT+02:00 Stefano Stabellini <
[email protected]>:
Quoted 14 lines
Choose pc-i440fx-1.6 instead of pc for HVM guests, so that we know for sure what is the machine that we are emulating.
Use pc-i440fx-1.6 regardless of the
xen_platform_pcioption. Add the xen-platform device if requested. Move the machine options earlier, before any emulated devices options so that QEMU will assign slot 2 to the xen-platform device, maintaining compatibility with current installations.In case of Intel graphic passthrough, slot 2 might be needed by the grafics card. However it is easy to change the position of the xen-platform device on the PCI bus if graphic passthrough is enabled, by passing "addr=desired_slot_number".
Quoted 9 lines
Specify PIIX4_PM.acpi-pci-hotplug-with-bridge-support=off, because differently from xenfv, the other QEMU machines do not have that option off by default.
This patch does not change the emulated environment in the guest, unless soundhw='hda' is specified, in that case the xen-platform device is moved to slot 3 (used to be always slot 2). This change might cause problems to guests with soundhw='hda', migrating from 4.4 to 4.5.
Without fixed xen-platform slot I think will be ok also in migrate. For test the case it is sufficient save on unstable without the patch and restore with this patch? If yes I'll thest this on my next build test.
Quoted 17 lines
Signed-off-by Stefano Stabellini <[email protected]>---
Changes in v2:
- note the dependency on QEMU >= 1.6.1 in the README;
- move the -machine options even earlier and drop the explicit ",slot=0x2".README +0
-0
README disabled at compile time: · line 77
Quoted 5 lines
README +1
-0@@ -73,6 +73,10 @@ disabled at compile time: * markdown * figlet (for generating the traditional Xen start of day banner) +As a runtime requirement, you need a QEMU binary newer than v1.6.1,
Probably my english is very bad but this seems to me >1.6.1 but should be
Quoted 87 lines
README +3
-0=1.6.1 (for example: at least version 1.6.1 of QEMU binary) +compiled with Xen support. By default the Xen build system will clone +and build one for you. + Second, you need to acquire a suitable kernel for use in domain 0. If possible you should use a kernel provided by your OS distributor. If no suitable kernel is available from your OS distributor then refer totools/libxl/libxl_dm.c +21
-0@@ -403,6 +403,27 @@ static char **libxl__build_device_model_args_new (libxl__gc *gc,"-xen-domid" ,libxl__sprintf (gc,"%d" , guest_domid),NULL ); +switch (b_info->type) { +case LIBXL_DOMAIN_TYPE_PV : +flexarray_append_pair (dm_args,"-machine" ,"xenpv" ); +for (i =0 ; b_info->extra_pv && b_info->extra_pv[i] !=NULL ; i++) +flexarray_append (dm_args, b_info->extra_pv[i]); +break ; +case LIBXL_DOMAIN_TYPE_HVM : +flexarray_append_pair (dm_args,"-machine" ,"pc-i440fx-1.6,accel=xen" ); +flexarray_append_pair (dm_args,"-global" , +"PIIX4_PM.acpi-pci-hotplug-with-bridge-support=off" ); +if (libxl_defbool_val (b_info->u.hvm.xen_platform_pci)) { +flexarray_append (dm_args,"-device" ); +flexarray_append (dm_args,"xen-platform" ); + } +for (i =0 ; b_info->extra_hvm && b_info->extra_hvm[i] !=NULL ; i++) +flexarray_append (dm_args, b_info->extra_hvm[i]); +break ; +default : +abort (); + } +flexarray_append(dm_args, "-chardev"); flexarray_append(dm_args, libxl__sprintf(gc, "socket,id=libxl-cmd,"tools/libxl/libxl_dm.c +0
-11@@ -646,29 +667,6 @@ static char **libxl__build_device_model_args_new (libxl__gc *gc, for (i = 0; b_info->extra && b_info->extra[i] != NULL; i++) flexarray_append(dm_args, b_info->extra[i]); - flexarray_append(dm_args, "-machine"); -switch (b_info->type) { -case LIBXL_DOMAIN_TYPE_PV : -flexarray_append (dm_args,"xenpv" ); -for (i =0 ; b_info->extra_pv && b_info->extra_pv[i] !=NULL ; i++) -flexarray_append (dm_args, b_info->extra_pv[i]); -break ; -case LIBXL_DOMAIN_TYPE_HVM : -if (!libxl_defbool_val (b_info->u.hvm.xen_platform_pci)) { -/* Switching here to the machine "pc" which does not add -* the xen-platform device instead of the default "xenfv" machine.
tools/libxl/libxl_dm.c +0
-6-*/ -flexarray_append (dm_args,"pc,accel=xen" ); - }else { -flexarray_append (dm_args,"xenfv" ); - } - for (i = 0; b_info->extra_hvm && b_info->extra_hvm[i] != NULL;i++)
tools/libxl/libxl_dm.c +0
-6-flexarray_append (dm_args, b_info->extra_hvm[i]); -break ; -default : -abort (); - } - ram_size = libxl__sizekb_to_mb(b_info->max_memkb -b_info->video_memkb); flexarray_append(dm_args, "-m"); flexarray_append(dm_args, libxl__sprintf(gc, "%"PRId64, ram_size));_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
ping?
Quoted 112 lines · Stefano Stabellini
Choose pc-i440fx-1.6 instead of pc for HVM guests, so that we know for sure what is the machine that we are emulating.
Use pc-i440fx-1.6 regardless of the
xen_platform_pcioption. Add the xen-platform device if requested. Move the machine options earlier, before any emulated devices options so that QEMU will assign slot 2 to the xen-platform device, maintaining compatibility with current installations.In case of Intel graphic passthrough, slot 2 might be needed by the grafics card. However it is easy to change the position of the xen-platform device on the PCI bus if graphic passthrough is enabled, by passing "addr=desired_slot_number".
Specify PIIX4_PM.acpi-pci-hotplug-with-bridge-support=off, because differently from xenfv, the other QEMU machines do not have that option off by default.
This patch does not change the emulated environment in the guest, unless soundhw='hda' is specified, in that case the xen-platform device is moved to slot 3 (used to be always slot 2). This change might cause problems to guests with soundhw='hda', migrating from 4.4 to 4.5.
Signed-off-by Stefano Stabellini <[email protected]>---
Changes in v2:
- note the dependency on QEMU >= 1.6.1 in the README;
- move the -machine options even earlier and drop the explicit ",slot=0x2".README +4
-0@@ -73,6 +73,10 @@ disabled at compile time: * markdown * figlet (for generating the traditional Xen start of day banner) +As a runtime requirement, you need a QEMU binary newer than v1.6.1, +compiled with Xen support. By default the Xen build system will clone +and build one for you. + Second, you need to acquire a suitable kernel for use in domain 0. If possible you should use a kernel provided by your OS distributor. If no suitable kernel is available from your OS distributor then refer totools/libxl/libxl_dm.c +21
-23@@ -403,6 +403,27 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,"-xen-domid" , libxl__sprintf(gc, "%d", guest_domid), NULL); +switch (b_info->type) { +case LIBXL_DOMAIN_TYPE_PV : +flexarray_append_pair (dm_args,"-machine" ,"xenpv" ); +for (i =0 ; b_info->extra_pv && b_info->extra_pv[i] !=NULL ; i++) +flexarray_append (dm_args, b_info->extra_pv[i]); +break ; +case LIBXL_DOMAIN_TYPE_HVM : +flexarray_append_pair (dm_args,"-machine" ,"pc-i440fx-1.6,accel=xen" ); +flexarray_append_pair (dm_args,"-global" , +"PIIX4_PM.acpi-pci-hotplug-with-bridge-support=off" ); +if (libxl_defbool_val (b_info->u.hvm.xen_platform_pci)) { +flexarray_append (dm_args,"-device" ); +flexarray_append (dm_args,"xen-platform" ); + } +for (i =0 ; b_info->extra_hvm && b_info->extra_hvm[i] !=NULL ; i++) +flexarray_append (dm_args, b_info->extra_hvm[i]); +break ; +default : +abort (); + } +flexarray_append (dm_args,"-chardev" ); flexarray_append(dm_args, libxl__sprintf(gc, "socket,id=libxl-cmd,"@@ -646,29 +667,6 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,for (i =0 ; b_info->extra && b_info->extra[i] !=NULL ; i++)flexarray_append (dm_args, b_info->extra[i]); -flexarray_append (dm_args,"-machine" ); -switch (b_info->type) { -case LIBXL_DOMAIN_TYPE_PV : -flexarray_append (dm_args,"xenpv" ); -for (i =0 ; b_info->extra_pv && b_info->extra_pv[i] !=NULL ; i++) -flexarray_append (dm_args, b_info->extra_pv[i]); -break ; -case LIBXL_DOMAIN_TYPE_HVM : -if (!libxl_defbool_val (b_info->u.hvm.xen_platform_pci)) { -/* Switching here to the machine "pc" which does not add -* the xen-platform device instead of the default "xenfv" machine. -*/ -flexarray_append (dm_args,"pc,accel=xen" ); - }else { -flexarray_append (dm_args,"xenfv" ); - } -for (i =0 ; b_info->extra_hvm && b_info->extra_hvm[i] !=NULL ; i++) -flexarray_append (dm_args, b_info->extra_hvm[i]); -break ; -default : -abort (); - } - ram_size =libxl__sizekb_to_mb (b_info->max_memkb - b_info->video_memkb);flexarray_append (dm_args,"-m" );flexarray_append (dm_args,libxl__sprintf (gc,"%" PRId64, ram_size));
Stefano Stabellini writes ("Re: [PATCH v2] libxl: change default QEMU machine to pc-i440fx-1.6"):
Quoted 3 lines
ping?
On Thu, 12 Jun 2014, Stefano Stabellini wrote:
...
Quoted 4 lines
Quoted 4 lines
This patch does not change the emulated environment in the guest, unless soundhw='hda' is specified, in that case the xen-platform device is moved to slot 3 (used to be always slot 2). This change might cause problems to guests with soundhw='hda', migrating from 4.4 to 4.5.
Is there a way for someone who experiences this problem to make it go back to the way it was ?
Ian.
Quoted 4 lines · Ian Jackson
Stefano Stabellini writes ("Re: [PATCH v2] libxl: change default QEMU machine to pc-i440fx-1.6"):
Quoted 3 lines
ping?
On Thu, 12 Jun 2014, Stefano Stabellini wrote:
Quoted 8 lines
...
Quoted 4 lines
Quoted 4 lines
This patch does not change the emulated environment in the guest, unless soundhw='hda' is specified, in that case the xen-platform device is moved to slot 3 (used to be always slot 2). This change might cause problems to guests with soundhw='hda', migrating from 4.4 to 4.5.
Is there a way for someone who experiences this problem to make it go back to the way it was ?
A guest reboot would solve the problem.
Quoted 11 lines · Stefano Stabellini
Quoted 10 lines · Ian Jackson
Stefano Stabellini writes ("Re: [PATCH v2] libxl: change default QEMU machine to pc-i440fx-1.6"):
Quoted 3 lines
ping?
On Thu, 12 Jun 2014, Stefano Stabellini wrote:
...
Quoted 4 lines
Quoted 4 lines
This patch does not change the emulated environment in the guest, unless soundhw='hda' is specified, in that case the xen-platform device is moved to slot 3 (used to be always slot 2). This change might cause problems to guests with soundhw='hda', migrating from 4.4 to 4.5.
Quoted 4 lines
Quoted 2 lines
Is there a way for someone who experiences this problem to make it go back to the way it was ?
A guest reboot would solve the problem.
That rather defeats the purpose of being able to migrate from N to N+1.
What is the issue with hda which requires us to move slots around if it is enabled where we didn't need to do so before?
Ian.
Quoted 15 lines · Ian Campbell
Quoted 14 lines · Stefano Stabellini
Quoted 12 lines · Ian Jackson
Stefano Stabellini writes ("Re: [PATCH v2] libxl: change default QEMU machine to pc-i440fx-1.6"):
Quoted 3 lines
ping?
On Thu, 12 Jun 2014, Stefano Stabellini wrote:
...
Quoted 4 lines
Quoted 4 lines
This patch does not change the emulated environment in the guest, unless soundhw='hda' is specified, in that case the xen-platform device is moved to slot 3 (used to be always slot 2). This change might cause problems to guests with soundhw='hda', migrating from 4.4 to 4.5.
Is there a way for someone who experiences this problem to make it go back to the way it was ?
Quoted 6 lines
Quoted 1 line
A guest reboot would solve the problem.
That rather defeats the purpose of being able to migrate from N to N+1.
What is the issue with hda which requires us to move slots around if it is enabled where we didn't need to do so before?
If we use -M pc or -M pc-i440fx-1.6, the xen-platform-pci device is created slightly later in the QEMU boot sequence. The Intel HDA device is able to "steal" its slot on the PCI bus.
On the other hand it is worth pointing out that currently libxl switches from -M xenfv to -M pc silently depending on whether the xen_platform_pci option is enabled or disabled. If it is disabled we get pc, that is a moving target and not guaranteed to be compatible with anything.
Quoted 27 lines · Stefano Stabellini
Quoted 15 lines · Ian Campbell
Quoted 14 lines · Stefano Stabellini
Quoted 12 lines · Ian Jackson
Stefano Stabellini writes ("Re: [PATCH v2] libxl: change default QEMU machine to pc-i440fx-1.6"):
Quoted 3 lines
ping?
On Thu, 12 Jun 2014, Stefano Stabellini wrote:
...
Quoted 4 lines
Quoted 4 lines
This patch does not change the emulated environment in the guest, unless soundhw='hda' is specified, in that case the xen-platform device is moved to slot 3 (used to be always slot 2). This change might cause problems to guests with soundhw='hda', migrating from 4.4 to 4.5.
Is there a way for someone who experiences this problem to make it go back to the way it was ?
Quoted 6 lines
Quoted 1 line
A guest reboot would solve the problem.
That rather defeats the purpose of being able to migrate from N to N+1.
What is the issue with hda which requires us to move slots around if it is enabled where we didn't need to do so before?
If we use -M pc or -M pc-i440fx-1.6, the xen-platform-pci device is created slightly later in the QEMU boot sequence. The Intel HDA device is able to "steal" its slot on the PCI bus.
Quoted 5 lines
On the other hand it is worth pointing out that currently libxl switches from -M xenfv to -M pc silently depending on whether the
xen_platform_pcioption is enabled or disabled. If it is disabled we get pc, that is a moving target and not guaranteed to be compatible with anything.
Changing that option is a guest reboot scenario, which is completely different to a migration. I think it is (just about) OK for the PCI id to change on a reboot, but it certainly isn't OK on migrate.
If you can't get the platform device created earlier then perhaps you can find a way to influence the slot used by the hda device?
Ian.
Quoted 15 lines · Ian Campbell
Quoted 9 lines · Stefano Stabellini
Quoted 4 lines · Ian Campbell
Quoted 2 lines · Stefano Stabellini
Quoted 1 line · Ian Jackson
Stefano Stabellini writes ("Re: [PATCH v2] libxl: change default QEMU machine to pc-i440fx-1.6"):
If we use -M pc or -M pc-i440fx-1.6, the xen-platform-pci device is created slightly later in the QEMU boot sequence. The Intel HDA device is able to "steal" its slot on the PCI bus.
Quoted 5 lines
On the other hand it is worth pointing out that currently libxl switches from -M xenfv to -M pc silently depending on whether the
xen_platform_pcioption is enabled or disabled. If it is disabled we get pc, that is a moving target and not guaranteed to be compatible with anything.
Quoted 8 lines
Changing that option is a guest reboot scenario, which is completely different to a migration. I think it is (just about) OK for the PCI id to change on a reboot, but it certainly isn't OK on migrate.
If you can't get the platform device created earlier then perhaps you can find a way to influence the slot used by the hda device?
Ian.
I see 2 options:
1) change only the -M pc to -M pc-i440fx-1.6 (I.E. continue to use xenfv)
2) Add ",addr=0x1.0x0" to the xen platform device. (Which will cause QEMU to abort in this case.) Also fix soundhw handling to stop using "-soundhw", and switch to "--device intel-hda,addr=0x12.0x0 -device hda-duplex" etc.
As a side note on #1, I do have a hack to allow adjusting the placement of the xen platform device (adding a new xl.cfg option for it), but is not ready to be a patch. It would allow still using "-soundhw" "hda" but would require a config change.
-Don Slutz
Quoted 5 lines
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel