[elbe-devel] [PATCH 08/10] init: add --nesting option to allow nested kvm in the initvm

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


---
 elbepack/commands/init.py   | 4 ++++
 elbepack/init/Makefile.mako | 6 ++++++
 2 files changed, 10 insertions(+)

diff --git a/elbepack/commands/init.py b/elbepack/commands/init.py
index 91d748a..88a8e71 100644
--- a/elbepack/commands/init.py
+++ b/elbepack/commands/init.py
@@ -63,6 +63,10 @@ def run_command( argv ):
                         action="store_true", default=False,
            help="use devel mode, and install current builddir inside initvm" )
 
+    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(argv)
 
     print opt.directory
diff --git a/elbepack/init/Makefile.mako b/elbepack/init/Makefile.mako
index 2c44648..21f21cd 100644
--- a/elbepack/init/Makefile.mako
+++ b/elbepack/init/Makefile.mako
@@ -125,6 +125,9 @@ run:
 % else:
 		-netdev user,id=user.0${fwd} \
 % endif
+% if opt.nesting:
+		-cpu host \
+% endif
 		-m $(MEMSIZE) \
 		-usb \
 		-smp $(SMP)
@@ -140,6 +143,9 @@ run-con:
 % else:
 		-netdev user,id=user.0${fwd} \
 % endif
+% if opt.nesting:
+		-cpu host \
+% endif
 		-m $(MEMSIZE) \
 		-usb \
 		-nographic \
-- 
2.1.4





More information about the elbe-devel mailing list