[pve-devel] [PATCH 3/3] Updated patchset from 4.0 to 4.6.1

Adrian Almenar adrian at almenar.nl
Mon Feb 17 15:00:35 CET 2014


Signed-off-by: Adrian Almenar <adrian at almenar.nl>
---
 debian/patches/allow-abs-ostemplate-path.diff  |   20 +++++------
 debian/patches/always-create-dev-console.patch |   10 +++---
 debian/patches/fix-config-path.diff            |   45 ++----------------------
 debian/patches/fix-default-template.diff       |   17 ++++-----
 debian/patches/fix-init.d-depends.diff         |   18 +++++-----
 debian/patches/fix-vzevent-init.patch          |   10 +++---
 debian/patches/no-backup-on-destroy.diff       |   30 +++++++---------
 7 files changed, 48 insertions(+), 102 deletions(-)

diff --git a/debian/patches/allow-abs-ostemplate-path.diff b/debian/patches/allow-abs-ostemplate-path.diff
index 2d81189..4b18885 100644
--- a/debian/patches/allow-abs-ostemplate-path.diff
+++ b/debian/patches/allow-abs-ostemplate-path.diff
@@ -1,16 +1,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)
+--- a/src/lib/create.c
++++ b/src/lib/create.c
+@@ -159,19 +159,25 @@
  		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) {
@@ -41,7 +39,7 @@ Index: new/src/lib/create.c
  	}
  	/* Lock CT area */
  	if (make_dir(fs->private, 0))
-@@ -236,6 +242,7 @@
+@@ -305,6 +311,7 @@
  	int ret = 0;
  	char src[STR_SIZE];
  	char dst[STR_SIZE];
@@ -49,9 +47,9 @@ Index: new/src/lib/create.c
  	const char *sample_config;
  	fs_param *fs = &vps_p->res.fs;
  	tmpl_param *tmpl = &vps_p->res.tmpl;
-@@ -364,6 +371,12 @@
- 						vps_p->opt.layout,
- 						vps_p->opt.mode)))
+@@ -432,6 +439,12 @@
+ 		ret = fs_create(veid, h, vps_p);
+ 		if (ret)
  			goto err_root;
 +
 +		if ((p = strrchr(tmpl->ostmpl, '/'))) {
diff --git a/debian/patches/always-create-dev-console.patch b/debian/patches/always-create-dev-console.patch
index a9933c8..a50a12e 100644
--- a/debian/patches/always-create-dev-console.patch
+++ b/debian/patches/always-create-dev-console.patch
@@ -1,9 +1,7 @@
-Index: new/src/lib/env.c
-===================================================================
---- new.orig/src/lib/env.c	2012-09-28 10:57:31.000000000 +0200
-+++ new/src/lib/env.c	2012-10-01 10:11:05.000000000 +0200
-@@ -279,6 +279,11 @@
- 		dup2(fd, 2);
+--- a/src/lib/env.c
++++ b/src/lib/env.c
+@@ -294,6 +294,11 @@
+ 		close(fd);
  	}
  
 +	unlink("/dev/console");
diff --git a/debian/patches/fix-config-path.diff b/debian/patches/fix-config-path.diff
index 8a17ad9..d39b7bb 100644
--- a/debian/patches/fix-config-path.diff
+++ b/debian/patches/fix-config-path.diff
@@ -1,20 +1,5 @@
-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
-+++ new/paths.am	2012-09-28 09:39:27.000000000 +0200
+--- a/paths.am
++++ b/paths.am
 @@ -32,7 +32,7 @@
  ifupdir     = $(sysconfdir)/network/if-up.d
  
@@ -24,29 +9,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..bf62c02 100644
--- a/debian/patches/fix-default-template.diff
+++ b/debian/patches/fix-default-template.diff
@@ -1,14 +1,11 @@
-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 @@
+--- a/etc/vz.conf.in
++++ b/etc/vz.conf.in
+@@ -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..9dd0742 100644
--- a/debian/patches/fix-init.d-depends.diff
+++ b/debian/patches/fix-init.d-depends.diff
@@ -1,7 +1,5 @@
-Index: new/etc/init.d/vz-redhat.in
-===================================================================
---- new.orig/etc/init.d/vz-redhat.in	2012-09-28 09:39:27.000000000 +0200
-+++ new/etc/init.d/vz-redhat.in	2012-09-28 09:42:11.000000000 +0200
+--- a/etc/init.d/vz-redhat.in
++++ b/etc/init.d/vz-redhat.in
 @@ -25,8 +25,8 @@
  
  ### BEGIN INIT INFO
@@ -20,8 +18,8 @@ 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 @@
+ VZREBOOTDIR=@VZREBOOTDIR@
+@@ -291,6 +292,13 @@
  	local msg
  	local need_restart
  
@@ -33,8 +31,12 @@ Index: new/etc/init.d/vz-redhat.in
 +	fi
 +
  	need_restart=""
- 	velist=$(vzlist -aH -octid,onboot -s-bootorder |
- 		awk '$2 == "yes" {print $1}')
+ 	# CTs that were running before a reboot
+ 	velist=$(ls $VZREBOOTDIR)
+@@ -303,7 +311,7 @@
+ 			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
 +
  	for veid in $velist; do
diff --git a/debian/patches/fix-vzevent-init.patch b/debian/patches/fix-vzevent-init.patch
index faec149..52b589b 100644
--- a/debian/patches/fix-vzevent-init.patch
+++ b/debian/patches/fix-vzevent-init.patch
@@ -1,7 +1,5 @@
-Index: new/etc/init.d/vzeventd-redhat.in
-===================================================================
---- new.orig/etc/init.d/vzeventd-redhat.in	2012-02-10 06:33:24.000000000 +0100
-+++ new/etc/init.d/vzeventd-redhat.in	2012-02-10 06:39:55.000000000 +0100
+--- a/etc/init.d/vzeventd-redhat.in
++++ b/etc/init.d/vzeventd-redhat.in
 @@ -27,6 +27,11 @@
  prog=vzeventd
  lockfile=$VARLOCK/$prog
@@ -14,12 +12,12 @@ Index: new/etc/init.d/vzeventd-redhat.in
  load_module() {
  	modprobe vzevent reboot_event=1
  }
-@@ -59,7 +64,7 @@
+@@ -61,7 +66,7 @@
  	[ -f $lockfile ] && exit 0 # Already running
  
  	load_module
 -	check || exit 1
 +	check || exit 0
  
- 	echo -n $"Starting $prog: "
+ 	echo -n "Starting $prog: "
  	vzdaemon_start $prog $OPTIONS
diff --git a/debian/patches/no-backup-on-destroy.diff b/debian/patches/no-backup-on-destroy.diff
index b129cbb..9f2b4b6 100644
--- a/debian/patches/no-backup-on-destroy.diff
+++ b/debian/patches/no-backup-on-destroy.diff
@@ -1,20 +1,16 @@
-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);
+--- a/src/lib/destroy.c
++++ b/src/lib/destroy.c
+@@ -268,7 +268,7 @@
+ 	}
  	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
-===================================================================
---- new.orig/include/util.h	2012-09-28 09:05:45.000000000 +0200
-+++ new/include/util.h	2012-09-28 09:41:49.000000000 +0200
+--- a/include/util.h
++++ b/include/util.h
 @@ -24,6 +24,7 @@
  
  #define BACKUP		0
@@ -22,14 +18,12 @@ Index: new/include/util.h
 +#define DESTR_ALL	2
  
  #define PROCMEM		"/proc/meminfo"
- #define PROCTHR		"/proc/sys/kernel/threads-max"
-Index: new/src/lib/util.c
-===================================================================
---- new.orig/src/lib/util.c	2012-09-28 09:05:45.000000000 +0200
-+++ new/src/lib/util.c	2012-09-28 09:41:49.000000000 +0200
-@@ -613,7 +613,14 @@
+ #define PROCCPU		"/proc/cpuinfo"
+--- a/src/lib/util.c
++++ b/src/lib/util.c
+@@ -651,7 +651,14 @@
  
- 	snprintf(conf, sizeof(conf), VPS_CONF_DIR "%d.%s", veid, prefix);
+ 	snprintf(conf, sizeof(conf), VPSCONFDIR "/%d.%s", veid, prefix);
  	snprintf(newconf, sizeof(newconf), "%s." DESTR_PREFIX, conf);
 -	action == BACKUP ? rename(conf, newconf) : unlink(newconf);
 +	if (action == BACKUP) {
-- 
1.7.10.4




More information about the pve-devel mailing list