aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Capitani <m.capitani@nextworks.it>2017-06-07 11:44:24 +0200
committerMarco Capitani <m.capitani@nextworks.it>2017-06-07 11:44:24 +0200
commit8432191cf9ed370aaf2a2e9792b546202dae0d07 (patch)
treece781ee036c6c5675779dfa9dc60cc102e968a18
parentd62b0595ab660d6c23ab24bd94cd79453f0129ff (diff)
downloadrumba-8432191cf9ed370aaf2a2e9792b546202dae0d07.tar.gz
rumba-8432191cf9ed370aaf2a2e9792b546202dae0d07.zip
qemu: fix for devices permission
-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')