tools/libxc: misc: Mark const the parameter 'params' of xc_set_parameters()
authorJulien Grall <jgrall@amazon.com>
Mon, 30 Mar 2020 19:21:53 +0000 (20:21 +0100)
committerJulien Grall <jgrall@amazon.com>
Wed, 1 Apr 2020 09:57:07 +0000 (10:57 +0100)
The parameter 'params' of xc_set_parameters() should never be modified.
So mark it as const.

Signed-off-by: Julien Grall <jgrall@amazon.com>
Reviewed-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/libxc/include/xenctrl.h
tools/libxc/xc_misc.c

index d8874eb846350f442c44731892bc681319820835..58fa931de14d64f6f1352b1b1b3d662c8d2331b1 100644 (file)
@@ -1226,7 +1226,7 @@ int xc_readconsolering(xc_interface *xch,
                        int clear, int incremental, uint32_t *pindex);
 
 int xc_send_debug_keys(xc_interface *xch, const char *keys);
-int xc_set_parameters(xc_interface *xch, char *params);
+int xc_set_parameters(xc_interface *xch, const char *params);
 
 typedef struct xen_sysctl_physinfo xc_physinfo_t;
 typedef struct xen_sysctl_cputopo xc_cputopo_t;
index 957c03415ccf22f72bcd0d729d05eccf57326289..fe477bf344fbe4552c596ec651feea8f982fa93e 100644 (file)
@@ -187,11 +187,11 @@ int xc_send_debug_keys(xc_interface *xch, const char *keys)
     return ret;
 }
 
-int xc_set_parameters(xc_interface *xch, char *params)
+int xc_set_parameters(xc_interface *xch, const char *params)
 {
     int ret, len = strlen(params);
     DECLARE_SYSCTL;
-    DECLARE_HYPERCALL_BOUNCE(params, len, XC_HYPERCALL_BUFFER_BOUNCE_IN);
+    DECLARE_HYPERCALL_BOUNCE_IN(params, len);
 
     if ( xc_hypercall_bounce_pre(xch, params) )
         return -1;