summaryrefslogtreecommitdiffstats
path: root/chromium/build/fuchsia/qemu_image.py
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-12 14:27:29 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-13 09:35:20 +0000
commitc30a6232df03e1efbd9f3b226777b07e087a1122 (patch)
treee992f45784689f373bcc38d1b79a239ebe17ee23 /chromium/build/fuchsia/qemu_image.py
parent7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3 (diff)
BASELINE: Update Chromium to 85.0.4183.14085-based
Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/build/fuchsia/qemu_image.py')
-rw-r--r--chromium/build/fuchsia/qemu_image.py16
1 files changed, 13 insertions, 3 deletions
diff --git a/chromium/build/fuchsia/qemu_image.py b/chromium/build/fuchsia/qemu_image.py
index 5126074fe02..ab5e040acbd 100644
--- a/chromium/build/fuchsia/qemu_image.py
+++ b/chromium/build/fuchsia/qemu_image.py
@@ -18,6 +18,7 @@ TODO(crbug.com/1046861): Remove this workaround when the bug is fixed.
import logging
import subprocess
+import tempfile
import time
@@ -33,7 +34,9 @@ def _ExecQemuImgWithTimeout(command):
"""
logging.info('qemu-img starting')
- p = subprocess.Popen(command)
+ command_output_file = tempfile.NamedTemporaryFile('w')
+ p = subprocess.Popen(command, stdout=command_output_file,
+ stderr=subprocess.STDOUT)
start_sec = time.time()
while p.poll() is None and time.time() - start_sec < QEMU_IMG_TIMEOUT_SEC:
time.sleep(1)
@@ -41,10 +44,17 @@ def _ExecQemuImgWithTimeout(command):
logging.info('qemu-img duration: %f' % float(stop_sec - start_sec))
if p.poll() is None:
+ returncode = None
p.kill()
- return None
+ p.wait()
+ else:
+ returncode = p.returncode
- return p.returncode
+ log_level = logging.WARN if returncode else logging.DEBUG
+ for line in open(command_output_file.name, 'r'):
+ logging.log(log_level, 'qemu-img stdout: ' + line.strip())
+
+ return returncode
def ExecQemuImgWithRetry(command):