[OE-core] [PATCH 2/2] runqemu: let qemuparams override previous settings
Robert Yang
liezhi.yang at windriver.com
Mon Sep 11 09:28:07 UTC 2017
Fixed:
$ runqemu qemux86-64 qemuparams="-cpu coreduo"
The default cpu is core2duo, but coreduo should be used here.
Append qemuparams to the last can fix the problem.
[YOCTO #11773]
Signed-off-by: Robert Yang <liezhi.yang at windriver.com>
---
scripts/runqemu | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/scripts/runqemu b/scripts/runqemu
index ce8cccc..b58c965 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -185,6 +185,7 @@ class BaseConfig(object):
self.qemu_opt = ''
self.qemu_opt_script = ''
+ self.qemuparams = ''
self.clean_nfs_dir = False
self.nfs_server = ''
self.rootfs = ''
@@ -444,7 +445,7 @@ class BaseConfig(object):
elif arg.startswith('biosfilename='):
self.qemu_opt_script += ' -bios %s' % arg[len('biosfilename='):]
elif arg.startswith('qemuparams='):
- self.qemu_opt_script += ' %s' % arg[len('qemuparams='):]
+ self.qemuparams = ' %s' % arg[len('qemuparams='):]
elif arg.startswith('bootparams='):
self.bootparams = arg[len('bootparams='):]
elif os.path.exists(arg) or (re.search(':', arg) and re.search('/', arg)):
@@ -635,10 +636,12 @@ class BaseConfig(object):
raise RunQemuError("Invalid custombiosdir: %s" % self.custombiosdir)
def check_mem(self):
- s = re.search('-m +([0-9]+)', self.qemu_opt_script)
- if s:
- self.set('QB_MEM', '-m %s' % s.group(1))
- elif not self.get('QB_MEM'):
+ for opt in (self.qemu_opt_script, self.qemuparams):
+ s = re.search('-m +([0-9]+)', opt)
+ if s:
+ self.set('QB_MEM', '-m %s' % s.group(1))
+
+ if not self.get('QB_MEM'):
mach = self.get('MACHINE')
if mach.startswith('qemumips'):
logger.info('QB_MEM is not set, use 256M by default')
@@ -1125,6 +1128,10 @@ class BaseConfig(object):
self.qemu_opt += ' ' + self.qemu_opt_script
+ # Append qemuparams to override previous settings
+ if self.qemuparams:
+ self.qemu_opt += ' ' + self.qemuparams
+
if self.snapshot:
self.qemu_opt += " -snapshot"
--
2.10.2
More information about the Openembedded-core
mailing list