=back
+=head3 Emulated disk controller type
+
+=over 4
+
+=item B<hdtype="STRING">
+
+Select the hd disk type (ide|ahci).
+If hdtype=ahci adds ich9 disk controller in AHCI mode and uses it with
+upstream qemu to emulate disks instead of IDE. It decreases boot time
+but may not be supported by default in Windows xp and older Windows.
+The default is ide.
+
+=back
+
=head3 Paging
The following options control the mechanisms used to virtualise guest
A Xen guest can be provided with block devices. These are always
provided as Xen VBDs; for HVM guests they may also be provided as
-emulated IDE or SCSI disks.
+emulated IDE, AHCI or SCSI disks.
The abstract interface involves specifying, for each block device:
* Nominal disk type: Xen virtual disk (aka xvd*, the default); SCSI
- (sd*); IDE (hd*).
+ (sd*); IDE or AHCI (hd*).
For HVM guests, each whole-disk hd* and and sd* device is made
available _both_ via emulated IDE resp. SCSI controller, _and_ as a
Xen VBD. The HVM guest is entitled to assume that the IDE or SCSI
disks available via the emulated IDE controller target the same
underlying devices as the corresponding Xen VBD (ie, multipath).
+ In hd* case with hdtype=ahci, disk will be AHCI via emulated
+ ich9 disk controller.
For PV guests every device is made available to the guest only as a
Xen VBD. For these domains the type is advisory, for use by the
*/
#define LIBXL_HAVE_SPICE_STREAMINGVIDEO 1
+/*
+ * LIBXL_HAVE_HVM_HDTYPE
+ *
+ * If defined, then the u.hvm structure will contain a enum type
+ * hdtype.
+ */
+#define LIBXL_HAVE_HVM_HDTYPE 1
+
/*
* LIBXL_HAVE_DOMAIN_CREATE_RESTORE_PARAMS 1
*
if (!b_info->u.hvm.vga.kind)
b_info->u.hvm.vga.kind = LIBXL_VGA_INTERFACE_TYPE_CIRRUS;
+ if (!b_info->u.hvm.hdtype)
+ b_info->u.hvm.hdtype = LIBXL_HDTYPE_IDE;
+
switch (b_info->device_model_version) {
case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL:
switch (b_info->u.hvm.vga.kind) {
flexarray_append(dm_args, libxl__sprintf(gc, "%"PRId64, ram_size));
if (b_info->type == LIBXL_DOMAIN_TYPE_HVM) {
+ if (b_info->u.hvm.hdtype == LIBXL_HDTYPE_AHCI)
+ flexarray_append_pair(dm_args, "-device", "ahci,id=ahci0");
for (i = 0; i < num_disks; i++) {
int disk, part;
int dev_number =
drive = libxl__sprintf
(gc, "file=%s,if=scsi,bus=0,unit=%d,format=%s,cache=writeback",
pdev_path, disk, format);
- else if (disk < 4)
+ else if (disk < 6 && b_info->u.hvm.hdtype == LIBXL_HDTYPE_AHCI) {
+ flexarray_vappend(dm_args, "-drive",
+ GCSPRINTF("file=%s,if=none,id=ahcidisk-%d,format=%s,cache=writeback",
+ pdev_path, disk, format),
+ "-device", GCSPRINTF("ide-hd,bus=ahci0.%d,unit=0,drive=ahcidisk-%d",
+ disk, disk), NULL);
+ continue;
+ } else if (disk < 4)
drive = libxl__sprintf
(gc, "file=%s,if=ide,index=%d,media=disk,format=%s,cache=writeback",
pdev_path, disk, format);
(3, "reference_tsc"),
])
+libxl_hdtype = Enumeration("hdtype", [
+ (1, "IDE"),
+ (2, "AHCI"),
+ ], init_val = "LIBXL_HDTYPE_IDE")
+
#
# Complex libxl types
#
("nested_hvm", libxl_defbool),
("smbios_firmware", string),
("acpi_firmware", string),
+ ("hdtype", libxl_hdtype),
("nographic", libxl_defbool),
("vga", libxl_vga_interface_info),
("vnc", libxl_vnc_info),
b_info->u.hvm.vga.kind = l ? LIBXL_VGA_INTERFACE_TYPE_STD :
LIBXL_VGA_INTERFACE_TYPE_CIRRUS;
+ if (!xlu_cfg_get_string(config, "hdtype", &buf, 0) &&
+ libxl_hdtype_from_string(buf, &b_info->u.hvm.hdtype)) {
+ fprintf(stderr, "ERROR: invalid value \"%s\" for \"hdtype\"\n",
+ buf);
+ exit (1);
+ }
+
xlu_cfg_replace_string (config, "keymap", &b_info->u.hvm.keymap, 0);
xlu_cfg_get_defbool (config, "spice", &b_info->u.hvm.spice.enable, 0);
if (!xlu_cfg_get_long (config, "spiceport", &l, 0))