]> xenbits.xensource.com Git - people/larsk/xen.git/commitdiff
libxl: Rename struct libxl_device_type to libxl__device_type
authorAnthony PERARD <anthony.perard@citrix.com>
Thu, 18 Apr 2019 16:26:09 +0000 (17:26 +0100)
committerIan Jackson <ian.jackson@eu.citrix.com>
Fri, 20 Sep 2019 09:41:01 +0000 (10:41 +0100)
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 <anthony.perard@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/libxl/libxl_create.c
tools/libxl/libxl_device.c
tools/libxl/libxl_dm.c
tools/libxl/libxl_domain.c
tools/libxl/libxl_internal.c
tools/libxl/libxl_internal.h

index 59dbcb50a086bca2b89ea05feca02a782acc6948..3f31f2ebcd1f23991d9e4390cd02befadb2176cd 100644 (file)
@@ -1536,7 +1536,7 @@ out:
 #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,
@@ -1589,7 +1589,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",
index a2569102ee096ff5f84b71653f4117b359a1cdd9..1941fe780ac095675f5c4e95cd7933748f99bf4c 100644 (file)
@@ -1823,7 +1823,7 @@ out:
 }
 
 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 @@ out:
 }
 
 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 @@ out:
     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;
@@ -2082,7 +2082,7 @@ out:
     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;
index 839c5ac2cde151ae51c05301af7675f1bc57e97f..9f60801d049705d4ec7b93dc82815ca9c58a981e 100644 (file)
@@ -3170,7 +3170,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) {
index 0ce1ba1327cd030ff261ea4dca6ba96634f89c16..aee621b0a5a7147814513b2953d159863dd73ecd 100644 (file)
@@ -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++) {
index a7a4d546c47accf30d41765cd136d02a0130f795..0750b69cba61bae1cbcabf62d5475309ca6ce59d 100644 (file)
@@ -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];
index 93bf65ee9af88c2198b2f1ad7cb7f84c2d48b5b7..b733d02b1ed5293e5a64c26ffb08b6e3aa6fdf76 100644 (file)
@@ -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;
 typedef struct libxl__ev_devlock libxl__ev_devlock;
@@ -3741,7 +3742,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 */
@@ -3764,7 +3765,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),     \
@@ -3788,38 +3789,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 -----*/
 
@@ -4603,21 +4604,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)