From 8432191cf9ed370aaf2a2e9792b546202dae0d07 Mon Sep 17 00:00:00 2001 From: Marco Capitani Date: Wed, 7 Jun 2017 11:44:24 +0200 Subject: qemu: fix for devices permission --- rumba/testbeds/qemu.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/rumba/testbeds/qemu.py b/rumba/testbeds/qemu.py index b7ebef9..df02ab6 100644 --- a/rumba/testbeds/qemu.py +++ b/rumba/testbeds/qemu.py @@ -111,6 +111,13 @@ class Testbed(mod.Testbed): if os.geteuid() != 0: try: subprocess.check_call(["sudo", "-v"]) + if not os.access("/dev/vhost-net", os.R_OK) \ + or not os.access("/dev/vhost-net", os.W_OK) \ + or not os.access("/dev/kvm", os.R_OK) \ + or not os.access("/dev/kvm", os.W_OK): + raise Exception('Cannot open vhost device. Make sure it is' + 'available and you have rw permissions ' + 'on /dev/vhost-net') except subprocess.CalledProcessError: raise Exception('Not authenticated') -- cgit v1.2.3