summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xscripts/runqemu22
1 files changed, 13 insertions, 9 deletions
diff --git a/scripts/runqemu b/scripts/runqemu
index 39bed038d5..5752ecda73 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -491,12 +491,13 @@ class BaseConfig(object):
491 yocto_paravirt_kvm_wiki = "https://wiki.yoctoproject.org/wiki/Running_an_x86_Yocto_Linux_image_under_QEMU_KVM" 491 yocto_paravirt_kvm_wiki = "https://wiki.yoctoproject.org/wiki/Running_an_x86_Yocto_Linux_image_under_QEMU_KVM"
492 dev_kvm = '/dev/kvm' 492 dev_kvm = '/dev/kvm'
493 dev_vhost = '/dev/vhost-net' 493 dev_vhost = '/dev/vhost-net'
494 with open('/proc/cpuinfo', 'r') as f: 494 if self.qemu_system.endswith(('i386', 'x86_64')):
495 kvm_cap = re.search('vmx|svm', "".join(f.readlines())) 495 with open('/proc/cpuinfo', 'r') as f:
496 if not kvm_cap: 496 kvm_cap = re.search('vmx|svm', "".join(f.readlines()))
497 logger.error("You are trying to enable KVM on a cpu without VT support.") 497 if not kvm_cap:
498 logger.error("Remove kvm from the command-line, or refer:") 498 logger.error("You are trying to enable KVM on a cpu without VT support.")
499 raise RunQemuError(yocto_kvm_wiki) 499 logger.error("Remove kvm from the command-line, or refer:")
500 raise RunQemuError(yocto_kvm_wiki)
500 501
501 if not os.path.exists(dev_kvm): 502 if not os.path.exists(dev_kvm):
502 logger.error("Missing KVM device. Have you inserted kvm modules?") 503 logger.error("Missing KVM device. Have you inserted kvm modules?")
@@ -703,6 +704,7 @@ class BaseConfig(object):
703 else: 704 else:
704 os.putenv('QEMU_AUDIO_DRV', 'none') 705 os.putenv('QEMU_AUDIO_DRV', 'none')
705 706
707 self.check_qemu_system()
706 self.check_kvm() 708 self.check_kvm()
707 self.check_fstype() 709 self.check_fstype()
708 self.check_rootfs() 710 self.check_rootfs()
@@ -1128,21 +1130,23 @@ class BaseConfig(object):
1128 1130
1129 return 'qemu-system-%s' % qbsys 1131 return 'qemu-system-%s' % qbsys
1130 1132
1131 def setup_final(self): 1133 def check_qemu_system(self):
1132 qemu_system = self.get('QB_SYSTEM_NAME') 1134 qemu_system = self.get('QB_SYSTEM_NAME')
1133 if not qemu_system: 1135 if not qemu_system:
1134 qemu_system = self.guess_qb_system() 1136 qemu_system = self.guess_qb_system()
1135 if not qemu_system: 1137 if not qemu_system:
1136 raise RunQemuError("Failed to boot, QB_SYSTEM_NAME is NULL!") 1138 raise RunQemuError("Failed to boot, QB_SYSTEM_NAME is NULL!")
1139 self.qemu_system = qemu_system
1137 1140
1138 qemu_bin = os.path.join(self.bindir_native, qemu_system) 1141 def setup_final(self):
1142 qemu_bin = os.path.join(self.bindir_native, self.qemu_system)
1139 1143
1140 # It is possible to have qemu-native in ASSUME_PROVIDED, and it won't 1144 # It is possible to have qemu-native in ASSUME_PROVIDED, and it won't
1141 # find QEMU in sysroot, it needs to use host's qemu. 1145 # find QEMU in sysroot, it needs to use host's qemu.
1142 if not os.path.exists(qemu_bin): 1146 if not os.path.exists(qemu_bin):
1143 logger.info("QEMU binary not found in %s, trying host's QEMU" % qemu_bin) 1147 logger.info("QEMU binary not found in %s, trying host's QEMU" % qemu_bin)
1144 for path in (os.environ['PATH'] or '').split(':'): 1148 for path in (os.environ['PATH'] or '').split(':'):
1145 qemu_bin_tmp = os.path.join(path, qemu_system) 1149 qemu_bin_tmp = os.path.join(path, self.qemu_system)
1146 logger.info("Trying: %s" % qemu_bin_tmp) 1150 logger.info("Trying: %s" % qemu_bin_tmp)
1147 if os.path.exists(qemu_bin_tmp): 1151 if os.path.exists(qemu_bin_tmp):
1148 qemu_bin = qemu_bin_tmp 1152 qemu_bin = qemu_bin_tmp