direct-io.hg

changeset 12446:fb107b9eee86

merge with xen-ia64-unstable.hg
author kaf24@localhost.localdomain
date Wed Nov 15 00:14:41 2006 +0000 (2006-11-15)
parents f78e499dd669 4d47322a7729
children f9ade0890e03
files
line diff
     1.1 --- a/tools/python/xen/util/security.py	Tue Nov 14 14:59:37 2006 -0700
     1.2 +++ b/tools/python/xen/util/security.py	Wed Nov 15 00:14:41 2006 +0000
     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