Merge remote branch 'cros/upstream' into tempbranch3

Merge to trunk@4817

BUG=
TEST=

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

Change-Id: I83376bc7d28104ec2678e157eadbe7df7c05c0e0
diff --git a/server/hosts/serial.py b/server/hosts/serial.py
index 9b4bdb2..d514dba 100644
--- a/server/hosts/serial.py
+++ b/server/hosts/serial.py
@@ -114,7 +114,7 @@
 
 
     def hardreset(self, timeout=DEFAULT_REBOOT_TIMEOUT, wait=True,
-                  conmux_command='hardreset', num_attempts=1,
+                  conmux_command='hardreset', num_attempts=1, halt=False,
                   **wait_for_restart_kwargs):
         """
         Reach out and slap the box in the power switch.
@@ -124,6 +124,7 @@
         @params wait: Whether or not to wait for the machine to reboot
         @params num_attempts: Number of times to attempt hard reset erroring
                               on the last attempt.
+        @params halt: Halts the machine before hardresetting.
         @params **wait_for_restart_kwargs: keyword arguments passed to
                 wait_for_restart()
         """
@@ -138,6 +139,8 @@
             old_boot_id = 'unknown boot_id prior to SerialHost.hardreset'
 
         def reboot():
+            if halt:
+                self.halt()
             if not self.run_conmux(conmux_command):
                 self.record("ABORT", None, "reboot.start",
                             "hard reset unavailable")