[elbe-devel] [PATCH 1/2] init libvirt.xml.mako: also configure the specified mac address in libvirt

Torben Hohn torben.hohn at linutronix.de
Wed Apr 10 14:43:53 CEST 2019


the initvm network interface mac address has always been configurable
when  the Makefile was used.

add that functionality to libvirt.xml.mako, so that the initvm network
interface shows up with a persistant mac address.

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

diff --git a/elbepack/init/libvirt.xml.mako b/elbepack/init/libvirt.xml.mako
index 92e64b45..4174256f 100644
--- a/elbepack/init/libvirt.xml.mako
+++ b/elbepack/init/libvirt.xml.mako
@@ -27,6 +27,7 @@ imagetype = prj.text('img', default=defs, key='img')
 img = os.path.join(opt.directory, 'buildenv.img')
 
 emulator = prj.text('interpreter', default=defs, key='interpreter')
+nicmac = prj.text('buildimage/NIC/MAC', default=defs, key='nicmac')
 
 %><domain type='kvm'
 xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
@@ -77,7 +78,10 @@ xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
       <address type='virtio-serial' controller='0' bus='0'
       port='1' />
     </channel>
-    <interface type='user' />
+    <interface type='user' >
+      <mac address='${nicmac}'/>
+      <model type='virtio'/>
+    </interface>
   </devices>
 %if prj.has("portforwarding"):
   <qemu:commandline>
-- 
2.11.0




More information about the elbe-devel mailing list