From: Oleksandr Grytsov
Add parsing and adding to xen store following extended parameters:
* feature-disable-keyboard
* feature-disable-pointer
* feature-abs-pointer
* feature-multi-touch
* feature-raw-pointer
* width
* height
* multi-touch-width
* multi-touch-height
* multi-touch-num-contacts
Signed-off-by: Oleksandr Grytsov
---
docs/man/xl.cfg.pod.5.in| 40 +++
tools/libxl/libxl_types.idl | 12 +++-
tools/libxl/libxl_vkb.c | 133 +++-
tools/xl/xl_parse.c | 35 +-
tools/xl/xl_vkb.c | 14
5 files changed, 231 insertions(+), 3 deletions(-)
diff --git a/docs/man/xl.cfg.pod.5.in b/docs/man/xl.cfg.pod.5.in
index d9d321d027..93602680a2 100644
--- a/docs/man/xl.cfg.pod.5.in
+++ b/docs/man/xl.cfg.pod.5.in
@@ -1436,6 +1436,46 @@ Specifies the backend domain name or id.
Specifies the backend type: qemu - for QEMU backend or linux - for Linux PV
domain.
+=item B
+
+Indicates if keyboard device is disabled.
+
+=item B
+
+Indicates if pointer device is disabled.
+
+=item B
+
+Indicates if pointer device can return absolute coordinates.
+
+=item B
+
+Indicates if pointer device can return raw (unscaled) absolute coordinates.
+
+=item B
+
+Indicates if input device supports multi touch.
+
+=item B
+
+Set maximum width for multi touch device.
+
+=item B
+
+Set maximum height for multi touch device.
+
+=item B
+
+Set maximum contacts number for multi touch device.
+
+=item B
+
+Set maximum width for pointer device.
+
+=item B
+
+Set maximum height for pointer device.
+
=back
=back
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index b7fa42fba0..6fb11d51e7 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -633,7 +633,17 @@ libxl_device_vkb = Struct("device_vkb", [
("backend_domname", string),
("devid", libxl_devid),
("backend_type", libxl_vkb_backend),
-("unique_id", string)
+("unique_id", string),
+("feature_disable_keyboard", bool),
+("feature_disable_pointer", bool),
+("feature_abs_pointer", bool),
+("feature_raw_pointer", bool),
+("feature_multi_touch", bool),
+("width", uint32),
+("height", uint32),
+("multi_touch_width", uint32),
+("multi_touch_height", uint32),
+("multi_touch_num_contacts", uint32)
])
libxl_device_disk = Struct("device_disk", [
diff --git a/tools/libxl/libxl_vkb.c b/tools/libxl/libxl_vkb.c
index d2ffc74c0d..c71bb13a31 100644
--- a/tools/libxl/libxl_vkb.c
+++ b/tools/libxl/libxl_vkb.c
@@ -47,6 +47,47 @@ static int libxl__set_xenstore_vkb(libxl__gc *gc, uint32_t
domid,
flexarray_append_pair(back, XENKBD_FIELD_UNIQUE_ID, vkb->unique_id);
}
+if (vkb->feature_disable_keyboard) {
+flexarray_append_pair(back, XENKBD_FIELD_FEAT_DSBL_KEYBRD,
+ GCSPRINTF("%u", vkb->feature_disable_keyboard));
+}
+
+if (vkb->feature_disable_pointer) {
+flexarray_append_pair(back, XENKBD_FIELD_FEAT_DSBL_POINTER,
+ GCSPRINTF("%u", vkb->feature_disable_pointer));
+}
+
+if (vkb->feature_abs_pointer) {
+flexarray_append_pair(back, XENKBD_FIELD_FEAT_ABS_POINTER,
+ GCSPRINTF("%u", vkb->feature_abs_pointer));
+}
+
+if (vkb->feature_raw_pointer) {
+flexarray_append_pair(back, XENKBD_FIELD_FEAT_RAW_POINTER,
+ GCSPRINTF("%u", vkb->feature_raw_pointer));
+}
+
+if (vkb->feature_multi_touch) {
+flexarray_append_pair(back, XENKBD_FIELD_FEAT_MTOUCH,
+ GCSPRINTF("%u", vkb->feature_multi_touch));
+flexarray_append_pair(back, XENKBD_FIELD_MT_WIDTH,
+ GCSPRINTF("%u", vkb->multi_touch_width));
+flexarray_append_pair(back, XENKBD_FIELD_MT_HEIGHT,
+ GCSPRINTF("%u", vkb->multi_touch_height));
+flexarray_append_pair(back, XENKBD_FIELD_MT_NUM_CONTACTS,
+ GCSPRINTF("%u", vkb->multi_touch_num_contacts));
+}
+
+if (vkb->width) {
+flexarray_append_pair(back, XENKBD_FIELD_WIDTH,
+ GCSPRINTF("%u", vkb->width));
+}
+
+if (vkb->height) {
+flexarray_append_pair(back, XENKBD_FIELD_HEIGHT,
+ GCSPRINTF("%u", vkb->height));
+}
+
return 0;
}
@@ -54,7 +95,7 @@ static int libxl__vkb_from_xenstore(libxl__gc *gc, const char
*libxl_path,
libxl_devid devid,
libxl_device_vkb *vkb)
{
-const char *be_path, *be_type, *fe_path;
+const char *be_path, *be_type, *fe_path, *tmp;
int rc;
vkb->devid = devid;
@@ -82,6 +123,96 @@ static int libxl__vkb_from_xenstore(libxl__gc *gc, const
char *libxl_path,
vkb->unique_id = xs_read(CTX->xsh, XBT_NULL,
GCSPRINTF("%s/"XENKBD_FIELD_UNIQUE_ID, be_path), NULL);
+rc = libxl__xs