Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

src/lib/veth.c: declare a few functions as static

Pure cleanup, should have no visible effect.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
  • Loading branch information...
commit 09dc74974bbd3740f0e2f45c8541a239b221b620 1 parent a278e5b
@kolyshkin kolyshkin authored
Showing with 27 additions and 41 deletions.
  1. +0 −1  include/veth.h
  2. +27 −40 src/lib/veth.c
View
1  include/veth.h
@@ -67,7 +67,6 @@ int vps_setup_veth(vps_handler *h, envid_t veid, dist_actions *actions,
const char *root, veth_param *veth_add, veth_param *veth_del,
int state, int skip);
int add_veth_param(veth_param *list, veth_dev *dev);
-void free_veth(list_head_t *head);
void free_veth_param(veth_param *dev);
int copy_veth_param(veth_param *dst, veth_param *src);
int merge_veth_list(list_head_t *old, list_head_t *add, list_head_t *del,
View
67 src/lib/veth.c
@@ -110,6 +110,29 @@ static int veth_dev_remove(vps_handler *h, envid_t veid, veth_dev *dev)
return ret;
}
+void free_veth_dev(veth_dev *dev)
+{
+}
+
+static void free_veth(list_head_t *head)
+{
+ veth_dev *tmp, *dev_t;
+
+ if (list_empty(head))
+ return;
+ list_for_each_safe(dev_t, tmp, head, list) {
+ free_veth_dev(dev_t);
+ list_del(&dev_t->list);
+ free(dev_t);
+ }
+ list_head_init(head);
+}
+
+void free_veth_param(veth_param *dev)
+{
+ free_veth(&dev->dev);
+}
+
static int run_vznetcfg(envid_t veid, veth_dev *dev)
{
int ret;
@@ -257,43 +280,7 @@ int add_veth_param(veth_param *veth, veth_dev *dev)
return 0;
}
-veth_dev *find_veth(list_head_t *head, veth_dev *dev)
-{
- veth_dev *tmp;
-
- if (list_empty(head))
- return NULL;
- list_for_each(tmp, head, list) {
- if (!strcmp(tmp->dev_name, dev->dev_name))
- return dev;
- }
- return NULL;
-}
-
-void free_veth_dev(veth_dev *dev)
-{
-}
-
-void free_veth(list_head_t *head)
-{
- veth_dev *tmp, *dev_t;
-
- if (list_empty(head))
- return;
- list_for_each_safe(dev_t, tmp, head, list) {
- free_veth_dev(dev_t);
- list_del(&dev_t->list);
- free(dev_t);
- }
- list_head_init(head);
-}
-
-void free_veth_param(veth_param *dev)
-{
- free_veth(&dev->dev);
-}
-
-veth_dev *find_veth_by_ifname(list_head_t *head, char *name)
+static veth_dev *find_veth_by_ifname(list_head_t *head, char *name)
{
veth_dev *dev_t;
@@ -332,7 +319,7 @@ veth_dev *find_veth_configure(list_head_t *head)
return NULL;
}
-void fill_veth_dev(veth_dev *dst, veth_dev *src)
+static void fill_veth_dev(veth_dev *dst, veth_dev *src)
{
if (src->dev_name[0] != 0)
strcpy(dst->dev_name, src->dev_name);
@@ -353,7 +340,7 @@ void fill_veth_dev(veth_dev *dst, veth_dev *src)
}
}
-int merge_veth_dev(veth_dev *old, veth_dev *new, veth_dev *merged)
+static int merge_veth_dev(veth_dev *old, veth_dev *new, veth_dev *merged)
{
memset(merged, 0, sizeof(veth_dev));
@@ -421,7 +408,7 @@ int copy_veth_param(veth_param *dst, veth_param *src)
return 0;
}
-int read_proc_veth(envid_t veid, veth_param *veth)
+static int read_proc_veth(envid_t veid, veth_param *veth)
{
FILE *fp;
char buf[256];
Please sign in to comment.
Something went wrong with that request. Please try again.