[elbe-devel] [PATCH 1/3] init libvirt.xml.mako: add support for opt.nesting to libvirt

Torben Hohn torben.hohn at linutronix.de
Mon Dec 17 13:34:11 CET 2018


in default operation, libvirt will not allow nested kvm in the initvm.

mimic what the Makefile does with "-cpu host".

Signed-off-by: Torben Hohn <torben.hohn at linutronix.de>
---
 elbepack/init/libvirt.xml.mako | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/elbepack/init/libvirt.xml.mako b/elbepack/init/libvirt.xml.mako
index 1260c55f..dd422d6e 100644
--- a/elbepack/init/libvirt.xml.mako
+++ b/elbepack/init/libvirt.xml.mako
@@ -35,6 +35,11 @@ xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
   <memory unit='KiB'>${memory}</memory>
   <currentMemory unit='KiB'>${memory}</currentMemory>
   <vcpu placement='static'>${cpus}</vcpu>
+% if opt.nesting:
+  <cpu mode='host-model' check='partial'>
+    <model fallback='allow'/>
+  </cpu>
+% endif
   <os>
     <type arch='x86_64' machine='pc'>hvm</type>
   </os>
-- 
2.11.0




More information about the elbe-devel mailing list