[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v2] libxl: change default QEMU machine to pc-i440fx-1.6



2014-06-12 16:33 GMT+02:00 Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>:
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.

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.
Â

Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>


---

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".


diff --git a/README b/README
index 9bbe734..cb66893 100644
--- a/README
+++ b/README
@@ -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 >=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 to
diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index 51ab2bf..b5a0beb 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -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));

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.