Merge remote branch 'cros/upstream' into master

Merged to upstream autotest @4749~@5215.

The entire change list description is too big to enlist here. Please refer to upstream (http://autotest.kernel.org/browser) for more details.

BUG=
TEST=emerged both x86 and arm build.
Tested emerged x86 build bvt against a chromeos device.

Review URL: http://codereview.chromium.org/6246035

Change-Id: I8455f2135c87c321c6efc232e2869dc8f675395e
diff --git a/server/autoserv b/server/autoserv
index 1cec992..2c4acb1 100755
--- a/server/autoserv
+++ b/server/autoserv
@@ -89,13 +89,11 @@
 
     # can't be both a client and a server side test
     if client and server:
-        print "Can not specify a test as both server and client!"
-        sys.exit(1)
+        parser.parser.error("Can not specify a test as both server and client!")
 
     if len(parser.args) < 1 and not (verify or repair or cleanup
                                      or collect_crashinfo):
-        print parser.parser.print_help()
-        sys.exit(1)
+        parser.parser.error("Missing argument: control file")
 
     # We have a control file unless it's just a verify/repair/cleanup job
     if len(parser.args) > 0:
@@ -116,15 +114,13 @@
     if machines:
         for machine in machines:
             if not machine or re.search('\s', machine):
-                print "Invalid machine %s" % str(machine)
-                sys.exit(1)
+                parser.parser.error("Invalid machine: %s" % str(machine))
         machines = list(set(machines))
         machines.sort()
 
     if group_name and len(machines) < 2:
-        print ("-G %r may only be supplied with more than one machine."
+        parser.parser.error("-G %r may only be supplied with more than one machine."
                % group_name)
-        sys.exit(1)
 
     kwargs = {'group_name': group_name, 'tag': execution_tag}
     if control_filename: