From mboxrd@z Thu Jan 1 00:00:00 1970 From: Oleksandr Grytsov Subject: Re: [PATCH 0/4] libxl: use libxl__device_kind string to access device Date: Tue, 24 Oct 2017 10:41:04 +0300 Message-ID: References: <1507195848-18346-1-git-send-email-al1img@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6538550618327872863==" Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e6tpk-0007jT-GX for xen-devel@lists.xenproject.org; Tue, 24 Oct 2017 07:41:08 +0000 Received: by mail-it0-f65.google.com with SMTP id p138so8885699itp.2 for ; Tue, 24 Oct 2017 00:41:06 -0700 (PDT) In-Reply-To: <1507195848-18346-1-git-send-email-al1img@gmail.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" To: Xen-devel Cc: Ian Jackson , Wei Liu , Oleksandr Grytsov List-Id: xen-devel@lists.xenproject.org --===============6538550618327872863== Content-Type: multipart/alternative; boundary="001a113f9f6cbe9c76055c460fd2" --001a113f9f6cbe9c76055c460fd2 Content-Type: text/plain; charset="UTF-8" On Thu, Oct 5, 2017 at 12:30 PM, Oleksandr Grytsov wrote: > From: Oleksandr Grytsov > > In current implementation the path of device XS entry is created with > string from libxl__device_kind enum. But access to the device entry > usually done with hardcoded path. This is source of potential errors. > This patchset changes hardcoded device name in the XS path to string > representation of libxl__device_kind enum. Also it changes "type" field > in libxl__..._devtype structure to keep libxl__device_kind. It allows > to move some duplicated functions to macros. > > Oleksandr Grytsov (4): > libxl: use libxl__device_kind to get device XS entry > libxl: use libxl__device_kind in LIBXL_DEFINE_UPDATE_DEVID > libxl: move libxl__device_from_ to LIBXL_DEFINE_DEVICE_FROM_TYPE > libxl: move ibxl_devid_to_device_... to LIBXL_DEFINE_DEVID_TO_DEVICE > > tools/libxl/libxl_9pfs.c | 21 +++--------- > tools/libxl/libxl_colo_nic.c | 6 ++-- > tools/libxl/libxl_console.c | 36 +++++++++----------- > tools/libxl/libxl_create.c | 4 +-- > tools/libxl/libxl_device.c | 10 +++--- > tools/libxl/libxl_disk.c | 28 +++++++++++----- > tools/libxl/libxl_domain.c | 2 +- > tools/libxl/libxl_internal.h | 77 ++++++++++++++++++++++++++++++ > ++++++------- > tools/libxl/libxl_netbuffer.c | 6 ++-- > tools/libxl/libxl_nic.c | 55 +++++++------------------------ > tools/libxl/libxl_pci.c | 21 ++++++++---- > tools/libxl/libxl_usb.c | 52 +++++++++++++++++++---------- > tools/libxl/libxl_vdispl.c | 62 ++++++---------------------------- > tools/libxl/libxl_vkb.c | 61 +++++----------------------------- > tools/libxl/libxl_vsnd.c | 62 ++++++---------------------------- > tools/libxl/libxl_vtpm.c | 33 +++++++------------ > 16 files changed, 222 insertions(+), 314 deletions(-) > > -- > 2.7.4 > > ping -- Best Regards, Oleksandr Grytsov. --001a113f9f6cbe9c76055c460fd2 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On T= hu, Oct 5, 2017 at 12:30 PM, Oleksandr Grytsov <al1img@gmail.com> wrote:
From: Oleksandr Grytsov <<= a href=3D"mailto:oleksandr_grytsov@epam.com">oleksandr_grytsov@epam.com= >

In current implementation the path of device XS entry is created with
string from libxl__device_kind enum. But access to the device entry
usually done with hardcoded path. This is source of potential errors.
This patchset changes hardcoded device name in the XS path to string
representation of libxl__device_kind enum. Also it changes "type"= field
in libxl__..._devtype structure to keep libxl__device_kind. It allows
to move some duplicated functions to macros.

Oleksandr Grytsov (4):
=C2=A0 libxl: use libxl__device_kind to get device XS entry
=C2=A0 libxl: use libxl__device_kind in LIBXL_DEFINE_UPDATE_DEVID
=C2=A0 libxl: move libxl__device_from_ to LIBXL_DEFINE_DEVICE_FROM_TYPE
=C2=A0 libxl: move ibxl_devid_to_device_... to LIBXL_DEFINE_DEVID_TO_DEVICE=

=C2=A0tools/libxl/libxl_9pfs.c=C2=A0 =C2=A0 =C2=A0 | 21 +++---------
=C2=A0tools/libxl/libxl_colo_nic.c=C2=A0 |=C2=A0 6 ++--
=C2=A0tools/libxl/libxl_console.c=C2=A0 =C2=A0| 36 +++++++++-----------
=C2=A0tools/libxl/libxl_create.c=C2=A0 =C2=A0 |=C2=A0 4 +--
=C2=A0tools/libxl/libxl_device.c=C2=A0 =C2=A0 | 10 +++---
=C2=A0tools/libxl/libxl_disk.c=C2=A0 =C2=A0 =C2=A0 | 28 +++++++++++----- =C2=A0tools/libxl/libxl_domain.c=C2=A0 =C2=A0 |=C2=A0 2 +-
=C2=A0tools/libxl/libxl_internal.h=C2=A0 | 77 +++++++++++++++++++++++++++++= +++++++-------
=C2=A0tools/libxl/libxl_netbuffer.c |=C2=A0 6 ++--
=C2=A0tools/libxl/libxl_nic.c=C2=A0 =C2=A0 =C2=A0 =C2=A0| 55 +++++++-------= -----------------
=C2=A0tools/libxl/libxl_pci.c=C2=A0 =C2=A0 =C2=A0 =C2=A0| 21 ++++++++---- =C2=A0tools/libxl/libxl_usb.c=C2=A0 =C2=A0 =C2=A0 =C2=A0| 52 ++++++++++++++= +++++----------
=C2=A0tools/libxl/libxl_vdispl.c=C2=A0 =C2=A0 | 62 ++++++------------------= ----------
=C2=A0tools/libxl/libxl_vkb.c=C2=A0 =C2=A0 =C2=A0 =C2=A0| 61 +++++---------= --------------------
=C2=A0tools/libxl/libxl_vsnd.c=C2=A0 =C2=A0 =C2=A0 | 62 ++++++-------------= ---------------
=C2=A0tools/libxl/libxl_vtpm.c=C2=A0 =C2=A0 =C2=A0 | 33 +++++++------------=
=C2=A016 files changed, 222 insertions(+), 314 deletions(-)

--
2.7.4


ping<= br clear=3D"all">

--
Best Regards,
Oleksa= ndr Grytsov.
--001a113f9f6cbe9c76055c460fd2-- --===============6538550618327872863== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRldmVs IG1haWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMueGVuLm9yZwpodHRwczovL2xpc3RzLnhlbi5v cmcveGVuLWRldmVsCg== --===============6538550618327872863==--