lxc_log_define(lxc_container, lxc);
-static bool file_exists(char *f)
+static bool file_exists(const char *f)
{
struct stat statbuf;
goto out;
}
-static char** lxcapi_get_ips(struct lxc_container *c, char* interface, char* family, int scope)
+static char** lxcapi_get_ips(struct lxc_container *c, const char* interface, const char* family, int scope)
{
int i, count = 0;
struct ifaddrs *interfaceArray = NULL, *tempIfAddr = NULL;
return LXC_VERSION;
}
-static int copy_file(char *old, char *new)
+static int copy_file(const char *old, const char *new)
{
int in, out;
ssize_t len, ret;
}
}
-static int lxcapi_snapshot(struct lxc_container *c, char *commentfile)
+static int lxcapi_snapshot(struct lxc_container *c, const char *commentfile)
{
int i, flags, ret;
struct lxc_container *c2;
return -1;
}
-static bool lxcapi_snapshot_restore(struct lxc_container *c, char *snapname, char *newname)
+static bool lxcapi_snapshot_restore(struct lxc_container *c, const char *snapname, const char *newname)
{
char clonelxcpath[MAXPATHLEN];
int ret;
return b;
}
-static bool lxcapi_snapshot_destroy(struct lxc_container *c, char *snapname)
+static bool lxcapi_snapshot_destroy(struct lxc_container *c, const char *snapname)
{
int ret;
char clonelxcpath[MAXPATHLEN];
return lxc_try_cmd(c->name, c->config_path) == 0;
}
-static bool add_remove_device_node(struct lxc_container *c, char *src_path, char *dest_path, bool add)
+static bool add_remove_device_node(struct lxc_container *c, const char *src_path, const char *dest_path, bool add)
{
int ret;
struct stat st;
char path[MAXPATHLEN];
char value[MAX_BUFFER];
- char *directory_path = NULL, *p;
+ char *directory_path = NULL;
+ const char *p;
/* make sure container is running */
if (!c->is_running(c)) {
return false;
}
-static bool lxcapi_add_device_node(struct lxc_container *c, char *src_path, char *dest_path)
+static bool lxcapi_add_device_node(struct lxc_container *c, const char *src_path, const char *dest_path)
{
return add_remove_device_node(c, src_path, dest_path, true);
}
-static bool lxcapi_remove_device_node(struct lxc_container *c, char *src_path, char *dest_path)
+static bool lxcapi_remove_device_node(struct lxc_container *c, const char *src_path, const char *dest_path)
{
return add_remove_device_node(c, src_path, dest_path, false);
}
* \note The returned array is allocated, so the caller must free it.
* \note The returned array is terminated with a \c NULL entry.
*/
- char** (*get_ips)(struct lxc_container *c, char* interface, char* family, int scope);
+ char** (*get_ips)(struct lxc_container *c, const char* interface, const char* family, int scope);
/*!
* \brief Retrieve the specified cgroup subsystem value for the container.
*
* \note \p commentfile may be \c NULL but this is discouraged.
*/
- int (*snapshot)(struct lxc_container *c, char *commentfile);
+ int (*snapshot)(struct lxc_container *c, const char *commentfile);
/*!
* \brief Obtain a list of container snapshots.
* (representing \c /var/lib/lxcsnaps/c1/snap0). If \p newname is \p c2,
* then \c snap0 will be copied to \c /var/lib/lxc/c2.
*/
- bool (*snapshot_restore)(struct lxc_container *c, char *snapname, char *newname);
+ bool (*snapshot_restore)(struct lxc_container *c, const char *snapname, const char *newname);
/*!
* \brief Destroy the specified snapshot.
*
* \return \c true on success, else \c false.
*/
- bool (*snapshot_destroy)(struct lxc_container *c, char *snapname);
+ bool (*snapshot_destroy)(struct lxc_container *c, const char *snapname);
/*!
* \brief Determine if the caller may control the container.
*
* \return \c true on success, else \c false.
*/
- bool (*add_device_node)(struct lxc_container *c, char *src_path, char *dest_path);
+ bool (*add_device_node)(struct lxc_container *c, const char *src_path, const char *dest_path);
/*!
* \brief Remove specified device from the container.
*
* \return \c true on success, else \c false.
*/
- bool (*remove_device_node)(struct lxc_container *c, char *src_path, char *dest_path);
+ bool (*remove_device_node)(struct lxc_container *c, const char *src_path, const char *dest_path);
};
/*!