summaryrefslogtreecommitdiff
blob: edb958b16b15d616e19f99f79e9b0ec46cc42b9c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
From: Igor Sukhih <igor@openvz.org>
Date: Tue, 22 Aug 2006 13:40:41 +0000 (+0400)
Subject: Remove VE name information on destroy
X-Git-Url: http://git.openvz.org/?p=vzctl;a=commitdiff;h=57f3c25ff637984a467936aec2cab1d849bfde49

Remove VE name information on destroy

http://bugzilla.openvz.org/show_bug.cgi?id=236
---

Index: vzctl-3.0.11/src/vzctl-actions.c
===================================================================
--- vzctl-3.0.11.orig/src/vzctl-actions.c
+++ vzctl-3.0.11/src/vzctl-actions.c
@@ -222,7 +222,19 @@ static int create(vps_handler *h, envid_
 static int destroy(vps_handler *h, envid_t veid, vps_param *g_p,
 	vps_param *cmd_p)
 {
-	return vps_destroy(h, veid, &g_p->res.fs);
+	int ret, id;
+	char buf[STR_SIZE];
+	char *name = g_p->res.name.name;
+
+	ret = vps_destroy(h, veid, &g_p->res.fs);
+	if (!ret && name != NULL) {
+		id = get_veid_by_name(name);
+		if (id == veid) {
+			snprintf(buf, sizeof(buf), VENAME_DIR "/%s.conf", name);
+			unlink(buf);
+		}
+	}
+	return ret;
 }
 
 static int parse_chkpnt_opt(int argc, char **argv, vps_param *vps_p)