From 2b5da0fc18215febc4d982ed298e9be4485a7789 Mon Sep 17 00:00:00 2001 From: Corentin LABBE Date: Mon, 7 Jan 2019 16:45:33 +0100 Subject: lavalab-gen.py: Permit qemu to use TAP devices For full networking capacity, qemu need to access TAP devices. This patch adds the choice of use it via the tap keyword. --- README.md | 1 + lavalab-gen.py | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/README.md b/README.md index e795934..da88f2b 100644 --- a/README.md +++ b/README.md @@ -271,6 +271,7 @@ boards: type: the LAVA device-type of this device slave: (optional) Name of the slave managing this device. Default to first slave found or default_slave if set. kvm: (For qemu only) Does the qemu could use KVM (default: no) + tap: (For qemu only) Does the qemu could use TAP devices (default: no) uboot_ipaddr: (optional) a static IP to set in uboot uboot_macaddr: (Optional) the MAC address to set in uboot custom_option: (optional) All following strings will be directly append to devicefile diff --git a/lavalab-gen.py b/lavalab-gen.py index e814e5e..378f40c 100755 --- a/lavalab-gen.py +++ b/lavalab-gen.py @@ -437,6 +437,11 @@ def main(): if use_kvm: dockcomp_add_device(dockcomp, worker_name, "/dev/kvm:/dev/kvm") # board specific hacks + use_tap = False + if "tap" in board: + use_tap = board["tap"] + if use_tap: + dockcomp_add_device(dockcomp, worker_name, "/dev/net/tun:/dev/net/tun") if devicetype == "qemu" and not use_kvm: device_line += "{% set no_kvm = True %}\n" if "uart" in board: -- cgit 1.2.3-korg