mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 10:40:03 +01:00
Import the xen-unstable changeset
11863:7633398447846679342b197a79bc375b996d9026, with conflict resolution by Ewan Mellor. [XM] Allow empty resource strings (e.g., when creating an empty CDROM device). Also clean up error/acces-denied path. Signed-off-by: Keir Fraser <keir@xensource.com>
This commit is contained in:
1 parent
2a46b1b066
commit
54aa7f4832
2 files changed
+11
-2
No files matched your search
@@ -601,8 +601,15 @@ def unify_resname(resource):
|
||||
"""Makes all resource locations absolute. In case of physical
|
||||
resources, '/dev/' is added to local file names"""
|
||||
|
||||
if not resource:
|
||||
return resource
|
||||
|
||||
# sanity check on resource name
|
||||
(type, resfile) = resource.split(":")
|
||||
try:
|
||||
(type, resfile) = resource.split(":")
|
||||
except:
|
||||
err("Resource spec '%s' contains no ':' delimiter" % resource)
|
||||
|
||||
if type == "phy":
|
||||
if not resfile.startswith("/"):
|
||||
resfile = "/dev/" + resfile
|
||||
|
||||
@@ -1161,6 +1161,8 @@ def config_security_check(config, verbose):
|
||||
except security.ACMError:
|
||||
print " %s: DENIED" % (resource)
|
||||
(res_label, res_policy) = security.get_res_label(resource)
|
||||
if not res_label:
|
||||
res_label = ""
|
||||
print " --> res: %s (%s)" % (str(res_label),
|
||||
str(res_policy))
|
||||
print " --> dom: %s (%s)" % (str(domain_label),
|
||||
@@ -1202,7 +1204,7 @@ def main(argv):
|
||||
PrettyPrint.prettyprint(config)
|
||||
else:
|
||||
if not create_security_check(config):
|
||||
raise OptionError('Security Configuration prevents domain from starting')
|
||||
raise security.ACMError('Security Configuration prevents domain from starting')
|
||||
else:
|
||||
dom = make_domain(opts, config)
|
||||
if opts.vals.console_autoconnect:
|
||||
|
||||