From patchwork Fri Jun 14 11:24:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony PERARD X-Patchwork-Id: 10995097 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6136F1395 for ; Fri, 14 Jun 2019 11:27:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 516B62855C for ; Fri, 14 Jun 2019 11:27:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4610A285AF; Fri, 14 Jun 2019 11:27:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7911E28571 for ; Fri, 14 Jun 2019 11:26:59 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hbkKD-0007QN-89; Fri, 14 Jun 2019 11:24:53 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hbkKB-0007Q8-TU for xen-devel@lists.xenproject.org; Fri, 14 Jun 2019 11:24:51 +0000 X-Inumbo-ID: 0561f948-8e97-11e9-8864-4b151223ecb4 Received: from esa2.hc3370-68.iphmx.com (unknown [216.71.145.153]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 0561f948-8e97-11e9-8864-4b151223ecb4; Fri, 14 Jun 2019 11:24:49 +0000 (UTC) Authentication-Results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=anthony.perard@citrix.com; spf=Pass smtp.mailfrom=anthony.perard@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: None (esa2.hc3370-68.iphmx.com: no sender authenticity information available from domain of anthony.perard@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa2.hc3370-68.iphmx.com: domain of anthony.perard@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ~all" Received-SPF: None (esa2.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: 2VqaeuU4/Ekc5ZjEZBd9qZcZj4i2GQ25hHXftqJEVkGlqdnKU0r/F/Tugj6awM5KkW23Ht+g2Q c3dggZJRqKZ4FmpPBe+Mj9Gbbq4rSG24wVBLsIatFP3WQaUPMaBGJv+pxZlVlacij399aip8qG 1jDsLgks/E4D3Z+tgMnCIdE/KnMBPhNrTJIAY0GbOD2QEVTP4WBHAIglbUQssdrjbo9mNkkrwE enTTOICrfX88/ZMhLpYhlTRDcM+J1P/fbn+F1jPo07RpYNDfpni5cUhJDyZBOrts1ssxhgLKOJ 5gI= X-SBRS: 2.7 X-MesageID: 1737462 X-Ironport-Server: esa2.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.63,373,1557201600"; d="scan'208";a="1737462" From: Anthony PERARD To: Date: Fri, 14 Jun 2019 12:24:30 +0100 Message-ID: <20190614112444.29980-2-anthony.perard@citrix.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190614112444.29980-1-anthony.perard@citrix.com> References: <20190614112444.29980-1-anthony.perard@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH 01/15] libxl: Rename struct libxl_device_type to libxl__device_type X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Anthony PERARD , Ian Jackson , Wei Liu Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP libxl__device_type is internal to libxl, rename it to the internal only prefix. And eliminate redundant 'struct' keyword, in accord with the coding style. No functional changes. Signed-off-by: Anthony PERARD Acked-by: Ian Jackson --- tools/libxl/libxl_create.c | 4 +-- tools/libxl/libxl_device.c | 10 ++++---- tools/libxl/libxl_dm.c | 2 +- tools/libxl/libxl_domain.c | 2 +- tools/libxl/libxl_internal.c | 2 +- tools/libxl/libxl_internal.h | 49 ++++++++++++++++++------------------ 6 files changed, 35 insertions(+), 34 deletions(-) diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c index 03ce166f4f..9f56851be2 100644 --- a/tools/libxl/libxl_create.c +++ b/tools/libxl/libxl_create.c @@ -1522,7 +1522,7 @@ static void libxl__add_dtdevs(libxl__egc *egc, libxl__ao *ao, uint32_t domid, #define libxl__device_dtdev_update_devid NULL static DEFINE_DEVICE_TYPE_STRUCT(dtdev, NONE); -const struct libxl_device_type *device_type_tbl[] = { +const libxl__device_type *device_type_tbl[] = { &libxl__disk_devtype, &libxl__nic_devtype, &libxl__vtpm_devtype, @@ -1575,7 +1575,7 @@ static void domcreate_attach_devices(libxl__egc *egc, STATE_AO_GC(dcs->ao); int domid = dcs->guest_domid; libxl_domain_config *const d_config = dcs->guest_config; - const struct libxl_device_type *dt; + const libxl__device_type *dt; if (ret) { LOGD(ERROR, domid, "unable to add %s devices", diff --git a/tools/libxl/libxl_device.c b/tools/libxl/libxl_device.c index db6c0203b7..d385f19d85 100644 --- a/tools/libxl/libxl_device.c +++ b/tools/libxl/libxl_device.c @@ -1823,7 +1823,7 @@ int libxl_device_events_handler(libxl_ctx *ctx, } void device_add_domain_config(libxl__gc *gc, libxl_domain_config *d_config, - const struct libxl_device_type *dt, const void *dev) + const libxl__device_type *dt, const void *dev) { int *num_dev; unsigned int i; @@ -1853,7 +1853,7 @@ void device_add_domain_config(libxl__gc *gc, libxl_domain_config *d_config, } void libxl__device_add_async(libxl__egc *egc, uint32_t domid, - const struct libxl_device_type *dt, void *type, + const libxl__device_type *dt, void *type, libxl__ao_device *aodev) { STATE_AO_GC(aodev->ao); @@ -1968,7 +1968,7 @@ void libxl__device_add_async(libxl__egc *egc, uint32_t domid, } int libxl__device_add(libxl__gc *gc, uint32_t domid, - const struct libxl_device_type *dt, void *type) + const libxl__device_type *dt, void *type) { flexarray_t *back; flexarray_t *front, *ro_front; @@ -2017,7 +2017,7 @@ int libxl__device_add(libxl__gc *gc, uint32_t domid, return rc; } -void *libxl__device_list(libxl__gc *gc, const struct libxl_device_type *dt, +void *libxl__device_list(libxl__gc *gc, const libxl__device_type *dt, uint32_t domid, int *num) { void *r = NULL; @@ -2068,7 +2068,7 @@ void *libxl__device_list(libxl__gc *gc, const struct libxl_device_type *dt, return r; } -void libxl__device_list_free(const struct libxl_device_type *dt, +void libxl__device_list_free(const libxl__device_type *dt, void *list, int num) { int i; diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c index f4fc96415d..348c3fddf5 100644 --- a/tools/libxl/libxl_dm.c +++ b/tools/libxl/libxl_dm.c @@ -3168,7 +3168,7 @@ int libxl__need_xenpv_qemu(libxl__gc *gc, libxl_domain_config *d_config) { int idx, i, ret, num; uint32_t domid; - const struct libxl_device_type *dt; + const libxl__device_type *dt; ret = libxl__get_domid(gc, &domid); if (ret) { diff --git a/tools/libxl/libxl_domain.c b/tools/libxl/libxl_domain.c index 0ce1ba1327..aee621b0a5 100644 --- a/tools/libxl/libxl_domain.c +++ b/tools/libxl/libxl_domain.c @@ -1726,7 +1726,7 @@ int libxl_retrieve_domain_configuration(libxl_ctx *ctx, uint32_t domid, * retrieve from JSON. */ { - const struct libxl_device_type *dt; + const libxl__device_type *dt; int idx; for (idx = 0;; idx++) { diff --git a/tools/libxl/libxl_internal.c b/tools/libxl/libxl_internal.c index f492dae5ff..ce6eb7ab16 100644 --- a/tools/libxl/libxl_internal.c +++ b/tools/libxl/libxl_internal.c @@ -552,7 +552,7 @@ void libxl__update_domain_configuration(libxl__gc *gc, const libxl_domain_config *src) { int i, idx, num; - const struct libxl_device_type *dt; + const libxl__device_type *dt; for (idx = 0;; idx++) { dt = device_type_tbl[idx]; diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h index 3be5c644c1..a25bacd7aa 100644 --- a/tools/libxl/libxl_internal.h +++ b/tools/libxl/libxl_internal.h @@ -192,6 +192,7 @@ typedef struct libxl__ao libxl__ao; typedef struct libxl__aop_occurred libxl__aop_occurred; typedef struct libxl__osevent_hook_nexus libxl__osevent_hook_nexus; typedef struct libxl__osevent_hook_nexi libxl__osevent_hook_nexi; +typedef struct libxl__device_type libxl__device_type; typedef struct libxl__json_object libxl__json_object; typedef struct libxl__carefd libxl__carefd; @@ -3713,7 +3714,7 @@ typedef int (*device_set_xenstore_config_fn_t)(libxl__gc *, uint32_t, void *, flexarray_t *, flexarray_t *, flexarray_t *); -struct libxl_device_type { +struct libxl__device_type { libxl__device_kind type; int skip_attach; /* Skip entry in domcreate_attach_devices() if 1 */ int ptr_offset; /* Offset of device array ptr in libxl_domain_config */ @@ -3735,7 +3736,7 @@ struct libxl_device_type { }; #define DEFINE_DEVICE_TYPE_STRUCT_X(name, sname, kind, ...) \ - const struct libxl_device_type libxl__ ## name ## _devtype = { \ + const libxl__device_type libxl__ ## name ## _devtype = { \ .type = LIBXL__DEVICE_KIND_ ## kind, \ .ptr_offset = offsetof(libxl_domain_config, name ## s), \ .num_offset = offsetof(libxl_domain_config, num_ ## name ## s), \ @@ -3759,38 +3760,38 @@ struct libxl_device_type { DEFINE_DEVICE_TYPE_STRUCT_X(name, name, kind, __VA_ARGS__) static inline void **libxl__device_type_get_ptr( - const struct libxl_device_type *dt, const libxl_domain_config *d_config) + const libxl__device_type *dt, const libxl_domain_config *d_config) { return (void **)((void *)d_config + dt->ptr_offset); } static inline void *libxl__device_type_get_elem( - const struct libxl_device_type *dt, const libxl_domain_config *d_config, + const libxl__device_type *dt, const libxl_domain_config *d_config, int e) { return *libxl__device_type_get_ptr(dt, d_config) + dt->dev_elem_size * e; } static inline int *libxl__device_type_get_num( - const struct libxl_device_type *dt, const libxl_domain_config *d_config) + const libxl__device_type *dt, const libxl_domain_config *d_config) { return (int *)((void *)d_config + dt->num_offset); } -extern const struct libxl_device_type libxl__vfb_devtype; -extern const struct libxl_device_type libxl__vkb_devtype; -extern const struct libxl_device_type libxl__disk_devtype; -extern const struct libxl_device_type libxl__nic_devtype; -extern const struct libxl_device_type libxl__vtpm_devtype; -extern const struct libxl_device_type libxl__usbctrl_devtype; -extern const struct libxl_device_type libxl__usbdev_devtype; -extern const struct libxl_device_type libxl__pcidev_devtype; -extern const struct libxl_device_type libxl__vdispl_devtype; -extern const struct libxl_device_type libxl__p9_devtype; -extern const struct libxl_device_type libxl__pvcallsif_devtype; -extern const struct libxl_device_type libxl__vsnd_devtype; - -extern const struct libxl_device_type *device_type_tbl[]; +extern const libxl__device_type libxl__vfb_devtype; +extern const libxl__device_type libxl__vkb_devtype; +extern const libxl__device_type libxl__disk_devtype; +extern const libxl__device_type libxl__nic_devtype; +extern const libxl__device_type libxl__vtpm_devtype; +extern const libxl__device_type libxl__usbctrl_devtype; +extern const libxl__device_type libxl__usbdev_devtype; +extern const libxl__device_type libxl__pcidev_devtype; +extern const libxl__device_type libxl__vdispl_devtype; +extern const libxl__device_type libxl__p9_devtype; +extern const libxl__device_type libxl__pvcallsif_devtype; +extern const libxl__device_type libxl__vsnd_devtype; + +extern const libxl__device_type *device_type_tbl[]; /*----- Domain destruction -----*/ @@ -4568,21 +4569,21 @@ static inline bool libxl__acpi_defbool_val(const libxl_domain_build_info *b_info * (a copy of `dev' will be made) */ void device_add_domain_config(libxl__gc *gc, libxl_domain_config *d_config, - const struct libxl_device_type *dt, + const libxl__device_type *dt, const void *dev); void libxl__device_add_async(libxl__egc *egc, uint32_t domid, - const struct libxl_device_type *dt, void *type, + const libxl__device_type *dt, void *type, libxl__ao_device *aodev); int libxl__device_add(libxl__gc *gc, uint32_t domid, - const struct libxl_device_type *dt, void *type); + const libxl__device_type *dt, void *type); /* Caller is responsible for freeing the memory by calling * libxl__device_list_free */ -void* libxl__device_list(libxl__gc *gc, const struct libxl_device_type *dt, +void* libxl__device_list(libxl__gc *gc, const libxl__device_type *dt, uint32_t domid, int *num); -void libxl__device_list_free(const struct libxl_device_type *dt, +void libxl__device_list_free(const libxl__device_type *dt, void *list, int num); static inline bool libxl__timer_mode_is_default(libxl_timer_mode *tm)