]> git.proxmox.com Git - vzctl.git/blob - debian/patches/no-backup-on-destroy.diff
update to vzctl-3.0.30.2
[vzctl.git] / debian / patches / no-backup-on-destroy.diff
1 Index: new/src/lib/destroy.c
2 ===================================================================
3 --- new.orig/src/lib/destroy.c 2012-02-10 06:33:24.000000000 +0100
4 +++ new/src/lib/destroy.c 2012-02-10 06:42:00.000000000 +0100
5 @@ -307,7 +307,7 @@
6 logger(0, 0, "Destroying container private area: %s", fs->private);
7 if ((ret = vps_destroy_dir(veid, fs->private)))
8 return ret;
9 - move_config(veid, BACKUP);
10 + move_config(veid, DESTR_ALL);
11 if (destroy_dumpfile(veid, cpt != NULL ? cpt->dumpdir : NULL) < 0)
12 logger(-1, errno, "Warning: failed to remove dump file");
13 if (rmdir(fs->root) < 0)
14 Index: new/include/util.h
15 ===================================================================
16 --- new.orig/include/util.h 2012-02-10 06:33:24.000000000 +0100
17 +++ new/include/util.h 2012-02-10 06:40:25.000000000 +0100
18 @@ -25,6 +25,7 @@
19
20 #define BACKUP 0
21 #define DESTR 1
22 +#define DESTR_ALL 2
23
24 #define PROCMEM "/proc/meminfo"
25 #define PROCTHR "/proc/sys/kernel/threads-max"
26 Index: new/src/lib/util.c
27 ===================================================================
28 --- new.orig/src/lib/util.c 2012-02-10 06:33:24.000000000 +0100
29 +++ new/src/lib/util.c 2012-02-10 06:40:25.000000000 +0100
30 @@ -558,7 +558,14 @@
31
32 snprintf(conf, sizeof(conf), VPS_CONF_DIR "%d.%s", veid, prefix);
33 snprintf(newconf, sizeof(newconf), "%s." DESTR_PREFIX, conf);
34 - action == BACKUP ? rename(conf, newconf) : unlink(newconf);
35 + if (action == BACKUP) {
36 + rename(conf, newconf);
37 + } else if (action == DESTR_ALL) {
38 + unlink(conf);
39 + unlink(newconf);
40 + } else if (action == DESTR) {
41 + unlink(newconf);
42 + }
43 }
44
45 /* Renames or removes CT config and various CT scripts.