summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCorentin LABBE <clabbe@baylibre.com>2018-02-01 12:16:22 +0100
committerCorentin LABBE <clabbe@baylibre.com>2018-02-14 10:29:30 +0100
commit8a0086b4f620ea44c5fff1070df9e71c891f4680 (patch)
treeb5f23a7a23b6a07cd7f6d6ce27c459cda60a29ff
parente0bb2bb05421169d9b5a4e9f515eced1e3bf2c13 (diff)
Reintroduce qemu KVM support
Since lava-docker must run on all arch, and that KVM is x86 specific, KVM support was disabled for qemu. Reintroduce it now as an option for each lab via the host_has_cpuflag_kvm flag.
-rwxr-xr-xlavalab-gen.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/lavalab-gen.py b/lavalab-gen.py
index 21e2c0b..6264179 100755
--- a/lavalab-gen.py
+++ b/lavalab-gen.py
@@ -65,6 +65,16 @@ def main(args):
for lab_name in labs:
udev_line =""
lab = labs[lab_name]
+ use_kvm = False
+ if lab.has_key("host_has_cpuflag_kvm"):
+ use_kvm = lab["host_has_cpuflag_kvm"]
+ if use_kvm:
+ if dockcomp["services"][lab_name].has_key("devices"):
+ dc_devices = dockcomp["services"][lab_name]["devices"]
+ else:
+ dockcomp["services"][lab_name]["devices"] = []
+ dc_devices = dockcomp["services"][lab_name]["devices"]
+ dc_devices.append("/dev/kvm:/dev/kvm")
for board_name in lab["boardlist"]:
b = lab["boardlist"][board_name]
if b.get("disabled", None):
@@ -110,7 +120,7 @@ def main(args):
device_line += "{%% set fastboot_serial_number = '%s' %%}" % fserial
# board specific hacks
- if devicetype == "qemu":
+ if devicetype == "qemu" and not use_kvm:
device_line += "{% set no_kvm = True %}\n"
if not os.path.isdir("lava-master/devices/"):
os.mkdir("lava-master/devices/")