ia64/xen-unstable
changeset 12469:4d47322a7729
Fix breakage of blktap device strings from cset 63d1b02dad347e8feb845d8a8b482e251a478164.
Signed-off-by: Andrew Warfield <andy@xensource.com>
Signed-off-by: Andrew Warfield <andy@xensource.com>
author | Andrew Warfield <andy@xensource.com> |
---|---|
date | Tue Nov 14 11:20:45 2006 -0800 (2006-11-14) |
parents | f026d4091322 |
children | fb107b9eee86 |
files | tools/python/xen/util/security.py |
line diff
1.1 --- a/tools/python/xen/util/security.py Tue Nov 14 18:52:58 2006 +0000 1.2 +++ b/tools/python/xen/util/security.py Tue Nov 14 11:20:45 2006 -0800 1.3 @@ -606,11 +606,17 @@ def unify_resname(resource): 1.4 1.5 # sanity check on resource name 1.6 try: 1.7 - (type, resfile) = resource.split(":") 1.8 + (type, resfile) = resource.split(":", 1) 1.9 except: 1.10 err("Resource spec '%s' contains no ':' delimiter" % resource) 1.11 1.12 - if type == "phy": 1.13 + if type == "tap": 1.14 + try: 1.15 + (subtype, resfile) = resfile.split(":") 1.16 + except: 1.17 + err("Resource spec '%s' contains no tap subtype" % resource) 1.18 + 1.19 + if type in ["phy", "tap"]: 1.20 if not resfile.startswith("/"): 1.21 resfile = "/dev/" + resfile 1.22 1.23 @@ -619,6 +625,8 @@ def unify_resname(resource): 1.24 err("Invalid resource.") 1.25 1.26 # from here on absolute file names with resources 1.27 + if type == "tap": 1.28 + type = type + ":" + subtype 1.29 resource = type + ":" + resfile 1.30 return resource 1.31