aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorAndrew Warfield <andy@xensource.com>2006-11-14 11:20:45 -0800
committerAndrew Warfield <andy@xensource.com>2006-11-14 11:20:45 -0800
commit650e610edaf5ba6b1383c7e046d181f48e09b062 (patch)
treef8995e5d3c64f90c7b1cb73921ce6bbe38ded5d1 /tools
parentcbe35a11964b97ad6bf3a5ccea78c050890f739b (diff)
downloadxen-650e610edaf5ba6b1383c7e046d181f48e09b062.tar.gz
xen-650e610edaf5ba6b1383c7e046d181f48e09b062.tar.bz2
xen-650e610edaf5ba6b1383c7e046d181f48e09b062.zip
Fix breakage of blktap device strings from cset 63d1b02dad347e8feb845d8a8b482e251a478164.
Signed-off-by: Andrew Warfield <andy@xensource.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/python/xen/util/security.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/tools/python/xen/util/security.py b/tools/python/xen/util/security.py
index 91c0badd74..9957e7f586 100644
--- a/tools/python/xen/util/security.py
+++ b/tools/python/xen/util/security.py
@@ -606,11 +606,17 @@ def unify_resname(resource):
# sanity check on resource name
try:
- (type, resfile) = resource.split(":")
+ (type, resfile) = resource.split(":", 1)
except:
err("Resource spec '%s' contains no ':' delimiter" % resource)
- if type == "phy":
+ if type == "tap":
+ try:
+ (subtype, resfile) = resfile.split(":")
+ except:
+ err("Resource spec '%s' contains no tap subtype" % resource)
+
+ if type in ["phy", "tap"]:
if not resfile.startswith("/"):
resfile = "/dev/" + resfile
@@ -619,6 +625,8 @@ def unify_resname(resource):
err("Invalid resource.")
# from here on absolute file names with resources
+ if type == "tap":
+ type = type + ":" + subtype
resource = type + ":" + resfile
return resource