[CRIU] [PATCH 4/5] ovz: preserv ovz module
nspiridonov
nspiridonov at odin.com
Thu Apr 30 05:10:23 PDT 2015
From: Nikita Spiridonov <nspiridonov at odin.com>
It is usefull at the present moment to have OpenVZ module for
testing purpose. This module basically reuses functionality of
Virtuozzo module and differs only in root_task_pid method. It can
be removed later when Virtuozzo module will be completely compatible
with OpenVZ containers.
Signed-off-by: Nikita Spiridonov <nspiridonov at odin.com>
---
p_haul_ovz.py | 18 ++++++++++++++++++
p_haul_type.py | 2 ++
2 files changed, 20 insertions(+), 0 deletions(-)
create mode 100644 p_haul_ovz.py
diff --git a/p_haul_ovz.py b/p_haul_ovz.py
new file mode 100644
index 0000000..bf719d0
--- /dev/null
+++ b/p_haul_ovz.py
@@ -0,0 +1,18 @@
+#
+# OpenVZ containers hauler module
+#
+
+import os
+import p_haul_vz
+
+name = "ovz"
+vzpid_dir = "/var/lib/vzctl/vepid/"
+
+class p_haul_type(p_haul_vz.p_haul_type):
+ def __init__(self, ctid):
+ p_haul_vz.p_haul_type.__init__(self, ctid)
+
+ def root_task_pid(self):
+ with open(os.path.join(vzpid_dir, self._ctid)) as pf:
+ pid = pf.read()
+ return int(pid)
diff --git a/p_haul_type.py b/p_haul_type.py
index adf654e..8cf1eb4 100644
--- a/p_haul_type.py
+++ b/p_haul_type.py
@@ -5,11 +5,13 @@
#
import p_haul_vz
+import p_haul_ovz
import p_haul_pid
import p_haul_lxc
haul_types = {
p_haul_vz.name: p_haul_vz,
+ p_haul_ovz.name: p_haul_ovz,
p_haul_pid.name: p_haul_pid,
p_haul_lxc.name: p_haul_lxc,
}
--
1.7.1
More information about the CRIU
mailing list