Skip to contentSkip to conversation

libxl: create standalone vkb device

PATCH Superseded Oleksandr Grytsov 2 participants 18 messages Nov 1, 2017 – Feb 6, 2018

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

cover libxl: create standalone vkb device

From: Oleksandr Grytsov <[email protected]>

Changes since initial:
* add setting backend-type to xenstore
* add id field to indentify the vkb device on backend side

Oleksandr Grytsov (6):
libxl: move vkb device to libxl_vkb.c
libxl: fix vkb XS entry and type
libxl: add backend type and id to vkb
libxl: vkb add list and info functions
xl: add vkb config parser and CLI
docs: add vkb device to xl.cfg and xl

 docs/man/xl.cfg.pod.5.in    |  28 ++++++
 docs/man/xl.pod.1.in        |  22 +++++
 tools/libxl/Makefile        |   1 +
 tools/libxl/libxl.h         |  10 ++
 tools/libxl/libxl_console.c |  53 -----------
 tools/libxl/libxl_create.c  |   3 +
 tools/libxl/libxl_dm.c      |   1 +
 tools/libxl/libxl_types.idl |  19 ++++
 tools/libxl/libxl_utils.h   |   3 +
 tools/libxl/libxl_vkb.c     | 226 ++++++++++++++++++++++++++++++++++++++++++++
 tools/xl/Makefile           |   2 +-
 tools/xl/xl.h               |   3 +
 tools/xl/xl_cmdtable.c      |  15 +++
 tools/xl/xl_parse.c         |  75 ++++++++++++++-
 tools/xl/xl_parse.h         |   2 +-
 tools/xl/xl_vkb.c           | 142 ++++++++++++++++++++++++++++
 16 files changed, 549 insertions(+), 56 deletions(-)
 create mode 100644 tools/libxl/libxl_vkb.c
 create mode 100644 tools/xl/xl_vkb.c
Signature · 7 lines
2.7.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#1 lore raw

PATCH 1/6 libxl: move vkb device to libxl_vkb.c

From: Oleksandr Grytsov <[email protected]>

Logically it is better to move vkb to
separate file as vkb device used not only by vfb
and console.

---
 tools/libxl/Makefile        |  1 +
 tools/libxl/libxl_console.c | 53 ---------------------------------
 tools/libxl/libxl_vkb.c     | 72 +++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 73 insertions(+), 53 deletions(-)
 create mode 100644 tools/libxl/libxl_vkb.c
tools/libxl/Makefile +1 -0
index 2d52435..df1b710 100644
@@ -139,6 +139,7 @@ LIBXL_OBJS = flexarray.o libxl.o libxl_create.o libxl_dm.o libxl_pci.o \
 			libxl_vtpm.o libxl_nic.o libxl_disk.o libxl_console.o \
 			libxl_cpupool.o libxl_mem.o libxl_sched.o libxl_tmem.o \
 			libxl_9pfs.o libxl_domain.o libxl_vdispl.o libxl_vsnd.o \
+			libxl_vkb.o \
                         $(LIBXL_OBJS-y)
 LIBXL_OBJS += libxl_genid.o
 LIBXL_OBJS += _libxl_types.o libxl_flask.o _libxl_types_internal.o
tools/libxl/libxl_console.c +0 -53

71 lines not on this page · raw message

tools/libxl/libxl_vkb.c new file +72 -0

72 lines not on this page · raw message

Signature · 7 lines
2.7.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#2 lore raw

PATCH 2/6 libxl: fix vkb XS entry and type

In reply to Oleksandr Grytsov

From: Oleksandr Grytsov <[email protected]>

vkb has vkbd name in XS.

---
 tools/libxl/libxl_vkb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tools/libxl/libxl_vkb.c +2 -2
index 0d01262..ea6fca8 100644
@@ -51,7 +51,7 @@ out:
     return AO_INPROGRESS;
 }
 
-static LIBXL_DEFINE_UPDATE_DEVID(vkb, "vkb")
+static LIBXL_DEFINE_UPDATE_DEVID(vkb, "vkbd")
 
 #define libxl__add_vkbs NULL
 #define libxl_device_vkb_list NULL
@@ -59,7 +59,7 @@ static LIBXL_DEFINE_UPDATE_DEVID(vkb, "vkb")
 
 LIBXL_DEFINE_DEVICE_REMOVE(vkb)
 
-DEFINE_DEVICE_TYPE_STRUCT(vkb,
+DEFINE_DEVICE_TYPE_STRUCT_X(vkb, vkb, vkbd
     .skip_attach = 1
 );
 
Signature · 7 lines
2.7.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#3 lore raw

PATCH 3/6 libxl: add backend type and id to vkb

In reply to Oleksandr Grytsov

From: Oleksandr Grytsov <[email protected]>

New field backend_type is added to vkb device in order to have QEMU and user space backend simultaneously. Each vkb backend shall read appropriate XS entry and service only own frontends.
Id is a string field which used by the backend to indentify the frontend.

---
 tools/libxl/libxl_create.c  |  3 +++
 tools/libxl/libxl_dm.c      |  1 +
 tools/libxl/libxl_types.idl |  8 ++++++++
 tools/libxl/libxl_vkb.c     | 33 ++++++++++++++++++++++++++++++++-
 4 files changed, 44 insertions(+), 1 deletion(-)
tools/libxl/libxl_create.c +3 -0
index f813114..60d8686 100644
@@ -1376,6 +1376,9 @@ static void domcreate_launch_dm(libxl__egc *egc, libxl__multidev *multidev,
         for (i = 0; i < d_config->num_vfbs; i++) {
             libxl__device_add(gc, domid, &libxl__vfb_devtype,
                               &d_config->vfbs[i]);
+        }
+
+        for (i = 0; i < d_config->num_vkbs; i++) {
             libxl__device_add(gc, domid, &libxl__vkb_devtype,
                               &d_config->vkbs[i]);
         }
tools/libxl/libxl_dm.c +1 -0
index 98f89a9..f07de35 100644
@@ -1728,6 +1728,7 @@ static int libxl__vfb_and_vkb_from_hvm_guest_config(libxl__gc *gc,
 
     vkb->backend_domid = 0;
     vkb->devid = 0;
+
     return 0;
 }
 
tools/libxl/libxl_types.idl +8 -0
index cd0c06f..c3876a2 100644
@@ -240,6 +240,12 @@ libxl_checkpointed_stream = Enumeration("checkpointed_stream", [
     (2, "COLO"),
     ])
 
+libxl_vkb_backend = Enumeration("vkb_backend", [
+    (0, "UNKNOWN"),
+    (1, "QEMU"),
+    (2, "LINUX")
+    ])
+
 #
 # Complex libxl types
 #
@@ -603,6 +609,8 @@ libxl_device_vkb = Struct("device_vkb", [
     ("backend_domid", libxl_domid),
     ("backend_domname", string),
     ("devid", libxl_devid),
+    ("backend_type", libxl_vkb_backend),
+    ("id", string)
     ])
 
 libxl_device_disk = Struct("device_disk", [
tools/libxl/libxl_vkb.c +32 -1
index ea6fca8..88ab186 100644
@@ -17,6 +17,10 @@
 static int libxl__device_vkb_setdefault(libxl__gc *gc, uint32_t domid,
                                         libxl_device_vkb *vkb, bool hotplug)
 {
+    if (vkb->backend_type == LIBXL_VKB_BACKEND_UNKNOWN) {
+        vkb->backend_type = LIBXL_VKB_BACKEND_QEMU;
+    }
+
     return libxl__resolve_domid(gc, vkb->backend_domname, &vkb->backend_domid);
 }
 
@@ -34,6 +38,30 @@ static int libxl__device_from_vkb(libxl__gc *gc, uint32_t domid,
     return 0;
 }
 
+static int libxl__device_vkb_dm_needed(libxl_device_vkb *vkb, uint32_t domid)
+{
+   if (vkb->backend_type == LIBXL_VKB_BACKEND_QEMU) {
+        return 1;
+   }
+
+    return 0;
+}
+
+static int libxl__set_xenstore_vkb(libxl__gc *gc, uint32_t domid,
+                                   libxl_device_vkb *vkb,
+                                   flexarray_t *back, flexarray_t *front,
+                                   flexarray_t *ro_front)
+{
+    if (vkb->id) {
+        flexarray_append_pair(front, "id", vkb->id);
+    }
+
+    flexarray_append_pair(back, "backend-type",
+                          (char *)libxl_vkb_backend_to_string(vkb->backend_type));
+
+    return 0;
+}
+
 int libxl_device_vkb_add(libxl_ctx *ctx, uint32_t domid, libxl_device_vkb *vkb,
                          const libxl_asyncop_how *ao_how)
 {
@@ -60,7 +88,10 @@ static LIBXL_DEFINE_UPDATE_DEVID(vkb, "vkbd")
 LIBXL_DEFINE_DEVICE_REMOVE(vkb)
 
 DEFINE_DEVICE_TYPE_STRUCT_X(vkb, vkb, vkbd
-    .skip_attach = 1
+    .skip_attach = 1,
+    .dm_needed   = (device_dm_needed_fn_t)libxl__device_vkb_dm_needed,
+    .set_xenstore_config   = (device_set_xenstore_config_fn_t)
+                             libxl__set_xenstore_vkb
 );
 
 /*
Signature · 7 lines
2.7.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#4 lore raw

Re: [PATCH v1 3/6] libxl: add backend type and id to vkb

Quoted 37 lines · Oleksandr Grytsov

From: Oleksandr Grytsov <[email protected]>

New field backend_type is added to vkb device in order to have QEMU and user space backend simultaneously. Each vkb backend shall read appropriate XS entry and service only own frontends.
Id is a string field which used by the backend to indentify the frontend.

---
 tools/libxl/libxl_create.c  |  3 +++
 tools/libxl/libxl_dm.c      |  1 +
 tools/libxl/libxl_types.idl |  8 ++++++++
 tools/libxl/libxl_vkb.c     | 33 ++++++++++++++++++++++++++++++++-
 4 files changed, 44 insertions(+), 1 deletion(-)
tools/libxl/libxl_create.c +3 -0
index f813114..60d8686 100644
@@ -1376,6 +1376,9 @@ static void domcreate_launch_dm(libxl__egc *egc, libxl__multidev *multidev,
         for (i = 0; i < d_config->num_vfbs; i++) {
             libxl__device_add(gc, domid, &libxl__vfb_devtype,
                               &d_config->vfbs[i]);
+        }
+
+        for (i = 0; i < d_config->num_vkbs; i++) {
             libxl__device_add(gc, domid, &libxl__vkb_devtype,
                               &d_config->vkbs[i]);
         }
tools/libxl/libxl_dm.c +0 -0
index 98f89a9..f07de35 100644

tools/libxl/libxl_dm.c static int libxl__vfb_and_vkb_from_hvm_guest_config(libxl__gc *gc, · line 1731

Quoted 4 lines
tools/libxl/libxl_dm.c +1 -0
@@ -1728,6 +1728,7 @@ static int libxl__vfb_and_vkb_from_hvm_guest_config(libxl__gc *gc,
 
     vkb->backend_domid = 0;
     vkb->devid = 0;
+

Stray change. I don't have objection though.

Quoted 45 lines
tools/libxl/libxl_dm.c +0 -0
     return 0;
 }
 
tools/libxl/libxl_types.idl +8 -0
index cd0c06f..c3876a2 100644
@@ -240,6 +240,12 @@ libxl_checkpointed_stream = Enumeration("checkpointed_stream", [
     (2, "COLO"),
     ])
 
+libxl_vkb_backend = Enumeration("vkb_backend", [
+    (0, "UNKNOWN"),
+    (1, "QEMU"),
+    (2, "LINUX")
+    ])
+
 #
 # Complex libxl types
 #
@@ -603,6 +609,8 @@ libxl_device_vkb = Struct("device_vkb", [
     ("backend_domid", libxl_domid),
     ("backend_domname", string),
     ("devid", libxl_devid),
+    ("backend_type", libxl_vkb_backend),
+    ("id", string)
     ])
 
 libxl_device_disk = Struct("device_disk", [
tools/libxl/libxl_vkb.c +4 -0
index ea6fca8..88ab186 100644
@@ -17,6 +17,10 @@
 static int libxl__device_vkb_setdefault(libxl__gc *gc, uint32_t domid,
                                         libxl_device_vkb *vkb, bool hotplug)
 {
+    if (vkb->backend_type == LIBXL_VKB_BACKEND_UNKNOWN) {
+        vkb->backend_type = LIBXL_VKB_BACKEND_QEMU;
+    }
+
     return libxl__resolve_domid(gc, vkb->backend_domname, &vkb->backend_domid);
 }
 

tools/libxl/libxl_vkb.c static int libxl__device_from_vkb(libxl__gc *gc, uint32_t domid, · line 45

Quoted 8 lines
tools/libxl/libxl_vkb.c +5 -0
@@ -34,6 +38,30 @@ static int libxl__device_from_vkb(libxl__gc *gc, uint32_t domid,
     return 0;
 }
 
+static int libxl__device_vkb_dm_needed(libxl_device_vkb *vkb, uint32_t domid)
+{
+   if (vkb->backend_type == LIBXL_VKB_BACKEND_QEMU) {
+        return 1;
+   }

No need to have {} for a single statement here.

tools/libxl/libxl_vkb.c static int libxl__device_from_vkb(libxl__gc *gc, uint32_t domid, · line 58

Quoted 13 lines
tools/libxl/libxl_vkb.c +13 -0
+
+    return 0;
+}
+
+static int libxl__set_xenstore_vkb(libxl__gc *gc, uint32_t domid,
+                                   libxl_device_vkb *vkb,
+                                   flexarray_t *back, flexarray_t *front,
+                                   flexarray_t *ro_front)
+{
+    if (vkb->id) {
+        flexarray_append_pair(front, "id", vkb->id);
+    }
+

Ditto.

And, isn't 0 a valid device id?

Wei.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#5 lore raw

Re: [PATCH v1 3/6] libxl: add backend type and id to vkb

Quoted 125 lines · Wei Liu

tools/libxl/libxl_create.c static void domcreate_launch_dm(libxl__egc *egc,

Quoted 23 lines · Oleksandr Grytsov

From: Oleksandr Grytsov <[email protected]>

New field backend_type is added to vkb device in order to have QEMU and user space backend simultaneously. Each vkb backend shall read appropriate XS entry and service only own frontends.
Id is a string field which used by the backend to indentify the frontend.

---
 tools/libxl/libxl_create.c  |  3 +++
 tools/libxl/libxl_dm.c      |  1 +
 tools/libxl/libxl_types.idl |  8 ++++++++
 tools/libxl/libxl_vkb.c     | 33 ++++++++++++++++++++++++++++++++-
 4 files changed, 44 insertions(+), 1 deletion(-)
tools/libxl/libxl_create.c +0 -0
index f813114..60d8686 100644
@@ -1376,6 +1376,9 @@ static void domcreate_launch_dm(libxl__egc *egc,

libxl__multidev *multidev,

tools/libxl/libxl_dm.c static int libxl__vfb_and_vkb_from_hvm_guest_config(libxl__gc

Quoted 14 lines
tools/libxl/libxl_create.c +3 -0
         for (i = 0; i < d_config->num_vfbs; i++) {
             libxl__device_add(gc, domid, &libxl__vfb_devtype,
                               &d_config->vfbs[i]);
+        }
+
+        for (i = 0; i < d_config->num_vkbs; i++) {
             libxl__device_add(gc, domid, &libxl__vkb_devtype,
                               &d_config->vkbs[i]);
         }
tools/libxl/libxl_dm.c +0 -0
index 98f89a9..f07de35 100644
@@ -1728,6 +1728,7 @@ static int libxl__vfb_and_vkb_from_hvm_guest_config(libxl__gc

*gc,

tools/libxl/libxl_dm.c static int libxl__vfb_and_vkb_from_hvm_guest_config(libxl__gc *gc, · line 1731

Quoted 4 lines
tools/libxl/libxl_dm.c +1 -0
     vkb->backend_domid = 0;
     vkb->devid = 0;
+

Stray change. I don't have objection though.

tools/libxl/libxl_types.idl libxl_checkpointed_stream =

Quoted 8 lines
tools/libxl/libxl_dm.c +0 -0
     return 0;
 }
 
tools/libxl/libxl_types.idl +0 -0
index cd0c06f..c3876a2 100644
@@ -240,6 +240,12 @@ libxl_checkpointed_stream =

Enumeration("checkpointed_stream", [

Quoted 26 lines
tools/libxl/libxl_types.idl +8 -0
     (2, "COLO"),
     ])
 
+libxl_vkb_backend = Enumeration("vkb_backend", [
+    (0, "UNKNOWN"),
+    (1, "QEMU"),
+    (2, "LINUX")
+    ])
+
 #
 # Complex libxl types
 #
@@ -603,6 +609,8 @@ libxl_device_vkb = Struct("device_vkb", [
     ("backend_domid", libxl_domid),
     ("backend_domname", string),
     ("devid", libxl_devid),
+    ("backend_type", libxl_vkb_backend),
+    ("id", string)
     ])
 
 libxl_device_disk = Struct("device_disk", [
tools/libxl/libxl_vkb.c +0 -0
index ea6fca8..88ab186 100644

tools/libxl/libxl_vkb.c line 18

Quoted 2 lines
tools/libxl/libxl_vkb.c +0 -0
@@ -17,6 +17,10 @@
 static int libxl__device_vkb_setdefault(libxl__gc *gc, uint32_t domid,
                                         libxl_device_vkb *vkb, bool

hotplug)

tools/libxl/libxl_vkb.c

Quoted 6 lines
tools/libxl/libxl_vkb.c +4 -0
 {
+    if (vkb->backend_type == LIBXL_VKB_BACKEND_UNKNOWN) {
+        vkb->backend_type = LIBXL_VKB_BACKEND_QEMU;
+    }
+
     return libxl__resolve_domid(gc, vkb->backend_domname,

&vkb->backend_domid);

tools/libxl/libxl_vkb.c static int libxl__device_from_vkb(libxl__gc *gc,

Quoted 3 lines
tools/libxl/libxl_vkb.c +0 -0
 }
 
@@ -34,6 +38,30 @@ static int libxl__device_from_vkb(libxl__gc *gc,

uint32_t domid,

tools/libxl/libxl_vkb.c static int libxl__device_from_vkb(libxl__gc *gc, · line 41

Quoted 4 lines
tools/libxl/libxl_vkb.c +1 -0
     return 0;
 }
 
+static int libxl__device_vkb_dm_needed(libxl_device_vkb *vkb, uint32_t

domid)

tools/libxl/libxl_vkb.c static int libxl__device_from_vkb(libxl__gc *gc, uint32_t domid, · line 45

Quoted 4 lines
tools/libxl/libxl_vkb.c +4 -0
+{
+   if (vkb->backend_type == LIBXL_VKB_BACKEND_QEMU) {
+        return 1;
+   }

No need to have {} for a single statement here.

tools/libxl/libxl_vkb.c static int libxl__device_from_vkb(libxl__gc *gc, uint32_t domid,

Quoted 7 lines
tools/libxl/libxl_vkb.c +7 -0
+
+    return 0;
+}
+
+static int libxl__set_xenstore_vkb(libxl__gc *gc, uint32_t domid,
+                                   libxl_device_vkb *vkb,
+                                   flexarray_t *back, flexarray_t

*front,

tools/libxl/libxl_vkb.c static int libxl__device_from_vkb(libxl__gc *gc, uint32_t domid, · line 58

Quoted 6 lines
tools/libxl/libxl_vkb.c +6 -0
+                                   flexarray_t *ro_front)
+{
+    if (vkb->id) {
+        flexarray_append_pair(front, "id", vkb->id);
+    }
+

Ditto.

Quoted 3 lines

And, isn't 0 a valid device id?

id here is char *. I put it to xenstore only if it is defined. It shall be defined for linux backend
in case of multiple instances of kbd device are defined. The backend distinguishes them
by id.

Wei.

Quoted 1 line
Signature · 2 lines
Best Regards,
Oleksandr Grytsov.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#6 lore raw

Re: [PATCH v1 3/6] libxl: add backend type and id to vkb

Quoted 13 lines · Oleksandr Grytsov
Quoted 13 lines

tools/libxl/libxl_vkb.c static int libxl__device_from_vkb(libxl__gc *gc, uint32_t domid,

Quoted 3 lines
tools/libxl/libxl_vkb.c +3 -0
+static int libxl__set_xenstore_vkb(libxl__gc *gc, uint32_t domid,
+                                   libxl_device_vkb *vkb,
+                                   flexarray_t *back, flexarray_t

*front,

tools/libxl/libxl_vkb.c static int libxl__device_from_vkb(libxl__gc *gc, uint32_t domid, · line 58

Quoted 6 lines
tools/libxl/libxl_vkb.c +6 -0
+                                   flexarray_t *ro_front)
+{
+    if (vkb->id) {
+        flexarray_append_pair(front, "id", vkb->id);
+    }
+

Ditto.

Quoted 8 lines
Quoted 3 lines

And, isn't 0 a valid device id?

id here is char *. I put it to xenstore only if it is defined. It shall be defined for linux backend
in case of multiple instances of kbd device are defined. The backend distinguishes them
by id.

Oh I was a fool -- I misread that as dev_id which had numeric value.

Wei.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#7 lore raw

PATCH 4/6 libxl: vkb add list and info functions

In reply to Oleksandr Grytsov

From: Oleksandr Grytsov <[email protected]>

---
 tools/libxl/libxl.h         |  10 ++++
 tools/libxl/libxl_types.idl |  11 ++++
 tools/libxl/libxl_utils.h   |   3 ++
 tools/libxl/libxl_vkb.c     | 129 ++++++++++++++++++++++++++++++++++++++++++--
 4 files changed, 150 insertions(+), 3 deletions(-)
tools/libxl/libxl.h +10 -0
index acb73ce..f2f8442 100644
@@ -1950,6 +1950,16 @@ int libxl_device_vkb_destroy(libxl_ctx *ctx, uint32_t domid,
                              const libxl_asyncop_how *ao_how)
                             LIBXL_EXTERNAL_CALLERS_ONLY;
 
+libxl_device_vkb *libxl_device_vkb_list(libxl_ctx *ctx,
+                                        uint32_t domid, int *num)
+                                        LIBXL_EXTERNAL_CALLERS_ONLY;
+void libxl_device_vkb_list_free(libxl_device_vkb* list, int num)
+                                LIBXL_EXTERNAL_CALLERS_ONLY;
+int libxl_device_vkb_getinfo(libxl_ctx *ctx, uint32_t domid,
+                             libxl_device_vkb *vkb,
+                             libxl_vkbinfo *vkbinfo)
+                             LIBXL_EXTERNAL_CALLERS_ONLY;
+
 /* Framebuffer */
 int libxl_device_vfb_add(libxl_ctx *ctx, uint32_t domid, libxl_device_vfb *vfb,
                          const libxl_asyncop_how *ao_how)
tools/libxl/libxl_types.idl +11 -0
index c3876a2..d19af46 100644
@@ -1015,6 +1015,17 @@ libxl_vsndinfo = Struct("vsndinfo", [
     ("pcms", Array(libxl_pcminfo, "num_vsnd_pcms"))
     ])
 
+libxl_vkbinfo = Struct("vkbinfo", [
+    ("backend", string),
+    ("backend_id", uint32),
+    ("frontend", string),
+    ("frontend_id", uint32),
+    ("devid", libxl_devid),
+    ("state", integer),
+    ("evtch", integer),
+    ("rref", integer)
+    ], dir=DIR_OUT)
+
 # NUMA node characteristics: size and free are how much memory it has, and how
 # much of it is free, respectively. dists is an array of distances from this
 # node to each other node.
tools/libxl/libxl_utils.h +3 -0
index 5455752..44409af 100644
@@ -79,6 +79,9 @@ int libxl_devid_to_device_vtpm(libxl_ctx *ctx, uint32_t domid,
 int libxl_devid_to_device_usbctrl(libxl_ctx *ctx, uint32_t domid,
                                   int devid, libxl_device_usbctrl *usbctrl);
 
+int libxl_devid_to_device_vkb(libxl_ctx *ctx, uint32_t domid,
+                              int devid, libxl_device_vkb *vkb);
+
 int libxl_devid_to_device_vdispl(libxl_ctx *ctx, uint32_t domid,
                                  int devid, libxl_device_vdispl *vdispl);
 
tools/libxl/libxl_vkb.c +126 -3

157 lines not on this page · raw message

Signature · 7 lines
2.7.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#10 lore raw

PATCH 5/6 xl: add vkb config parser and CLI

In reply to Oleksandr Grytsov

From: Oleksandr Grytsov <[email protected]>

---
 tools/xl/Makefile      |   2 +-
 tools/xl/xl.h          |   3 ++
 tools/xl/xl_cmdtable.c |  15 ++++++
 tools/xl/xl_parse.c    |  75 +++++++++++++++++++++++++-
 tools/xl/xl_parse.h    |   2 +-
 tools/xl/xl_vkb.c      | 142 +++++++++++++++++++++++++++++++++++++++++++++++++
 6 files changed, 236 insertions(+), 3 deletions(-)
 create mode 100644 tools/xl/xl_vkb.c
tools/xl/Makefile +1 -1
index 66bdbde..2769295 100644
@@ -22,7 +22,7 @@ XL_OBJS += xl_vtpm.o xl_block.o xl_nic.o xl_usb.o
 XL_OBJS += xl_sched.o xl_pci.o xl_vcpu.o xl_cdrom.o xl_mem.o
 XL_OBJS += xl_info.o xl_console.o xl_misc.o
 XL_OBJS += xl_vmcontrol.o xl_saverestore.o xl_migrate.o
-XL_OBJS += xl_vdispl.o xl_vsnd.o
+XL_OBJS += xl_vdispl.o xl_vsnd.o xl_vkb.o
 
 $(XL_OBJS): CFLAGS += $(CFLAGS_libxentoollog)
 $(XL_OBJS): CFLAGS += $(CFLAGS_XL)
tools/xl/xl.h +3 -0
index 703caa6..826e9c1 100644
@@ -170,6 +170,9 @@ int main_vtpmdetach(int argc, char **argv);
 int main_vdisplattach(int argc, char **argv);
 int main_vdispllist(int argc, char **argv);
 int main_vdispldetach(int argc, char **argv);
+int main_vkbattach(int argc, char **argv);
+int main_vkblist(int argc, char **argv);
+int main_vkbdetach(int argc, char **argv);
 int main_vsndattach(int argc, char **argv);
 int main_vsndlist(int argc, char **argv);
 int main_vsnddetach(int argc, char **argv);
tools/xl/xl_cmdtable.c +15 -0
index 8e162ce..8f076d0 100644
@@ -378,6 +378,21 @@ struct cmd_spec cmd_table[] = {
       "Destroy a domain's virtual TPM device",
       "<Domain> <DevId|uuid>",
     },
+    { "vkb-attach",
+      &main_vkbattach, 1, 1,
+      "Create a new virtual keyboard device",
+      "<Domain> [id=<InputId>] [backend-type=<BackendType>] [backend=<BackDomain>]",
+    },
+    { "vkb-list",
+      &main_vkblist, 0, 0,
+      "List virtual keyboard devices for a domain",
+      "<Domain(s)>",
+    },
+    { "vkb-detach",
+      &main_vkbdetach, 0, 1,
+      "Destroy a domain's virtual keyboard device",
+      "<Domain> <DevId>",
+    },
     { "vdispl-attach",
       &main_vdisplattach, 1, 1,
       "Create a new virtual display device",
tools/xl/xl_parse.c +74 -1

87 lines not on this page · raw message

tools/xl/xl_parse.h +1 -1
index 9a948ea..19f453a 100644
@@ -35,7 +35,7 @@ int parse_cpurange(const char *cpu, libxl_bitmap *cpumap);
 int parse_nic_config(libxl_device_nic *nic, XLU_Config **config, char *token);
 int parse_vdispl_config(libxl_device_vdispl *vdispl, char *token);
 int parse_vsnd_item(libxl_device_vsnd *vsnd, const char *spec);
-
+int parse_vkb_config(libxl_device_vkb *vkb, char *token);
 int match_option_size(const char *prefix, size_t len,
                       char *arg, char **argopt);
 #define MATCH_OPTION(prefix, arg, oparg) \
tools/xl/xl_vkb.c new file +142 -0

142 lines not on this page · raw message

Signature · 7 lines
2.7.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#12 lore raw

PATCH 6/6 docs: add vkb device to xl.cfg and xl

In reply to Oleksandr Grytsov

From: Oleksandr Grytsov <[email protected]>

---
 docs/man/xl.cfg.pod.5.in | 28 ++++++++++++++++++++++++++++
 docs/man/xl.pod.1.in     | 22 ++++++++++++++++++++++
 2 files changed, 50 insertions(+)
docs/man/xl.cfg.pod.5.in +28 -0
index 4948dd7..1859572 100644
@@ -1317,6 +1317,34 @@ I<EXAMPLE:>
 
 =back
 
+=over 4
+
+=item B<vkb=[ "VKB_SPEC_STRING", "VKB_SPEC_STRING", ...]>
+
+Specifies the virtual keyboard device to be provided to the guest.
+
+Each B<VKB_SPEC_STRING> is a comma-separated list of C<KEY=VALUE>
+settings from the following list:
+
+=over 4
+
+=item B<id=STRING>
+
+Specifies the unique input device id.
+
+=item B<backend=domain-id>
+
+Specifies the backend domain name or id.
+
+=item B<backend-type=type>
+
+Specifies the backend type: qemu - for QEMU backend or linux - for Linux PV
+domain.
+
+=back
+
+=back
+
 =head2 Paravirtualised (PV) Guest Specific Options
 
 The following options apply only to Paravirtual (PV) guests.
docs/man/xl.pod.1.in +22 -0
index 0a88fd5..17b1e53 100644
@@ -1506,6 +1506,28 @@ List vsnd devices for a domain.
 
 =back
 
+=head2 KEYBOARD DEVICES
+
+=over 4
+
+=item B<vkb-attach> I<domain-id> I<vkb-device>
+
+Creates a new keyboard device in the domain specified by I<domain-id>.
+I<vkb-device> describes the device to attach, using the same format as the
+B<VKB_SPEC_STRING> string in the domain config file. See L<xl.cfg(5)>
+for more informations.
+
+=item B<vkb-detach> I<domain-id> I<devid>
+
+Removes the keyboard device from the domain specified by I<domain-id>.
+I<devid> is the virtual interface device number within the domain
+
+=item B<vkb-list> I<domain-id>
+
+List virtual network interfaces for a domain.
+
+=back
+
 =head1 PCI PASS-THROUGH
 
 =over 4
Signature · 7 lines
2.7.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#14 lore raw
In reply to Oleksandr Grytsov
Quoted 35 lines · Oleksandr Grytsov

From: Oleksandr Grytsov <[email protected]>

Changes since initial:
* add setting backend-type to xenstore
* add id field to indentify the vkb device on backend side

Oleksandr Grytsov (6):
libxl: move vkb device to libxl_vkb.c
libxl: fix vkb XS entry and type
libxl: add backend type and id to vkb
libxl: vkb add list and info functions
xl: add vkb config parser and CLI
docs: add vkb device to xl.cfg and xl

 docs/man/xl.cfg.pod.5.in    |  28 ++++++
 docs/man/xl.pod.1.in        |  22 +++++
 tools/libxl/Makefile        |   1 +
 tools/libxl/libxl.h         |  10 ++
 tools/libxl/libxl_console.c |  53 -----------
 tools/libxl/libxl_create.c  |   3 +
 tools/libxl/libxl_dm.c      |   1 +
 tools/libxl/libxl_types.idl |  19 ++++
 tools/libxl/libxl_utils.h   |   3 +
 tools/libxl/libxl_vkb.c     | 226 ++++++++++++++++++++++++++++++
++++++++++++++
 tools/xl/Makefile           |   2 +-
 tools/xl/xl.h               |   3 +
 tools/xl/xl_cmdtable.c      |  15 +++
 tools/xl/xl_parse.c         |  75 ++++++++++++++-
 tools/xl/xl_parse.h         |   2 +-
 tools/xl/xl_vkb.c           | 142 ++++++++++++++++++++++++++++
 16 files changed, 549 insertions(+), 56 deletions(-)
 create mode 100644 tools/libxl/libxl_vkb.c
 create mode 100644 tools/xl/xl_vkb.c
Quoted 4 lines

--
2.7.4

ping

Signature · 2 lines
Best Regards,
Oleksandr Grytsov.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#15 lore raw
Quoted 42 lines · Oleksandr Grytsov
Quoted 35 lines · Oleksandr Grytsov

From: Oleksandr Grytsov <[email protected]>

Changes since initial:
* add setting backend-type to xenstore
* add id field to indentify the vkb device on backend side

Oleksandr Grytsov (6):
libxl: move vkb device to libxl_vkb.c
libxl: fix vkb XS entry and type
libxl: add backend type and id to vkb
libxl: vkb add list and info functions
xl: add vkb config parser and CLI
docs: add vkb device to xl.cfg and xl

 docs/man/xl.cfg.pod.5.in    |  28 ++++++
 docs/man/xl.pod.1.in        |  22 +++++
 tools/libxl/Makefile        |   1 +
 tools/libxl/libxl.h         |  10 ++
 tools/libxl/libxl_console.c |  53 -----------
 tools/libxl/libxl_create.c  |   3 +
 tools/libxl/libxl_dm.c      |   1 +
 tools/libxl/libxl_types.idl |  19 ++++
 tools/libxl/libxl_utils.h   |   3 +
 tools/libxl/libxl_vkb.c     | 226 ++++++++++++++++++++++++++++++
++++++++++++++
 tools/xl/Makefile           |   2 +-
 tools/xl/xl.h               |   3 +
 tools/xl/xl_cmdtable.c      |  15 +++
 tools/xl/xl_parse.c         |  75 ++++++++++++++-
 tools/xl/xl_parse.h         |   2 +-
 tools/xl/xl_vkb.c           | 142 ++++++++++++++++++++++++++++
 16 files changed, 549 insertions(+), 56 deletions(-)
 create mode 100644 tools/libxl/libxl_vkb.c
 create mode 100644 tools/xl/xl_vkb.c
Quoted 4 lines

--
2.7.4

Quoted 6 lines

ping

--
Best Regards,
Oleksandr Grytsov.

ping

Signature · 2 lines
Best Regards,
Oleksandr Grytsov.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#16 lore raw
Quoted 52 lines · Oleksandr Grytsov
Quoted 42 lines · Oleksandr Grytsov
Quoted 35 lines · Oleksandr Grytsov

From: Oleksandr Grytsov <[email protected]>

Changes since initial:
* add setting backend-type to xenstore
* add id field to indentify the vkb device on backend side

Oleksandr Grytsov (6):
libxl: move vkb device to libxl_vkb.c
libxl: fix vkb XS entry and type
libxl: add backend type and id to vkb
libxl: vkb add list and info functions
xl: add vkb config parser and CLI
docs: add vkb device to xl.cfg and xl

 docs/man/xl.cfg.pod.5.in    |  28 ++++++
 docs/man/xl.pod.1.in        |  22 +++++
 tools/libxl/Makefile        |   1 +
 tools/libxl/libxl.h         |  10 ++
 tools/libxl/libxl_console.c |  53 -----------
 tools/libxl/libxl_create.c  |   3 +
 tools/libxl/libxl_dm.c      |   1 +
 tools/libxl/libxl_types.idl |  19 ++++
 tools/libxl/libxl_utils.h   |   3 +
 tools/libxl/libxl_vkb.c     | 226 ++++++++++++++++++++++++++++++
++++++++++++++
 tools/xl/Makefile           |   2 +-
 tools/xl/xl.h               |   3 +
 tools/xl/xl_cmdtable.c      |  15 +++
 tools/xl/xl_parse.c         |  75 ++++++++++++++-
 tools/xl/xl_parse.h         |   2 +-
 tools/xl/xl_vkb.c           | 142 ++++++++++++++++++++++++++++
 16 files changed, 549 insertions(+), 56 deletions(-)
 create mode 100644 tools/libxl/libxl_vkb.c
 create mode 100644 tools/xl/xl_vkb.c
Quoted 4 lines

--
2.7.4

Quoted 6 lines

ping

--
Best Regards,
Oleksandr Grytsov.

Quoted 6 lines

ping

--
Best Regards,
Oleksandr Grytsov.

Ian, Wei,

Could you review this patch set?

Signature · 2 lines
Best Regards,
Oleksandr Grytsov.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#17 lore raw
Quoted 64 lines · Oleksandr Grytsov
Quoted 52 lines · Oleksandr Grytsov
Quoted 42 lines · Oleksandr Grytsov
Quoted 35 lines · Oleksandr Grytsov

From: Oleksandr Grytsov <[email protected]>

Changes since initial:
* add setting backend-type to xenstore
* add id field to indentify the vkb device on backend side

Oleksandr Grytsov (6):
libxl: move vkb device to libxl_vkb.c
libxl: fix vkb XS entry and type
libxl: add backend type and id to vkb
libxl: vkb add list and info functions
xl: add vkb config parser and CLI
docs: add vkb device to xl.cfg and xl

 docs/man/xl.cfg.pod.5.in    |  28 ++++++
 docs/man/xl.pod.1.in        |  22 +++++
 tools/libxl/Makefile        |   1 +
 tools/libxl/libxl.h         |  10 ++
 tools/libxl/libxl_console.c |  53 -----------
 tools/libxl/libxl_create.c  |   3 +
 tools/libxl/libxl_dm.c      |   1 +
 tools/libxl/libxl_types.idl |  19 ++++
 tools/libxl/libxl_utils.h   |   3 +
 tools/libxl/libxl_vkb.c     | 226 ++++++++++++++++++++++++++++++
++++++++++++++
 tools/xl/Makefile           |   2 +-
 tools/xl/xl.h               |   3 +
 tools/xl/xl_cmdtable.c      |  15 +++
 tools/xl/xl_parse.c         |  75 ++++++++++++++-
 tools/xl/xl_parse.h         |   2 +-
 tools/xl/xl_vkb.c           | 142 ++++++++++++++++++++++++++++
 16 files changed, 549 insertions(+), 56 deletions(-)
 create mode 100644 tools/libxl/libxl_vkb.c
 create mode 100644 tools/xl/xl_vkb.c
Quoted 4 lines

--
2.7.4

Quoted 6 lines

ping

--
Best Regards,
Oleksandr Grytsov.

Quoted 6 lines

ping

--
Best Regards,
Oleksandr Grytsov.

Quoted 8 lines

Ian, Wei,

Could you review this patch set?

--
Best Regards,
Oleksandr Grytsov.

ping

Signature · 2 lines
Best Regards,
Oleksandr Grytsov.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel