Specifies the backend type: qemu - for QEMU backend or linux - for Linux PV
domain.
+=item B<feature-disable-keyboard=BOOLEAN>
+
+Indicates if keyboard device is disabled.
+
+=item B<feature-disable-pointer=BOOLEAN>
+
+Indicates if pointer device is disabled.
+
+=item B<feature-abs-pointer=BOOLEAN>
+
+Indicates if pointer device can return absolute coordinates.
+
+=item B<feature-raw-pointer=BOOLEAN>
+
+Indicates if pointer device can return raw (unscaled) absolute coordinates.
+
+=item B<feature-multi-touch=BOOLEAN>
+
+Indicates if input device supports multi touch.
+
+=item B<multi-touch-width=MULTI_TOUCH_WIDTH>
+
+Set maximum width for multi touch device.
+
+=item B<multi-touch-height=MULTI_TOUCH_HEIGHT>
+
+Set maximum height for multi touch device.
+
+=item B<multi-touch-num-contacts=MULTI_TOUCH_NUM_CONTACTS>
+
+Set maximum contacts number for multi touch device.
+
+=item B<width=WIDTH>
+
+Set maximum width for pointer device.
+
+=item B<height=HEIGHT>
+
+Set maximum height for pointer device.
+
=back
=back
("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", [
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;
}
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;
vkb->unique_id = xs_read(CTX->xsh, XBT_NULL, GCSPRINTF("%s/"XENKBD_FIELD_UNIQUE_ID, be_path), NULL);
+ rc = libxl__xs_read_checked(gc, XBT_NULL,
+ GCSPRINTF("%s/"XENKBD_FIELD_FEAT_DSBL_KEYBRD,
+ be_path), &tmp);
+ if (rc) goto out;
+
+ if (tmp) {
+ vkb->feature_disable_keyboard = strtoul(tmp, NULL, 0);
+ }
+
+ rc = libxl__xs_read_checked(gc, XBT_NULL,
+ GCSPRINTF("%s/"XENKBD_FIELD_FEAT_DSBL_POINTER,
+ be_path), &tmp);
+ if (rc) goto out;
+
+ if (tmp) {
+ vkb->feature_disable_pointer = strtoul(tmp, NULL, 0);
+ }
+
+ rc = libxl__xs_read_checked(gc, XBT_NULL,
+ GCSPRINTF("%s/"XENKBD_FIELD_FEAT_ABS_POINTER,
+ be_path), &tmp);
+ if (rc) goto out;
+
+ if (tmp) {
+ vkb->feature_abs_pointer = strtoul(tmp, NULL, 0);
+ }
+
+ rc = libxl__xs_read_checked(gc, XBT_NULL,
+ GCSPRINTF("%s/"XENKBD_FIELD_FEAT_RAW_POINTER,
+ be_path), &tmp);
+ if (rc) goto out;
+
+ if (tmp) {
+ vkb->feature_raw_pointer = strtoul(tmp, NULL, 0);
+ }
+
+ rc = libxl__xs_read_checked(gc, XBT_NULL,
+ GCSPRINTF("%s/"XENKBD_FIELD_FEAT_MTOUCH,
+ be_path), &tmp);
+ if (rc) goto out;
+
+ if (tmp) {
+ vkb->feature_multi_touch = strtoul(tmp, NULL, 0);
+ }
+
+ rc = libxl__xs_read_checked(gc, XBT_NULL,
+ GCSPRINTF("%s/"XENKBD_FIELD_MT_WIDTH,
+ be_path), &tmp);
+ if (rc) goto out;
+
+ if (tmp) {
+ vkb->multi_touch_width = strtoul(tmp, NULL, 0);
+ }
+
+ rc = libxl__xs_read_checked(gc, XBT_NULL,
+ GCSPRINTF("%s/"XENKBD_FIELD_MT_HEIGHT,
+ be_path), &tmp);
+ if (rc) goto out;
+
+ if (tmp) {
+ vkb->multi_touch_height = strtoul(tmp, NULL, 0);
+ }
+
+ rc = libxl__xs_read_checked(gc, XBT_NULL,
+ GCSPRINTF("%s/"XENKBD_FIELD_MT_NUM_CONTACTS,
+ be_path), &tmp);
+ if (rc) goto out;
+
+ if (tmp) {
+ vkb->multi_touch_num_contacts = strtoul(tmp, NULL, 0);
+ }
+
+ rc = libxl__xs_read_checked(gc, XBT_NULL,
+ GCSPRINTF("%s/"XENKBD_FIELD_WIDTH,
+ be_path), &tmp);
+ if (rc) goto out;
+
+ if (tmp) {
+ vkb->width = strtoul(tmp, NULL, 0);
+ }
+
+ rc = libxl__xs_read_checked(gc, XBT_NULL,
+ GCSPRINTF("%s/"XENKBD_FIELD_HEIGHT,
+ be_path), &tmp);
+ if (rc) goto out;
+
+ if (tmp) {
+ vkb->height = strtoul(tmp, NULL, 0);
+ }
+
rc = 0;
out:
vkb->backend_type = backend_type;
} else if (MATCH_OPTION(XENKBD_FIELD_UNIQUE_ID, token, oparg)) {
vkb->unique_id = strdup(oparg);
+ } else if (MATCH_OPTION(XENKBD_FIELD_FEAT_DSBL_KEYBRD, token, oparg)) {
+ vkb->feature_disable_keyboard = strtoul(oparg, NULL, 0);
+ } else if (MATCH_OPTION(XENKBD_FIELD_FEAT_DSBL_POINTER, token, oparg)) {
+ vkb->feature_disable_pointer = strtoul(oparg, NULL, 0);
+ } else if (MATCH_OPTION(XENKBD_FIELD_FEAT_ABS_POINTER, token, oparg)) {
+ vkb->feature_abs_pointer = strtoul(oparg, NULL, 0);
+ } else if (MATCH_OPTION(XENKBD_FIELD_FEAT_RAW_POINTER, token, oparg)) {
+ vkb->feature_raw_pointer = strtoul(oparg, NULL, 0);
+ } else if (MATCH_OPTION(XENKBD_FIELD_FEAT_MTOUCH, token, oparg)) {
+ vkb->feature_multi_touch = strtoul(oparg, NULL, 0);
+ } else if (MATCH_OPTION(XENKBD_FIELD_MT_WIDTH, token, oparg)) {
+ vkb->multi_touch_width = strtoul(oparg, NULL, 0);
+ } else if (MATCH_OPTION(XENKBD_FIELD_MT_HEIGHT, token, oparg)) {
+ vkb->multi_touch_height = strtoul(oparg, NULL, 0);
+ } else if (MATCH_OPTION(XENKBD_FIELD_MT_NUM_CONTACTS, token, oparg)) {
+ vkb->multi_touch_num_contacts = strtoul(oparg, NULL, 0);
+ } else if (MATCH_OPTION(XENKBD_FIELD_WIDTH, token, oparg)) {
+ vkb->width = strtoul(oparg, NULL, 0);
+ } else if (MATCH_OPTION(XENKBD_FIELD_HEIGHT, token, oparg)) {
+ vkb->height = strtoul(oparg, NULL, 0);
} else {
fprintf(stderr, "Unknown string \"%s\" in vkb spec\n", token);
return -1;
if (vkb->backend_type == LIBXL_VKB_BACKEND_UNKNOWN) {
fprintf(stderr, "backend-type should be set in vkb spec\n");
- rc = -1; goto out;
+ rc = ERROR_FAIL; goto out;
+ }
+
+ if (vkb->multi_touch_height || vkb->multi_touch_width ||
+ vkb->multi_touch_num_contacts) {
+ vkb->feature_multi_touch = true;
+ }
+
+ if (vkb->feature_multi_touch && !(vkb->multi_touch_height ||
+ vkb->multi_touch_width || vkb->multi_touch_num_contacts)) {
+ fprintf(stderr, XENKBD_FIELD_MT_WIDTH", "XENKBD_FIELD_MT_HEIGHT", "
+ XENKBD_FIELD_MT_NUM_CONTACTS" should be set for "
+ "multi touch in vkb spec\n");
+ rc = ERROR_FAIL; goto out;
}
entry++;
#include <libxl_utils.h>
#include <libxlutil.h>
+#include <xen/io/kbdif.h>
+
#include "xl.h"
#include "xl_utils.h"
#include "xl_parse.h"
rc = ERROR_FAIL; goto out;
}
+ if (vkb.multi_touch_height || vkb.multi_touch_width ||
+ vkb.multi_touch_num_contacts) {
+ vkb.feature_multi_touch = true;
+ }
+
+ if (vkb.feature_multi_touch && !(vkb.multi_touch_height ||
+ vkb.multi_touch_width || vkb.multi_touch_num_contacts)) {
+ fprintf(stderr, XENKBD_FIELD_MT_WIDTH", "XENKBD_FIELD_MT_HEIGHT", "
+ XENKBD_FIELD_MT_NUM_CONTACTS" should be set\n");
+ rc = ERROR_FAIL; goto out;
+ }
+
if (dryrun_only) {
char *json = libxl_device_vkb_to_json(ctx, &vkb);
printf("vkb: %s\n", json);