]> code.ossystems Code Review - openembedded-core.git/commitdiff
runqemu: exit gracefully with an error message if qemu system is not evaluated
authorJagadeesh Krishnanjanappa <jkrishnanjanappa@mvista.com>
Tue, 14 Aug 2018 14:35:29 +0000 (20:05 +0530)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 15 Aug 2018 08:33:53 +0000 (09:33 +0100)
It solves below error:
-- snip --
return 'qemu-system-%s' % qbsys
UnboundLocalError: local variable 'qbsys' referenced before assignment
-- snip --

[YOCTO #12846]

Signed-off-by: Jagadeesh Krishnanjanappa <jkrishnanjanappa@mvista.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/runqemu

index f52b9a82ea745bb05f3a597340b0fc4b2f4aca7e..409d17c64881e9752426416c8d71f88461ab1bf0 100755 (executable)
@@ -1118,6 +1118,11 @@ class BaseConfig(object):
             qbsys = 'riscv64'
         elif mach == 'qemuriscv32':
             qbsys = 'riscv32'
+        else:
+            logger.error("Unable to determine QEMU PC System emulator for %s machine." % mach)
+            logger.error("As %s is not among valid QEMU machines such as," % mach)
+            logger.error("qemux86-64, qemux86, qemuarm64, qemuarm, qemumips64, qemumips64el, qemumipsel, qemumips, qemuppc")
+            raise RunQemuError("Set qb_system_name with suitable QEMU PC System emulator in .*qemuboot.conf.")
 
         return 'qemu-system-%s' % qbsys