@@ -668,6 +668,19 @@ file.
=back
+=item B<xend_suspend_evtchn_compat=BOOLEAN>
+
+If this option is B<true> the xenstore path for the domain's suspend
+event channel will not be created. Instead the old xend behaviour of
+making the whole xenstore B<device> sub-tree writable by the domain will
+be re-instated.
+
+The existence of the suspend event channel path can cause problems with
+certain PV drivers running in the guest (e.g. old Red Hat PV drivers for
+Windows).
+
+If this option is not specified then it will default to B<false>.
+
=back
=head2 Devices
@@ -176,10 +176,12 @@ The size of the video RAM this domain is configured with.
#### ~/device/suspend/event-channel = ""|EVTCHN [w]
-The domain's suspend event channel. The toolstack will create this
-path with an empty value which the guest may choose to overwrite.
+The domain's suspend event channel. The toolstack may create this
+path with an empty value which the guest may choose to overwrite. If
+the path does not exist then the ~/device path will be writable by the
+guest and hence it may create the suspend event channel path.
-If the guest overwrites this, it will be with the number of an unbound
+If the guest writes this, it will be with the number of an unbound
event channel port it has acquired. The toolstack is expected to use
an interdomain bind, and then, when it wishes to ask the guest to
suspend, to signal the event channel.
@@ -267,7 +269,9 @@ circumstances where the generation ID needs to be changed.
Paravirtual device frontends are generally specified by their own
directory within the XenStore hierarchy. Usually this is under
~/device/$TYPE/$DEVID although there are exceptions, e.g. ~/console
-for the first PV console.
+for the first PV console. The top level ~/device path itself is normally
+read-only to the guest. However it may writable if the
+'xend_suspend_evtchn_compat' guest configuration option is enabled.
#### ~/device/vbd/$DEVID/* []
@@ -1272,10 +1272,19 @@ void libxl_mac_copy(libxl_ctx *ctx, libxl_mac *dst, const libxl_mac *src);
* LIBXL_HAVE_CREATEINFO_DOMID
*
* libxl_domain_create_new() and libxl_domain_create_restore() will use
- * a domid specified in libxl_domain_create_info().
+ * a domid specified in libxl_domain_create_info.
*/
#define LIBXL_HAVE_CREATEINFO_DOMID
+/*
+ * LIBXL_HAVE_CREATEINFO_XEND_SUSPEND_EVTCHN_COMPAT
+ *
+ * libxl_domain_create_info contains a boolean 'xend_suspend_evtchn_compat'
+ * value to control creation of the xenstore path for a domain's suspend
+ * event channel.
+ */
+#define LIBXL_HAVE_CREATEINFO_XEND_SUSPEND_EVTCHN_COMPAT
+
typedef char **libxl_string_list;
void libxl_string_list_dispose(libxl_string_list *sl);
int libxl_string_list_length(const libxl_string_list *sl);
@@ -57,6 +57,8 @@ int libxl__domain_create_info_setdefault(libxl__gc *gc,
if (!c_info->ssidref)
c_info->ssidref = SECINITSID_DOMU;
+ libxl_defbool_setdefault(&c_info->xend_suspend_evtchn_compat, false);
+
return 0;
}
@@ -748,9 +750,21 @@ retry_transaction:
libxl__xs_mknod(gc, t,
GCSPRINTF("%s/memory", dom_path),
roperm, ARRAY_SIZE(roperm));
- libxl__xs_mknod(gc, t,
- GCSPRINTF("%s/device", dom_path),
- roperm, ARRAY_SIZE(roperm));
+
+ if (!libxl_defbool_val(info->xend_suspend_evtchn_compat)) {
+ libxl__xs_mknod(gc, t,
+ GCSPRINTF("%s/device", dom_path),
+ roperm, ARRAY_SIZE(roperm));
+ libxl__xs_mknod(gc, t,
+ GCSPRINTF("%s/device/suspend/event-channel",
+ dom_path),
+ rwperm, ARRAY_SIZE(rwperm));
+ } else {
+ libxl__xs_mknod(gc, t,
+ GCSPRINTF("%s/device", dom_path),
+ rwperm, ARRAY_SIZE(rwperm));
+ }
+
libxl__xs_mknod(gc, t,
GCSPRINTF("%s/control", dom_path),
roperm, ARRAY_SIZE(roperm));
@@ -782,9 +796,7 @@ retry_transaction:
libxl__xs_mknod(gc, t,
GCSPRINTF("%s/control/sysrq", dom_path),
rwperm, ARRAY_SIZE(rwperm));
- libxl__xs_mknod(gc, t,
- GCSPRINTF("%s/device/suspend/event-channel", dom_path),
- rwperm, ARRAY_SIZE(rwperm));
+
libxl__xs_mknod(gc, t,
GCSPRINTF("%s/data", dom_path),
rwperm, ARRAY_SIZE(rwperm));
@@ -418,6 +418,7 @@ libxl_domain_create_info = Struct("domain_create_info",[
("run_hotplug_scripts",libxl_defbool),
("driver_domain",libxl_defbool),
("passthrough", libxl_passthrough),
+ ("xend_suspend_evtchn_compat",libxl_defbool),
], dir=DIR_IN)
libxl_domain_restore_params = Struct("domain_restore_params", [
@@ -2725,6 +2725,9 @@ skip_usbdev:
parse_vkb_list(config, d_config);
+ xlu_cfg_get_defbool(config, "xend_suspend_evtchn_compat",
+ &c_info->xend_suspend_evtchn_compat, 0);
+
xlu_cfg_destroy(config);
}