[pve-devel] [PATCH] update vzctl to 4.5
Kamil Trzcinski
ayufan at ayufan.eu
Wed Aug 28 17:33:23 CEST 2013
Signed-off-by: Kamil Trzcinski <ayufan at ayufan.eu>
---
Makefile | 4 +--
debian/patches/allow-abs-ostemplate-path.diff | 4 +--
debian/patches/fix-config-path.diff | 39 -------------------------
debian/patches/fix-default-template.diff | 15 +++++-----
debian/patches/fix-init.d-depends.diff | 17 ++++-------
debian/patches/no-backup-on-destroy.diff | 4 +--
6 files changed, 19 insertions(+), 64 deletions(-)
diff --git a/Makefile b/Makefile
index eb3799f..caae952 100644
--- a/Makefile
+++ b/Makefile
@@ -1,13 +1,13 @@
RELEASE=3.0
-SVER=4.0
+SVER=4.5
PACKAGERELEASE=1pve3
ARCH=amd64
PACKAGE=vzctl
DEB=${PACKAGE}_${SVER}-${PACKAGERELEASE}_${ARCH}.deb
-VZCTL_BRANCH=master # vzctl-4.0 does not exist
+VZCTL_BRANCH=vzctl-${SVER}
all: ${DEB}
diff --git a/debian/patches/allow-abs-ostemplate-path.diff b/debian/patches/allow-abs-ostemplate-path.diff
index 2d81189..907acc7 100644
--- a/debian/patches/allow-abs-ostemplate-path.diff
+++ b/debian/patches/allow-abs-ostemplate-path.diff
@@ -3,14 +3,14 @@ Index: new/src/lib/create.c
--- new.orig/src/lib/create.c 2012-09-28 09:05:45.000000000 +0200
+++ new/src/lib/create.c 2012-09-28 09:57:03.000000000 +0200
@@ -113,19 +113,25 @@
- if (ploop && check_ploop_size(dq->diskspace[1]) < 0)
return VZ_DISKSPACE_NOT_SET;
+ }
find:
- for (i = 0; ext[i] != NULL; i++) {
- snprintf(tarball, sizeof(tarball), "%s/cache/%s.tar%s",
- fs->tmpl, tmpl->ostmpl, ext[i]);
- logger(1, 0, "Looking for %s", tarball);
-- if (stat_file(tarball))
+- if (stat_file(tarball) == 1)
- break;
- }
- if (ext[i] == NULL) {
diff --git a/debian/patches/fix-config-path.diff b/debian/patches/fix-config-path.diff
index 8a17ad9..21d5106 100644
--- a/debian/patches/fix-config-path.diff
+++ b/debian/patches/fix-config-path.diff
@@ -1,16 +1,3 @@
-Index: new/include/types.h
-===================================================================
---- new.orig/include/types.h 2012-09-28 09:05:45.000000000 +0200
-+++ new/include/types.h 2012-09-28 09:41:31.000000000 +0200
-@@ -21,7 +21,7 @@
- #define VZ_DIR PKGCONFDIR "/"
- #define GLOBAL_CFG VZ_DIR "vz.conf"
- #define OSRELEASE_CFG VZ_DIR "osrelease.conf"
--#define VPS_CONF_DIR VZ_DIR "conf/"
-+#define VPS_CONF_DIR "/etc/pve/openvz/"
- #define DIST_DIR VZ_DIR "dists"
- #define VENAME_DIR VZ_DIR "names"
-
Index: new/paths.am
===================================================================
--- new.orig/paths.am 2012-09-28 09:38:39.000000000 +0200
@@ -24,29 +11,3 @@ Index: new/paths.am
distconfdir = $(pkgconfdir)/dists
namesdir = $(pkgconfdir)/names
-Index: new/bin/vznetaddbr.in
-===================================================================
---- new.orig/bin/vznetaddbr.in 2012-09-28 09:05:45.000000000 +0200
-+++ new/bin/vznetaddbr.in 2012-09-28 09:39:27.000000000 +0200
-@@ -2,7 +2,7 @@
- #
- # Add virtual network interfaces (veth's) in a container to a bridge on CT0
-
--CONFIGFILE=@PKGCONFDIR@/conf/$VEID.conf
-+CONFIGFILE=@VPSCONFDIR@/$VEID.conf
- . $CONFIGFILE
-
- NETIFLIST=$(printf %s "$NETIF" |tr ';' '\n')
-Index: new/etc/init.d/vz-redhat.in
-===================================================================
---- new.orig/etc/init.d/vz-redhat.in 2012-09-28 09:05:45.000000000 +0200
-+++ new/etc/init.d/vz-redhat.in 2012-09-28 09:39:27.000000000 +0200
-@@ -41,7 +41,7 @@
- . @SCRIPTDIR@/initd-functions
-
- VZQUOTA=@SBINDIR@/vzquota
--CONFIG_DIR=@PKGCONFDIR@/conf
-+CONFIG_DIR=@VPSCONFDIR@
- LOCKFILE=$VARLOCK/vz_lock
- SUBSYS_VZ=$VARLOCK/vz
- VESTAT=/proc/vz/vestat
diff --git a/debian/patches/fix-default-template.diff b/debian/patches/fix-default-template.diff
index 2e1e0f9..0835ded 100644
--- a/debian/patches/fix-default-template.diff
+++ b/debian/patches/fix-default-template.diff
@@ -1,14 +1,13 @@
Index: new/etc/vz.conf
===================================================================
---- new.orig/etc/vz.conf 2012-09-28 09:05:45.000000000 +0200
-+++ new/etc/vz.conf 2012-09-28 09:38:27.000000000 +0200
-@@ -33,8 +33,7 @@
+--- new.orig/etc/vz.conf.in 2012-09-28 09:05:45.000000000 +0200
++++ new/etc/vz.conf.in 2012-09-28 09:38:27.000000000 +0200
+@@ -36,8 +36,6 @@
## Defaults for containers
- VE_ROOT=/vz/root/$VEID
- VE_PRIVATE=/vz/private/$VEID
+ VE_ROOT=@VZDIR@/root/$VEID
+ VE_PRIVATE=@VZDIR@/private/$VEID
-CONFIGFILE="basic" # Use vswap-256m on RHEL6 kernel
--DEF_OSTEMPLATE="centos-5"
-+
+-DEF_OSTEMPLATE="centos-6-x86"
+ NAMESERVER=inherit # Copy from host system's /etc/resolv.conf
## Filesystem layout for new CTs: either simfs (default) or ploop
#VE_LAYOUT=ploop
-
diff --git a/debian/patches/fix-init.d-depends.diff b/debian/patches/fix-init.d-depends.diff
index 477ab0a..c8b98ab 100644
--- a/debian/patches/fix-init.d-depends.diff
+++ b/debian/patches/fix-init.d-depends.diff
@@ -20,23 +20,18 @@ Index: new/etc/init.d/vz-redhat.in
+PVECTL=/usr/bin/pvectl
VZQUOTA=@SBINDIR@/vzquota
CONFIG_DIR=@VPSCONFDIR@
- LOCKFILE=$VARLOCK/vz_lock
-@@ -290,10 +291,17 @@
- local msg
- local need_restart
-
-+ sysctl -q -w net.ipv4.route.src_check=0
+ VZREBOOTDIR=@VZREBOOTDIR@
+@@ -303,7 +304,12 @@
+ awk '$2 == "yes" {print $1}')
+ # Then sort by bootorder
+ test -n "$velist" && velist=$(vzlist -aH -octid -s-bootorder $velist)
+- sysctl -q -w net.ipv4.route.src_check=0
+
+ if [ -x ${PVECTL} ]; then
+ # pve-manager should start the containers
+ return;
+ fi
+
- need_restart=""
- velist=$(vzlist -aH -octid,onboot -s-bootorder |
- awk '$2 == "yes" {print $1}')
-- sysctl -q -w net.ipv4.route.src_check=0
-+
for veid in $velist; do
[ "${veid}" = "0" ] && continue
__echo "Starting CT ${veid}: "
diff --git a/debian/patches/no-backup-on-destroy.diff b/debian/patches/no-backup-on-destroy.diff
index b129cbb..63eb87a 100644
--- a/debian/patches/no-backup-on-destroy.diff
+++ b/debian/patches/no-backup-on-destroy.diff
@@ -3,12 +3,12 @@ Index: new/src/lib/destroy.c
--- new.orig/src/lib/destroy.c 2012-09-28 09:05:45.000000000 +0200
+++ new/src/lib/destroy.c 2012-09-28 09:41:49.000000000 +0200
@@ -271,7 +271,7 @@
- logger(0, 0, "Destroying container private area: %s", fs->private);
+ }
if ((ret = vps_destroy_dir(veid, fs->private)))
return ret;
- move_config(veid, BACKUP);
+ move_config(veid, DESTR_ALL);
- if (destroy_dumpfile(veid, cpt != NULL ? cpt->dumpdir : NULL) < 0)
+ if (destroy_dump(veid, cpt != NULL ? cpt->dumpdir : NULL) < 0)
logger(-1, errno, "Warning: failed to remove dump file");
if (rmdir(fs->root) < 0)
Index: new/include/util.h
--
1.7.10.4
More information about the pve-devel
mailing list