aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rumba/testbeds/qemu.py7
1 files changed, 7 insertions, 0 deletions
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')