Skip to content

Commit

Permalink
Fix constness when taking an array of string pointers
Browse files Browse the repository at this point in the history
i.e. change `char *const *` to `const char *const *`
  • Loading branch information
teohhanhui committed Apr 27, 2024
1 parent 5e37668 commit c29c48d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions include/libkrun.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ int32_t krun_set_data_disk(uint32_t ctx_id, const char *disk_path);
* Returns:
* Zero on success or a negative error number on failure.
*/
int32_t krun_set_mapped_volumes(uint32_t ctx_id, char *const mapped_volumes[]);
int32_t krun_set_mapped_volumes(uint32_t ctx_id, const char *const mapped_volumes[]);

/*
* Adds an independent virtio-fs device pointing to a host's directory with a tag.
Expand Down Expand Up @@ -192,7 +192,7 @@ int32_t krun_set_net_mac(uint32_t ctx_id, uint8_t *const c_mac);
* If past networking mode is used (krun_set_passt_fd was called), port mapping is not supported
* as an API of libkrun (but you can still do port mapping using command line arguments of passt)
*/
int32_t krun_set_port_map(uint32_t ctx_id, char *const port_map[]);
int32_t krun_set_port_map(uint32_t ctx_id, const char *const port_map[]);

/* Flags for virglrenderer. Copied from virglrenderer bindings. */
#define VIRGLRENDERER_USE_EGL 1 << 0
Expand Down Expand Up @@ -228,7 +228,7 @@ int32_t krun_set_gpu_options(uint32_t ctx_id, uint32_t virgl_flags);
* Returns:
* Zero on success or a negative error number on failure.
*/
int32_t krun_set_rlimits(uint32_t ctx_id, char *const rlimits[]);
int32_t krun_set_rlimits(uint32_t ctx_id, const char *const rlimits[]);

/*
* Sets the working directory for the executable to be run inside the microVM.
Expand Down Expand Up @@ -261,8 +261,8 @@ int32_t krun_set_workdir(uint32_t ctx_id,
*/
int32_t krun_set_exec(uint32_t ctx_id,
const char *exec_path,
char *const argv[],
char *const envp[]);
const char *const argv[],
const char *const envp[]);

/*
* Sets environment variables to be configured in the context of the executable.
Expand All @@ -276,7 +276,7 @@ int32_t krun_set_exec(uint32_t ctx_id,
* Returns:
* Zero on success or a negative error number on failure.
*/
int32_t krun_set_env(uint32_t ctx_id, char *const envp[]);
int32_t krun_set_env(uint32_t ctx_id, const char *const envp[]);

/*
* Sets the file path to the TEE configuration file. Only available in libkrun-sev.
Expand Down

0 comments on commit c29c48d

Please sign in to comment.