From: Oleksandr Grytsov <al1img@gmail.com>
To: Wei Liu <wei.liu2@citrix.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
Ian Jackson <ian.jackson@eu.citrix.com>,
Oleksandr Grytsov <oleksandr_grytsov@epam.com>
Subject: Re: [PATCH v1 3/6] libxl: add backend type and id to vkb
Date: Tue, 6 Feb 2018 18:45:15 +0200 [thread overview]
Message-ID: <CACvf2oXxVy4LT7CCy7tv+PSTDALwESFNVsthGO_NkDqtHRecaA@mail.gmail.com> (raw)
In-Reply-To: <20180206142522.pe5mg2yzga6weagk@citrix.com>
[-- Attachment #1.1: Type: text/plain, Size: 4394 bytes --]
On Tue, Feb 6, 2018 at 4:25 PM, Wei Liu <wei.liu2@citrix.com> wrote:
> On Wed, Nov 01, 2017 at 05:05:04PM +0200, Oleksandr Grytsov wrote:
> > From: Oleksandr Grytsov <oleksandr_grytsov@epam.com>
> >
> > 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.
> >
> > Signed-off-by: Oleksandr Grytsov <oleksandr_grytsov@epam.com>
> > ---
> > 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(-)
> >
> > diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
> > index f813114..60d8686 100644
> > --- a/tools/libxl/libxl_create.c
> > +++ b/tools/libxl/libxl_create.c
> > @@ -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]);
> > }
> > diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
> > index 98f89a9..f07de35 100644
> > --- a/tools/libxl/libxl_dm.c
> > +++ b/tools/libxl/libxl_dm.c
> > @@ -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.
>
> > return 0;
> > }
> >
> > diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
> > index cd0c06f..c3876a2 100644
> > --- a/tools/libxl/libxl_types.idl
> > +++ b/tools/libxl/libxl_types.idl
> > @@ -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", [
> > diff --git a/tools/libxl/libxl_vkb.c b/tools/libxl/libxl_vkb.c
> > index ea6fca8..88ab186 100644
> > --- a/tools/libxl/libxl_vkb.c
> > +++ b/tools/libxl/libxl_vkb.c
> > @@ -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;
> > + }
>
> No need to have {} for a single statement here.
>
> > +
> > + 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?
>
>
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.
>
--
Best Regards,
Oleksandr Grytsov.
[-- Attachment #1.2: Type: text/html, Size: 6438 bytes --]
[-- Attachment #2: Type: text/plain, Size: 157 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
next prev parent reply other threads:[~2018-02-06 16:45 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-01 15:05 [PATCH v1 0/6] libxl: create standalone vkb device Oleksandr Grytsov
2017-11-01 15:05 ` [PATCH v1 1/6] libxl: move vkb device to libxl_vkb.c Oleksandr Grytsov
2017-11-01 15:05 ` [PATCH v1 2/6] libxl: fix vkb XS entry and type Oleksandr Grytsov
2017-11-01 15:05 ` [PATCH v1 3/6] libxl: add backend type and id to vkb Oleksandr Grytsov
2018-02-06 14:25 ` Wei Liu
2018-02-06 16:45 ` Oleksandr Grytsov [this message]
2018-02-06 16:54 ` Wei Liu
2017-11-01 15:05 ` [PATCH v1 4/6] libxl: vkb add list and info functions Oleksandr Grytsov
2018-02-06 14:26 ` Wei Liu
2018-02-06 14:27 ` Wei Liu
2017-11-01 15:05 ` [PATCH v1 5/6] xl: add vkb config parser and CLI Oleksandr Grytsov
2018-02-06 14:27 ` Wei Liu
2017-11-01 15:05 ` [PATCH v1 6/6] docs: add vkb device to xl.cfg and xl Oleksandr Grytsov
2018-02-06 14:28 ` Wei Liu
2017-11-14 12:39 ` [PATCH v1 0/6] libxl: create standalone vkb device Oleksandr Grytsov
2017-11-20 13:44 ` Oleksandr Grytsov
2018-01-09 11:31 ` Oleksandr Grytsov
2018-02-05 11:03 ` Oleksandr Grytsov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CACvf2oXxVy4LT7CCy7tv+PSTDALwESFNVsthGO_NkDqtHRecaA@mail.gmail.com \
--to=al1img@gmail.com \
--cc=ian.jackson@eu.citrix.com \
--cc=oleksandr_grytsov@epam.com \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).