[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 1/3] libxl: Constify libxl_device_*_compare functions



Signed-off-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
---
 tools/libxl/libxl_disk.c     | 4 ++--
 tools/libxl/libxl_internal.h | 2 +-
 tools/libxl/libxl_nic.c      | 4 ++--
 tools/libxl/libxl_pci.c      | 4 ++--
 tools/libxl/libxl_usb.c      | 8 ++++----
 tools/libxl/libxl_vdispl.c   | 4 ++--
 tools/libxl/libxl_vsnd.c     | 4 ++--
 tools/libxl/libxl_vtpm.c     | 4 ++--
 8 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/tools/libxl/libxl_disk.c b/tools/libxl/libxl_disk.c
index e9eceb65e3..79e30f8d52 100644
--- a/tools/libxl/libxl_disk.c
+++ b/tools/libxl/libxl_disk.c
@@ -1126,8 +1126,8 @@ LIBXL_DEFINE_DEVICE_ADD(disk)
 LIBXL_DEFINE_DEVICES_ADD(disk)
 LIBXL_DEFINE_DEVICE_REMOVE(disk)
 
-static int libxl_device_disk_compare(libxl_device_disk *d1,
-                                     libxl_device_disk *d2)
+static int libxl_device_disk_compare(const libxl_device_disk *d1,
+                                     const libxl_device_disk *d2)
 {
     return COMPARE_DISK(d1, d2);
 }
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index 459f9bffa8..c75c98156a 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -3728,7 +3728,7 @@ typedef int (*device_to_device_fn_t)(libxl__gc *, 
uint32_t, void *,
 typedef void (*device_init_fn_t)(void *);
 typedef void (*device_copy_fn_t)(libxl_ctx *, void *, void *);
 typedef void (*device_dispose_fn_t)(void *);
-typedef int (*device_compare_fn_t)(void *, void *);
+typedef int (*device_compare_fn_t)(const void *, const void *);
 typedef void (*device_merge_fn_t)(libxl_ctx *, void *, void *);
 typedef int (*device_dm_needed_fn_t)(void *, unsigned);
 typedef void (*device_update_config_fn_t)(libxl__gc *, void *, void *);
diff --git a/tools/libxl/libxl_nic.c b/tools/libxl/libxl_nic.c
index 01b711b84e..f2b5e02285 100644
--- a/tools/libxl/libxl_nic.c
+++ b/tools/libxl/libxl_nic.c
@@ -454,8 +454,8 @@ const char *libxl__device_nic_devname(libxl__gc *gc,
     }
 }
 
-static int libxl_device_nic_compare(libxl_device_nic *d1,
-                                    libxl_device_nic *d2)
+static int libxl_device_nic_compare(const libxl_device_nic *d1,
+                                    const libxl_device_nic *d2)
 {
     return COMPARE_DEVID(d1, d2);
 }
diff --git a/tools/libxl/libxl_pci.c b/tools/libxl/libxl_pci.c
index 87afa03d9e..4ec6872798 100644
--- a/tools/libxl/libxl_pci.c
+++ b/tools/libxl/libxl_pci.c
@@ -1679,8 +1679,8 @@ int libxl__grant_vga_iomem_permission(libxl__gc *gc, 
const uint32_t domid,
     return 0;
 }
 
-static int libxl_device_pci_compare(libxl_device_pci *d1,
-                                    libxl_device_pci *d2)
+static int libxl_device_pci_compare(const libxl_device_pci *d1,
+                                    const libxl_device_pci *d2)
 {
     return COMPARE_PCI(d1, d2);
 }
diff --git a/tools/libxl/libxl_usb.c b/tools/libxl/libxl_usb.c
index 67d2fb4e37..adb122ac85 100644
--- a/tools/libxl/libxl_usb.c
+++ b/tools/libxl/libxl_usb.c
@@ -1925,8 +1925,8 @@ int libxl_ctrlport_to_device_usbdev(libxl_ctx *ctx,
     return rc;
 }
 
-static int libxl_device_usbctrl_compare(libxl_device_usbctrl *d1,
-                                        libxl_device_usbctrl *d2)
+static int libxl_device_usbctrl_compare(const libxl_device_usbctrl *d1,
+                                        const libxl_device_usbctrl *d2)
 {
     return COMPARE_USBCTRL(d1, d2);
 }
@@ -1939,8 +1939,8 @@ static int libxl_device_usbctrl_dm_needed(void *e, 
unsigned domid)
            elem->backend_domid == domid;
 }
 
-static int libxl_device_usbdev_compare(libxl_device_usbdev *d1,
-                                       libxl_device_usbdev *d2)
+static int libxl_device_usbdev_compare(const libxl_device_usbdev *d1,
+                                       const libxl_device_usbdev *d2)
 {
     return COMPARE_USB(d1, d2);
 }
diff --git a/tools/libxl/libxl_vdispl.c b/tools/libxl/libxl_vdispl.c
index 351f6beccb..c9cc455176 100644
--- a/tools/libxl/libxl_vdispl.c
+++ b/tools/libxl/libxl_vdispl.c
@@ -48,8 +48,8 @@ static void libxl__update_config_vdispl(libxl__gc *gc,
     dst->be_alloc = src->be_alloc;
 }
 
-static int libxl_device_vdispl_compare(libxl_device_vdispl *d1,
-                                       libxl_device_vdispl *d2)
+static int libxl_device_vdispl_compare(const libxl_device_vdispl *d1,
+                                       const libxl_device_vdispl *d2)
 {
     return COMPARE_DEVID(d1, d2);
 }
diff --git a/tools/libxl/libxl_vsnd.c b/tools/libxl/libxl_vsnd.c
index 9570a4cf0e..1151cbc567 100644
--- a/tools/libxl/libxl_vsnd.c
+++ b/tools/libxl/libxl_vsnd.c
@@ -290,8 +290,8 @@ static void libxl__update_config_vsnd(libxl__gc *gc,
     dst->devid = src->devid;
 }
 
-static int libxl_device_vsnd_compare(libxl_device_vsnd *d1,
-                                     libxl_device_vsnd *d2)
+static int libxl_device_vsnd_compare(const libxl_device_vsnd *d1,
+                                     const libxl_device_vsnd *d2)
 {
     return COMPARE_DEVID(d1, d2);
 }
diff --git a/tools/libxl/libxl_vtpm.c b/tools/libxl/libxl_vtpm.c
index 7c91f99673..f750395f6f 100644
--- a/tools/libxl/libxl_vtpm.c
+++ b/tools/libxl/libxl_vtpm.c
@@ -183,8 +183,8 @@ int libxl_devid_to_device_vtpm(libxl_ctx *ctx,
     return rc;
 }
 
-static int libxl_device_vtpm_compare(libxl_device_vtpm *d1,
-                                     libxl_device_vtpm *d2)
+static int libxl_device_vtpm_compare(const libxl_device_vtpm *d1,
+                                     const libxl_device_vtpm *d2)
 {
     return COMPARE_DEVID(d1, d2);
 }
-- 
Anthony PERARD


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.