Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

src/lib/create.c, include/create.h: hide internal stuff

include/create.h:
Out of 4 functions listed, only one is used externally, other two are
internal and yet another one (vps_destroy) is actually from destroy.c!
Remove unneeded prototypes, move define to .c file.

src/lib/create.c:
Mark internal functions as static.

src/vzctl-actions.c:
Include destroy.h as it holds the vps_destroy() prototype.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
  • Loading branch information...
commit 1b40e9d652489ea87690b91c7eae6f666e91e0d3 1 parent 372162c
@kolyshkin kolyshkin authored
Showing with 7 additions and 9 deletions.
  1. +0 −6 include/create.h
  2. +6 −3 src/lib/create.c
  3. +1 −0  src/vzctl-actions.c
View
6 include/create.h
@@ -19,15 +19,9 @@
#define _CREATE_H_
#include "res.h"
-#define VPS_CREATE LIB_SCRIPTS_DIR "vps-create"
-
struct mod_action;
-int vps_postcreate(envid_t veid, fs_param *fs, tmpl_param *tmpl);
int vps_create(vps_handler *h, envid_t veid, vps_param *vps_p, vps_param *cmd_p,
struct mod_action *action);
-int vps_destroy(vps_handler *h, envid_t veid, fs_param *fs);
-int fs_create(envid_t veid, fs_param *fs, tmpl_param *tmpl, dq_param *dq,
- char *tar_nm);
#endif
View
9 src/lib/create.c
@@ -39,8 +39,11 @@
#include "create.h"
#include "destroy.h"
+#define VPS_CREATE LIB_SCRIPTS_DIR "vps-create"
#define VZOSTEMPLATE "/usr/bin/vzosname"
+static int vps_postcreate(envid_t veid, fs_param *fs, tmpl_param *tmpl);
+
static char *get_ostemplate_name(char *ostmpl)
{
FILE *fd;
@@ -66,8 +69,8 @@ static char *get_ostemplate_name(char *ostmpl)
return strdup(buf);
}
-int fs_create(envid_t veid, fs_param *fs, tmpl_param *tmpl, dq_param *dq,
- char *tar_nm)
+static int fs_create(envid_t veid, fs_param *fs, tmpl_param *tmpl,
+ dq_param *dq, char *tar_nm)
{
char tarball[PATH_LEN];
char tmp_dir[PATH_LEN];
@@ -339,7 +342,7 @@ int vps_create(vps_handler *h, envid_t veid, vps_param *vps_p, vps_param *cmd_p,
return ret;
}
-int vps_postcreate(envid_t veid, fs_param *fs, tmpl_param *tmpl)
+static int vps_postcreate(envid_t veid, fs_param *fs, tmpl_param *tmpl)
{
char buf[STR_SIZE];
dist_actions actions;
View
1  src/vzctl-actions.c
@@ -34,6 +34,7 @@
#include "config.h"
#include "vzerror.h"
#include "create.h"
+#include "destroy.h"
#include "util.h"
#include "lock.h"
#include "vps_configure.h"
Please sign in to comment.
Something went wrong with that request. Please try again.