[elbe-devel] [PATCH 09/10] initvm: add --nesting option which is passed downwards to elbe init

Torben Hohn torben.hohn at linutronix.de
Wed Mar 22 17:44:16 CET 2017


---
 elbepack/commands/initvm.py |  4 ++++
 elbepack/initvmaction.py    | 13 ++++++++-----
 2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/elbepack/commands/initvm.py b/elbepack/commands/initvm.py
index d99efeb..f96282b 100755
--- a/elbepack/commands/initvm.py
+++ b/elbepack/commands/initvm.py
@@ -59,6 +59,10 @@ def run_command (argv):
     oparser.add_option ("--writeproject", dest="writeproject", default=None,
                         help="write project name to file")
 
+    oparser.add_option( "--nesting", dest="nesting",
+                        action="store_true", default=False,
+           help="allow initvm to support nested kvm. This makes /proc/cpuinfo inside initvm differ per host." )
+
     (opt,args) = oparser.parse_args (sys.argv)
     args = args[2:]
 
diff --git a/elbepack/initvmaction.py b/elbepack/initvmaction.py
index ed28e1c..55aadef 100644
--- a/elbepack/initvmaction.py
+++ b/elbepack/initvmaction.py
@@ -298,15 +298,18 @@ class CreateAction(InitVMAction):
             exampl = os.path.join (elbepack.__path__[0], "init/default-init.xml")
 
         try:
+            init_opts = '';
             if opt.devel:
-                devel = ' --devel'
-            else:
-                devel = ''
+                init_opts += ' --devel'
+
+            if opt.nesting:
+                init_opts += ' --nesting'
+
 
             if cdrom:
-                system ('%s init %s --directory "%s" --cdrom "%s" "%s"' % (elbe_exe, devel, initvmdir, cdrom, exampl))
+                system ('%s init %s --directory "%s" --cdrom "%s" "%s"' % (elbe_exe, init_opts, initvmdir, cdrom, exampl))
             else:
-                system ('%s init %s --directory "%s" "%s"' % (elbe_exe, devel, initvmdir, exampl))
+                system ('%s init %s --directory "%s" "%s"' % (elbe_exe, init_opts, initvmdir, exampl))
 
         except CommandError:
             print ("'elbe init' Failed", file=sys.stderr)
-- 
2.1.4





More information about the elbe-devel mailing list