direct-io.hg

changeset 11456:3e4fa8b5b245

merge with xen-unstable.hg
author awilliam@xenbuild.aw
date Tue Sep 12 11:43:22 2006 -0600 (2006-09-12)
parents 73cdbd909a8d 7d4def53936c
children 1d7c72e53d3d 36a3c92cdf8f
files xen/arch/ia64/xen/mm.c xen/include/asm-ia64/mm.h
line diff
     1.1 --- a/patches/linux-2.6.16.13/x86_64-put-note-sections-into-a-pt_note-segment-in-vmlinux.patch	Tue Sep 12 11:42:27 2006 -0600
     1.2 +++ b/patches/linux-2.6.16.13/x86_64-put-note-sections-into-a-pt_note-segment-in-vmlinux.patch	Tue Sep 12 11:43:22 2006 -0600
     1.3 @@ -1,5 +1,3 @@
     1.4 -diff --git a/arch/x86_64/kernel/vmlinux.lds.S b/arch/x86_64/kernel/vmlinux.lds.S
     1.5 -index 7c4de31..ef418b3 100644
     1.6  --- a/arch/x86_64/kernel/vmlinux.lds.S
     1.7  +++ b/arch/x86_64/kernel/vmlinux.lds.S
     1.8  @@ -13,6 +13,12 @@ OUTPUT_FORMAT("elf64-x86-64", "elf64-x86
     1.9 @@ -24,7 +22,7 @@ index 7c4de31..ef418b3 100644
    1.10     				/* out-of-line lock text */
    1.11     .text.lock : AT(ADDR(.text.lock) - LOAD_OFFSET) { *(.text.lock) }
    1.12   
    1.13 -@@ -57,7 +63,7 @@ #endif
    1.14 +@@ -57,17 +63,10 @@ #endif
    1.15     .data : AT(ADDR(.data) - LOAD_OFFSET) {
    1.16   	*(.data)
    1.17   	CONSTRUCTORS
    1.18 @@ -33,7 +31,17 @@ index 7c4de31..ef418b3 100644
    1.19   
    1.20     _edata = .;			/* End of data section */
    1.21   
    1.22 -@@ -89,7 +95,7 @@ #define VVIRT_OFFSET (VSYSCALL_ADDR - VS
    1.23 +-  __bss_start = .;		/* BSS */
    1.24 +-  .bss : AT(ADDR(.bss) - LOAD_OFFSET) {
    1.25 +-	*(.bss.page_aligned)	
    1.26 +-	*(.bss)
    1.27 +-	}
    1.28 +-  __bss_stop = .;
    1.29 +-
    1.30 +   . = ALIGN(PAGE_SIZE);
    1.31 +   . = ALIGN(CONFIG_X86_L1_CACHE_BYTES);
    1.32 +   .data.cacheline_aligned : AT(ADDR(.data.cacheline_aligned) - LOAD_OFFSET) {
    1.33 +@@ -89,7 +88,7 @@ #define VVIRT_OFFSET (VSYSCALL_ADDR - VS
    1.34   #define VVIRT(x) (ADDR(x) - VVIRT_OFFSET)
    1.35   
    1.36     . = VSYSCALL_ADDR;
    1.37 @@ -42,7 +50,7 @@ index 7c4de31..ef418b3 100644
    1.38     __vsyscall_0 = VSYSCALL_VIRT_ADDR;
    1.39   
    1.40     . = ALIGN(CONFIG_X86_L1_CACHE_BYTES);
    1.41 -@@ -132,7 +138,7 @@ #undef VVIRT
    1.42 +@@ -132,7 +131,7 @@ #undef VVIRT
    1.43     . = ALIGN(8192);		/* init_task */
    1.44     .data.init_task : AT(ADDR(.data.init_task) - LOAD_OFFSET) {
    1.45   	*(.data.init_task)
    1.46 @@ -51,7 +59,22 @@ index 7c4de31..ef418b3 100644
    1.47   
    1.48     . = ALIGN(4096);
    1.49     .data.page_aligned : AT(ADDR(.data.page_aligned) - LOAD_OFFSET) {
    1.50 -@@ -235,4 +241,6 @@ #endif
    1.51 +@@ -222,6 +221,14 @@ SECTIONS
    1.52 +   . = ALIGN(4096);
    1.53 +   __nosave_end = .;
    1.54 + 
    1.55 ++  __bss_start = .;		/* BSS */
    1.56 ++  . = ALIGN(4096);
    1.57 ++  .bss : AT(ADDR(.bss) - LOAD_OFFSET) {
    1.58 ++	*(.bss.page_aligned)
    1.59 ++	*(.bss)
    1.60 ++	}
    1.61 ++  __bss_stop = .;
    1.62 ++
    1.63 +   _end = . ;
    1.64 + 
    1.65 +   /* Sections to be discarded */
    1.66 +@@ -235,4 +242,6 @@ #endif
    1.67     STABS_DEBUG
    1.68   
    1.69     DWARF_DEBUG
     2.1 --- a/tools/python/xen/web/SrvBase.py	Tue Sep 12 11:42:27 2006 -0600
     2.2 +++ b/tools/python/xen/web/SrvBase.py	Tue Sep 12 11:43:22 2006 -0600
     2.3 @@ -84,6 +84,7 @@ class SrvBase(resource.Resource):
     2.4              try:
     2.5                  return op_method(op, req)
     2.6              except Exception, exn:
     2.7 +                req.setResponseCode(http.INTERNAL_SERVER_ERROR, "Request failed: " + op)
     2.8                  log.exception("Request %s failed.", op)
     2.9                  if req.useSxp():
    2.10                      return ['xend.err', str(exn)]
     3.1 --- a/tools/python/xen/xm/addlabel.py	Tue Sep 12 11:42:27 2006 -0600
     3.2 +++ b/tools/python/xen/xm/addlabel.py	Tue Sep 12 11:43:22 2006 -0600
     3.3 @@ -20,8 +20,6 @@
     3.4  """Labeling a domain configuration file or a resoruce.
     3.5  """
     3.6  import sys, os
     3.7 -import string
     3.8 -import traceback
     3.9  from xen.util import dictio
    3.10  from xen.util import security
    3.11  
    3.12 @@ -33,6 +31,7 @@ def usage():
    3.13      print "  resource. It derives the policy from the running hypervisor"
    3.14      print "  if it is not given (optional parameter). If a label already"
    3.15      print "  exists for the given domain or resource, then addlabel fails.\n"
    3.16 +    security.err("Usage")
    3.17  
    3.18  
    3.19  def validate_config_file(configfile):
    3.20 @@ -134,7 +133,6 @@ def main (argv):
    3.21                  for prefix in [".", "/etc/xen"]:
    3.22                      configfile = prefix + "/" + configfile
    3.23                      if os.path.isfile(configfile):
    3.24 -                        fd = open(configfile, "rb")
    3.25                          break
    3.26              if not validate_config_file(configfile):
    3.27                  usage()
    3.28 @@ -147,7 +145,7 @@ def main (argv):
    3.29              usage()
    3.30  
    3.31      except security.ACMError:
    3.32 -        traceback.print_exc(limit=1)
    3.33 +        sys.exit(-1)
    3.34  
    3.35  
    3.36  if __name__ == '__main__':
     4.1 --- a/tools/python/xen/xm/cfgbootpolicy.py	Tue Sep 12 11:42:27 2006 -0600
     4.2 +++ b/tools/python/xen/xm/cfgbootpolicy.py	Tue Sep 12 11:43:22 2006 -0600
     4.3 @@ -70,7 +70,7 @@ def determine_kernelversion(user_specifi
     4.4                  within_xen_title = 0
     4.5                  within_xen_entry = 0
     4.6      if len(version_list) > 1:
     4.7 -        err("Cannot decide between entries for kernels: " + version_list)
     4.8 +        err("Cannot decide between entries for kernels %s" % version_list)
     4.9      elif len(version_list) == 0:
    4.10          err("Cannot find a boot entry candidate (please create a Xen boot entry first).")
    4.11      else:
    4.12 @@ -87,7 +87,6 @@ def insert_policy(boot_file, kernel_vers
    4.13      within_xen_entry = 0
    4.14      insert_at_end_of_entry = 0
    4.15      path_prefix = ''
    4.16 -    done = False
    4.17      (tmp_fd, tmp_grub) = tempfile.mkstemp()
    4.18      #follow symlink since menue.lst might be linked to grub.conf
    4.19      if stat.S_ISLNK(os.lstat(boot_file)[stat.ST_MODE]):
    4.20 @@ -175,9 +174,10 @@ def main(argv):
    4.21          print "Boot entry created and \'%s\' copied to /boot" % (policy + ".bin")
    4.22  
    4.23      except ACMError:
    4.24 -        pass
    4.25 +        sys.exit(-1)
    4.26      except:
    4.27          traceback.print_exc(limit=1)
    4.28 +        sys.exit(-1)
    4.29  
    4.30  
    4.31  
     5.1 --- a/tools/python/xen/xm/create.py	Tue Sep 12 11:42:27 2006 -0600
     5.2 +++ b/tools/python/xen/xm/create.py	Tue Sep 12 11:43:22 2006 -0600
     5.3 @@ -1155,7 +1155,7 @@ def create_security_check(config):
     5.4          else:
     5.5              print "Checking resources: (skipped)"
     5.6      except security.ACMError:
     5.7 -        traceback.print_exc(limit=1)
     5.8 +        sys.exit(-1)
     5.9  
    5.10      return passed
    5.11  
    5.12 @@ -1176,7 +1176,7 @@ def main(argv):
    5.13          PrettyPrint.prettyprint(config)
    5.14      else:
    5.15          if not create_security_check(config):
    5.16 -            print "Security configuration prevents domain from starting"
    5.17 +            err("Security configuration prevents domain from starting.")
    5.18          else:
    5.19              dom = make_domain(opts, config)
    5.20              if opts.vals.console_autoconnect:
     6.1 --- a/tools/python/xen/xm/dry-run.py	Tue Sep 12 11:42:27 2006 -0600
     6.2 +++ b/tools/python/xen/xm/dry-run.py	Tue Sep 12 11:43:22 2006 -0600
     6.3 @@ -18,6 +18,7 @@
     6.4  
     6.5  """Tests the security settings for a domain and its resources.
     6.6  """
     6.7 +import sys
     6.8  from xen.util import security
     6.9  from xen.xm import create
    6.10  from xen.xend import sxp
    6.11 @@ -28,14 +29,14 @@ def usage():
    6.12      print "to see if the domain created by the configfile can access"
    6.13      print "the resources.  The status of each resource is listed"
    6.14      print "individually along with the final security decision.\n"
    6.15 +    security.err("Usage")
    6.16  
    6.17  
    6.18  def main (argv):
    6.19 -    if len(argv) != 2:
    6.20 -        usage()
    6.21 -        return
    6.22 +    try:
    6.23 +        if len(argv) != 2:
    6.24 +            usage()
    6.25  
    6.26 -    try:
    6.27          passed = 0
    6.28          (opts, config) = create.parseCommandLine(argv)
    6.29          if create.check_domain_label(config, verbose=1):
    6.30 @@ -48,8 +49,10 @@ def main (argv):
    6.31              print "Dry Run: PASSED"
    6.32          else:
    6.33              print "Dry Run: FAILED"
    6.34 +            sys.exit(-1)
    6.35 +
    6.36      except security.ACMError:
    6.37 -        pass
    6.38 +        sys.exit(-1)
    6.39  
    6.40  
    6.41  if __name__ == '__main__':
     7.1 --- a/tools/python/xen/xm/dumppolicy.py	Tue Sep 12 11:42:27 2006 -0600
     7.2 +++ b/tools/python/xen/xm/dumppolicy.py	Tue Sep 12 11:43:22 2006 -0600
     7.3 @@ -18,7 +18,6 @@
     7.4  """Display currently enforced policy (low-level hypervisor representation).
     7.5  """
     7.6  import sys
     7.7 -import traceback
     7.8  from xen.util.security import ACMError, err, dump_policy
     7.9  
    7.10  
    7.11 @@ -31,12 +30,13 @@ def usage():
    7.12  
    7.13  def main(argv):
    7.14      try:
    7.15 +        if len(argv) != 1:
    7.16 +            usage()
    7.17 +
    7.18          dump_policy()
    7.19  
    7.20      except ACMError:
    7.21 -        pass
    7.22 -    except:
    7.23 -        traceback.print_exc(limit=1)
    7.24 +        sys.exit(-1)
    7.25  
    7.26  
    7.27  if __name__ == '__main__':
     8.1 --- a/tools/python/xen/xm/getlabel.py	Tue Sep 12 11:42:27 2006 -0600
     8.2 +++ b/tools/python/xen/xm/getlabel.py	Tue Sep 12 11:43:22 2006 -0600
     8.3 @@ -19,8 +19,6 @@
     8.4  """Show the label for a domain or resoruce.
     8.5  """
     8.6  import sys, os, re
     8.7 -import string
     8.8 -import traceback
     8.9  from xen.util import dictio
    8.10  from xen.util import security
    8.11  
    8.12 @@ -28,6 +26,7 @@ def usage():
    8.13      print "\nUsage: xm getlabel dom <configfile>"
    8.14      print "       xm getlabel res <resource>\n"
    8.15      print "  This program shows the label for a domain or resource.\n"
    8.16 +    security.err("Usage")
    8.17  
    8.18  
    8.19  def get_resource_label(resource):
    8.20 @@ -38,8 +37,7 @@ def get_resource_label(resource):
    8.21      try:
    8.22          access_control = dictio.dict_read("resources", file)
    8.23      except:
    8.24 -        print "Resource label file not found"
    8.25 -        return
    8.26 +        security.err("Resource label file not found")
    8.27  
    8.28      # get the entry and print label
    8.29      if access_control.has_key(resource):
    8.30 @@ -47,7 +45,7 @@ def get_resource_label(resource):
    8.31          label = access_control[resource][1]
    8.32          print "policy="+policy+",label="+label
    8.33      else:
    8.34 -        print "Resource not labeled"
    8.35 +        security.err("Resource not labeled")
    8.36  
    8.37  
    8.38  def get_domain_label(configfile):
    8.39 @@ -63,8 +61,7 @@ def get_domain_label(configfile):
    8.40                  fd = open(file, "rb")
    8.41                  break
    8.42      if not fd:
    8.43 -        print "Configuration file '"+configfile+"' not found."
    8.44 -        return
    8.45 +        security.err("Configuration file '"+configfile+"' not found.")
    8.46  
    8.47      # read in the domain config file, finding the label line
    8.48      ac_entry_re = re.compile("^access_control\s*=.*", re.IGNORECASE)
    8.49 @@ -82,8 +79,7 @@ def get_domain_label(configfile):
    8.50  
    8.51      # send error message if we didn't find anything
    8.52      if acline == "":
    8.53 -        print "Label does not exist in domain configuration file."
    8.54 -        return
    8.55 +        security.err("Domain not labeled")
    8.56  
    8.57      # print out the label
    8.58      (title, data) = acline.split("=", 1)
    8.59 @@ -94,19 +90,21 @@ def get_domain_label(configfile):
    8.60  
    8.61  
    8.62  def main (argv):
    8.63 -    if len(argv) != 3:
    8.64 -        usage()
    8.65 -        return
    8.66 +    try:
    8.67 +        if len(argv) != 3:
    8.68 +            usage()
    8.69  
    8.70 -    if argv[1].lower() == "dom":
    8.71 -        configfile = argv[2]
    8.72 -        get_domain_label(configfile)
    8.73 -    elif argv[1].lower() == "res":
    8.74 -        resource = argv[2]
    8.75 -        get_resource_label(resource)
    8.76 -    else:
    8.77 -        usage()
    8.78 +        if argv[1].lower() == "dom":
    8.79 +            configfile = argv[2]
    8.80 +            get_domain_label(configfile)
    8.81 +        elif argv[1].lower() == "res":
    8.82 +            resource = argv[2]
    8.83 +            get_resource_label(resource)
    8.84 +        else:
    8.85 +            usage()
    8.86  
    8.87 +    except security.ACMError:
    8.88 +        sys.exit(-1)
    8.89  
    8.90  if __name__ == '__main__':
    8.91      main(sys.argv)
     9.1 --- a/tools/python/xen/xm/labels.py	Tue Sep 12 11:42:27 2006 -0600
     9.2 +++ b/tools/python/xen/xm/labels.py	Tue Sep 12 11:43:22 2006 -0600
     9.3 @@ -70,10 +70,12 @@ def main(argv):
     9.4          labels.sort()
     9.5          for label in labels:
     9.6              print label
     9.7 +
     9.8      except ACMError:
     9.9 -        pass
    9.10 +        sys.exit(-1)
    9.11      except:
    9.12          traceback.print_exc(limit=1)
    9.13 +        sys.exit(-1)
    9.14  
    9.15  
    9.16  if __name__ == '__main__':
    10.1 --- a/tools/python/xen/xm/loadpolicy.py	Tue Sep 12 11:42:27 2006 -0600
    10.2 +++ b/tools/python/xen/xm/loadpolicy.py	Tue Sep 12 11:43:22 2006 -0600
    10.3 @@ -34,11 +34,12 @@ def main(argv):
    10.4          if len(argv) != 2:
    10.5              usage()
    10.6          load_policy(argv[1])
    10.7 +
    10.8      except ACMError:
    10.9 -        pass
   10.10 +        sys.exit(-1)
   10.11      except:
   10.12          traceback.print_exc(limit=1)
   10.13 -
   10.14 +        sys.exit(-1)
   10.15  
   10.16  
   10.17  if __name__ == '__main__':
    11.1 --- a/tools/python/xen/xm/makepolicy.py	Tue Sep 12 11:42:27 2006 -0600
    11.2 +++ b/tools/python/xen/xm/makepolicy.py	Tue Sep 12 11:43:22 2006 -0600
    11.3 @@ -37,9 +37,10 @@ def main(argv):
    11.4          make_policy(argv[1])
    11.5  
    11.6      except ACMError:
    11.7 -        pass
    11.8 +        sys.exit(-1)
    11.9      except:
   11.10          traceback.print_exc(limit=1)
   11.11 +        sys.exit(-1)
   11.12  
   11.13  
   11.14  
    12.1 --- a/tools/python/xen/xm/resources.py	Tue Sep 12 11:42:27 2006 -0600
    12.2 +++ b/tools/python/xen/xm/resources.py	Tue Sep 12 11:43:22 2006 -0600
    12.3 @@ -18,8 +18,7 @@
    12.4  
    12.5  """List the resource label information from the global resource label file
    12.6  """
    12.7 -import sys, os
    12.8 -import string
    12.9 +import sys
   12.10  from xen.util import dictio
   12.11  from xen.util import security
   12.12  
   12.13 @@ -27,6 +26,7 @@ def usage():
   12.14      print "\nUsage: xm resource\n"
   12.15      print "  This program lists information for each resource in the"
   12.16      print "  global resource label file\n"
   12.17 +    security.err("Usage")
   12.18  
   12.19  
   12.20  def print_resource_data(access_control):
   12.21 @@ -41,14 +41,19 @@ def print_resource_data(access_control):
   12.22  
   12.23  def main (argv):
   12.24      try:
   12.25 -        file = security.res_label_filename
   12.26 -        access_control = dictio.dict_read("resources", file)
   12.27 -    except:
   12.28 -        print "Resource file not found."
   12.29 -        return
   12.30 +        if len(argv) != 1:
   12.31 +            usage()
   12.32  
   12.33 -    print_resource_data(access_control)
   12.34 +        try:
   12.35 +            file = security.res_label_filename
   12.36 +            access_control = dictio.dict_read("resources", file)
   12.37 +        except:
   12.38 +            security.err("Error reading resource file.")
   12.39  
   12.40 +        print_resource_data(access_control)
   12.41 +
   12.42 +    except security.ACMError:
   12.43 +        sys.exit(-1)
   12.44  
   12.45  if __name__ == '__main__':
   12.46      main(sys.argv)
    13.1 --- a/tools/python/xen/xm/rmlabel.py	Tue Sep 12 11:42:27 2006 -0600
    13.2 +++ b/tools/python/xen/xm/rmlabel.py	Tue Sep 12 11:43:22 2006 -0600
    13.3 @@ -19,8 +19,6 @@
    13.4  """Remove a label from a domain configuration file or a resoruce.
    13.5  """
    13.6  import sys, os, re
    13.7 -import string
    13.8 -import traceback
    13.9  from xen.util import dictio
   13.10  from xen.util import security
   13.11  
   13.12 @@ -31,6 +29,7 @@ def usage():
   13.13      print "  for a domain or from the global resource label file for a"
   13.14      print "  resource. If the label does not exist for the given domain or"
   13.15      print "  resource, then rmlabel fails.\n"
   13.16 +    security.err("Usage")
   13.17  
   13.18  
   13.19  def rm_resource_label(resource):
   13.20 @@ -48,7 +47,7 @@ def rm_resource_label(resource):
   13.21          del access_control[resource]
   13.22          dictio.dict_write(access_control, "resources", file)
   13.23      else:
   13.24 -        security.err("Label does not exist in resource label file.")
   13.25 +        security.err("Resource not labeled.")
   13.26  
   13.27  
   13.28  def rm_domain_label(configfile):
   13.29 @@ -85,7 +84,7 @@ def rm_domain_label(configfile):
   13.30  
   13.31      # send error message if we didn't find anything to remove
   13.32      if not removed:
   13.33 -        security.err("Label does not exist in domain configuration file.")
   13.34 +        security.err("Domain not labeled.")
   13.35  
   13.36      # write the data back out to the file
   13.37      fd = open(file, "wb")
   13.38 @@ -97,7 +96,6 @@ def main (argv):
   13.39      try:
   13.40          if len(argv) != 3:
   13.41              usage()
   13.42 -            return
   13.43  
   13.44          if argv[1].lower() == "dom":
   13.45              configfile = argv[2]
   13.46 @@ -109,7 +107,7 @@ def main (argv):
   13.47              usage()
   13.48  
   13.49      except security.ACMError:
   13.50 -        traceback.print_exc(limit=1)
   13.51 +        sys.exit(-1)
   13.52  
   13.53  
   13.54  if __name__ == '__main__':