Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

src/lib/config.c: declare some functions as static

Also, remove one unused function. It was meant to implement
the 'vzctl unset' functionality, but we will do it in a different way.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
  • Loading branch information...
commit 1a89e73a4e9bbc18b1b9b06dd2138d9f27e0d8e8 1 parent 09dc749
@kolyshkin kolyshkin authored
Showing with 11 additions and 38 deletions.
  1. +0 −3  include/config.h
  2. +11 −35 src/lib/config.c
View
3  include/config.h
@@ -44,9 +44,6 @@ int check_ub(ub_param *ub);
int merge_vps_param(vps_param *dst, vps_param *src);
int merge_global_param(vps_param *dst, vps_param *src);
void free_vps_param(vps_param *param);
-const vps_config *conf_get_by_name(const vps_config *conf, const char *name);
-const vps_config *conf_get_by_id(const vps_config *conf, int id);
-int opt_get_by_id(struct option *opt, int id);
int get_veid_by_name(const char *name);
int set_name(int veid, char *new_name, char *old_name);
#endif
View
46 src/lib/config.c
@@ -144,7 +144,8 @@ static vps_config config[] = {
{NULL, NULL, -1}
};
-const vps_config *conf_get_by_name(const vps_config *conf, const char *name)
+static const vps_config *conf_get_by_name(const vps_config *conf,
+ const char *name)
{
const vps_config *p;
@@ -160,7 +161,7 @@ const vps_config *conf_get_by_name(const vps_config *conf, const char *name)
return NULL;
}
-const vps_config *conf_get_by_id(const vps_config *conf, int id)
+static const vps_config *conf_get_by_id(const vps_config *conf, int id)
{
const vps_config *p;
@@ -172,7 +173,7 @@ const vps_config *conf_get_by_id(const vps_config *conf, int id)
return NULL;
}
-int opt_get_by_id(struct option *opt, int id)
+static int opt_get_by_id(struct option *opt, int id)
{
struct option *p;
@@ -387,7 +388,7 @@ static void store_features(unsigned long long mask, unsigned long long known,
add_str_param(conf_h, buf);
}
-int parse_ioprio(int id, io_param *io, char *val)
+static int parse_ioprio(int id, io_param *io, char *val)
{
if (parse_int(val, &io->ioprio))
return ERR_INVAL;
@@ -554,7 +555,7 @@ static int parse_twoul_sfx(const char *str, unsigned long *val, int divisor)
}
/******************** totalmem *************************/
-int parse_meminfo(meminfo_param *param, const char *val)
+static int parse_meminfo(meminfo_param *param, const char *val)
{
int mode;
char mode_nm[32];
@@ -603,7 +604,7 @@ static int store_meminfo(vps_param *old_p, vps_param *vps_p, vps_config *conf,
return 0;
}
-int parse_ub(vps_param *vps_p, const char *val, int id, int divisor)
+static int parse_ub(vps_param *vps_p, const char *val, int id, int divisor)
{
int ret;
ub_res res;
@@ -722,7 +723,7 @@ static int store_cap(vps_param *old_p, vps_param *vps_p, vps_config *conf,
}
/********************** Network ************************/
-int check_ip_dot(char *ip)
+static int check_ip_dot(char *ip)
{
int i;
char *str = ip;
@@ -818,7 +819,7 @@ static int check_netdev(const char *devname)
return 0;
}
-int add_netdev(net_param *net, char *val)
+static int add_netdev(net_param *net, char *val)
{
char *token;
@@ -1353,7 +1354,8 @@ static int parse_mac_filter_cmd (veth_dev *dev, char *str)
return 0;
}
-void generate_veth_name(int veid, char *dev_name_ve, char *dev_name, int len)
+static void generate_veth_name(int veid, char *dev_name_ve,
+ char *dev_name, int len)
{
char *name;
int id = 0;
@@ -2302,32 +2304,6 @@ int vps_save_config(envid_t veid, char *path, vps_param *new_p,
return ret;
}
-int vps_remove_cfg_param(envid_t veid, char *path, char *name)
-{
- list_head_t conf;
- conf_struct *line;
- int ret, found;
-
- list_head_init(&conf);
- if ((ret = read_conf(path, &conf)))
- return ret;
- if (list_empty(&conf))
- return 0;
- found = 0;
- while ((line = find_conf_line(&conf, name, '=')) != NULL) {
- free(line->val);
- list_del(&line->list);
- free(line);
- found++;
- }
- if (found)
- ret = write_conf(path, &conf);
- free_str_param(&conf);
-
- return ret;
-
-}
-
/********************************************************************/
int vps_parse_opt(envid_t veid, struct option *opts, vps_param *param,
int opt, char *rval, struct mod_action *action)
Please sign in to comment.
Something went wrong with that request. Please try again.