summaryrefslogtreecommitdiffstats
path: root/scripts/runqemu
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/runqemu')
-rwxr-xr-xscripts/runqemu33
1 files changed, 26 insertions, 7 deletions
diff --git a/scripts/runqemu b/scripts/runqemu
index 2f77a7bd0f..36af764b1b 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -1363,13 +1363,27 @@ class BaseConfig(object):
1363 if (self.gl_es == True or self.gl == True) and (self.sdl == False and self.gtk == False): 1363 if (self.gl_es == True or self.gl == True) and (self.sdl == False and self.gtk == False):
1364 raise RunQemuError('Option gl/gl-es needs gtk or sdl option.') 1364 raise RunQemuError('Option gl/gl-es needs gtk or sdl option.')
1365 1365
1366 if self.sdl == True or self.gtk == True or self.egl_headless == True: 1366 # If we have no display option, we autodetect based upon what qemu supports. We
1367 if self.gl or self.gl_es or self.egl_headless: 1367 # need our font setup and show-cusor below so we need to see what qemu --help says
1368 self.qemu_opt += ' -device virtio-vga-gl ' 1368 # is supported so we can pass our correct config in.
1369 if not self.nographic and not self.sdl and not self.gtk and not self.egl_headless == True:
1370 output = subprocess.check_output([self.qemu_bin, "--help"], universal_newlines=True)
1371 if "-display gtk" in output:
1372 self.gtk = True
1373 elif "-display sdl" in output:
1374 self.sdl = True
1369 else: 1375 else:
1370 self.qemu_opt += ' -device virtio-vga ' 1376 self.qemu_opt += '-display none'
1371 1377
1372 self.qemu_opt += '-display ' 1378 if self.sdl == True or self.gtk == True or self.egl_headless == True:
1379
1380 if self.qemu_system.endswith(('i386', 'x86_64')):
1381 if self.gl or self.gl_es or self.egl_headless:
1382 self.qemu_opt += ' -device virtio-vga-gl '
1383 else:
1384 self.qemu_opt += ' -device virtio-vga '
1385
1386 self.qemu_opt += ' -display '
1373 if self.egl_headless == True: 1387 if self.egl_headless == True:
1374 self.set_dri_path() 1388 self.set_dri_path()
1375 self.qemu_opt += 'egl-headless,' 1389 self.qemu_opt += 'egl-headless,'
@@ -1415,7 +1429,7 @@ class BaseConfig(object):
1415 if serial_num < 2: 1429 if serial_num < 2:
1416 self.qemu_opt += " -serial null" 1430 self.qemu_opt += " -serial null"
1417 1431
1418 def setup_final(self): 1432 def find_qemu(self):
1419 qemu_bin = os.path.join(self.bindir_native, self.qemu_system) 1433 qemu_bin = os.path.join(self.bindir_native, self.qemu_system)
1420 1434
1421 # It is possible to have qemu-native in ASSUME_PROVIDED, and it won't 1435 # It is possible to have qemu-native in ASSUME_PROVIDED, and it won't
@@ -1434,8 +1448,13 @@ class BaseConfig(object):
1434 1448
1435 if not os.access(qemu_bin, os.X_OK): 1449 if not os.access(qemu_bin, os.X_OK):
1436 raise OEPathError("No QEMU binary '%s' could be found" % qemu_bin) 1450 raise OEPathError("No QEMU binary '%s' could be found" % qemu_bin)
1451 self.qemu_bin = qemu_bin
1452
1453 def setup_final(self):
1454
1455 self.find_qemu()
1437 1456
1438 self.qemu_opt = "%s %s %s %s %s" % (qemu_bin, self.get('NETWORK_CMD'), self.get('QB_RNG'), self.get('ROOTFS_OPTIONS'), self.get('QB_OPT_APPEND').replace('@DEPLOY_DIR_IMAGE@', self.get('DEPLOY_DIR_IMAGE'))) 1457 self.qemu_opt = "%s %s %s %s %s" % (self.qemu_bin, self.get('NETWORK_CMD'), self.get('QB_RNG'), self.get('ROOTFS_OPTIONS'), self.get('QB_OPT_APPEND').replace('@DEPLOY_DIR_IMAGE@', self.get('DEPLOY_DIR_IMAGE')))
1439 1458
1440 for ovmf in self.ovmf_bios: 1459 for ovmf in self.ovmf_bios:
1441 format = ovmf.rsplit('.', 1)[-1] 1460 format = ovmf.rsplit('.', 1)[-1]