Skip to contentSkip to conversation

runqemu: output qemu-system errors

PATCH New Ed Bartosh 1 participant 1 message May 26, 2017

lore
Share & tools
lore

Ed Bartosh

author
#0 lore raw

PATCH 1/1 runqemu: output qemu-system errors

Included error output from qemu-system into the runqemu error message. Made error output more visible by printing new line before it.

[YOCTO #11542]

---
 scripts/runqemu | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
scripts/runqemu +4 -3
index 72c4176..0039b83 100755
@@ -1137,9 +1137,10 @@ class BaseConfig(object):
         else:
             kernel_opts = ""
         cmd = "%s %s" % (self.qemu_opt, kernel_opts)
-        logger.info('Running %s' % cmd)
-        if subprocess.call(cmd, shell=True) != 0:
-            raise Exception('Failed to run %s' % cmd)
+        logger.info('Running %s\n' % cmd)
+        process = subprocess.Popen(cmd, shell=True, stderr=subprocess.PIPE)
+        if process.wait():
+            logger.error("Failed to run qemu: %s", process.stderr.read().decode())
 
     def cleanup(self):
         if self.cleantap:
Signature · 1 line
2.1.4