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

Re: [Xen-devel] [PATCH 2/3] xen/kbdif: Add unique input device identifier



On 06/07/2018 04:28 PM, Konrad Rzeszutek Wilk wrote:
On Wed, May 23, 2018 at 09:19:22AM +0300, Oleksandr Andrushchenko wrote:
From: Oleksandr Andrushchenko <oleksandr_andrushchenko@xxxxxxxx>

If frontend is configured to expose multiple input device instances
then backend may require a way to uniquely identify concrete input
device within the frontend. This is useful for use-cases where
virtual input device needs to be matched to physical input device.
Add XenBus "unique-id" node parameter, so this sort of use-cases can
be implemented.

Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@xxxxxxxx>
---
  xen/include/public/io/kbdif.h | 10 ++++++++++
  1 file changed, 10 insertions(+)

diff --git a/xen/include/public/io/kbdif.h b/xen/include/public/io/kbdif.h
index a68da0f1a37f..45e4ff5b0a05 100644
--- a/xen/include/public/io/kbdif.h
+++ b/xen/include/public/io/kbdif.h
@@ -82,6 +82,15 @@
   *      for pointer devices should set this to 1. Raw (unscaled) values have
   *      a range of [0, 0x7fff].
   *
+ *-----------------------  Device Instance Parameters ------------------------
+ *
+ * unique-id
+ *      Values:         <uint32_t>
Wouldn't a string be easier? That way you can extend this in the future
to also have an UUID or so?
Much easier. We were thinking about that as well, but sndif already has it
as uint32_t. If you are ok to change uniquie-id for sndif to string then that
would be much better: UUID as you mention + all protocols have unique-id
consistently defined as string.
sndif's unique-id is not used by the frontend driver and we are about
to start libx/xl support for sound, so I think this is the right time for
such a change.
If you are fine with that then I'll send yet another patch for sndif.
+ *
+ *      After device instance initialization it is assigned a unique ID
+ *      (within the front driver), so every instance of the frontend can be
+ *      identified by the backend by this ID.
+ *
   *------------------------- Pointer Device Parameters ------------------------
   *
   * width
@@ -204,6 +213,7 @@
  #define XENKBD_FIELD_MT_WIDTH          "multi-touch-width"
  #define XENKBD_FIELD_MT_HEIGHT         "multi-touch-height"
  #define XENKBD_FIELD_MT_NUM_CONTACTS   "multi-touch-num-contacts"
+#define XENKBD_FIELD_UNIQUE_ID         "unique-id"
/* OBSOLETE, not recommended for use */
  #define XENKBD_FIELD_RING_REF          "page-ref"
--
2.17.0



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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