[Devel] [PATCH rh7 v2] ve: Add interface for @start_timespec and @real_start_timespec adjustmen

Cyrill Gorcunov gorcunov at virtuozzo.com
Tue Feb 9 11:50:15 PST 2016


On Tue, Feb 09, 2016 at 07:06:01PM +0300, Cyrill Gorcunov wrote:
...
> I'll go this way and patch criu stable.

Here is a patch for stable, just to not loose it.
-------------- next part --------------
>From a7a6c115f1e2aa95f7cae727b465427746078b63 Mon Sep 17 00:00:00 2001
From: Cyrill Gorcunov <gorcunov at virtuozzo.com>
Date: Tue, 9 Feb 2016 22:15:55 +0300
Subject: [PATCH] cgroup: Always restore predefined VE props

We need it for correct restore of in-container
monotonic clocks.

Signed-off-by: Cyrill Gorcunov <gorcunov at virtuozzo.com>
---
 cgroup.c | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/cgroup.c b/cgroup.c
index 27be045..6e8d4c3 100644
--- a/cgroup.c
+++ b/cgroup.c
@@ -82,6 +82,17 @@ static const char *freezer_props[] = {
 };
 
 /*
+ * FIXME
+ * PCS7 scpefic props. Must be dropped off once
+ * custom props engine is merged in.
+ */
+static const char *ve_props[] = {
+	"ve.clock_monotonic",
+	"ve.clock_bootbased",
+	NULL
+};
+
+/*
  * This structure describes set of controller groups
  * a task lives in. The cg_ctl entries are stored in
  * the @ctls list sorted by the .name field and then
@@ -387,6 +398,8 @@ static const char **get_known_properties(char *controller)
 		prop_arr = blkio_props;
 	else if (!strcmp(controller, "freezer"))
 		prop_arr = freezer_props;
+	else if (!strcmp(controller, "ve"))
+		prop_arr = ve_props;
 
 	return prop_arr;
 }
@@ -1181,8 +1194,8 @@ static int prepare_cgroup_dirs(char **controllers, int n_controllers, char *paux
 			}
 
 			if (opts.manage_cgroups & (CG_MODE_SOFT | CG_MODE_NONE)) {
-				pr_info("Skip restoring properties on cgroup dir %s\n", paux);
-				if (e->n_properties > 0) {
+				if (e->n_properties > 0 && strncmp(paux, "ve/", 3)) {
+					pr_info("Skip restoring properties on cgroup dir %s\n", paux);
 					xfree(e->properties);
 					e->properties = NULL;
 					e->n_properties = 0;
-- 
2.5.0



More information about the Devel mailing list