Skip to contentSkip to conversation

runqemu: Check gtk or sdl option is passed together with gl or gl-es options.

PATCH In review Vasyl Vavrychuk 2 participants 2 messages Aug 17, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 runqemu: Check gtk or sdl option is passed together with gl or gl-es options.

runqemu help reports that gtk or sdl option is needed with gl or gl-es option. But if user forgot to add gtk or sdl option, then gl or gl-es options were silently skipped.

---
 scripts/runqemu | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
scripts/runqemu +2 -1
index 310d79fdc5..398f0a0910 100755
@@ -454,7 +454,8 @@ class BaseConfig(object):
                     self.qemu_opt_script += ' -display gtk'
             elif arg == 'gl' or arg == 'gl-es':
                 # These args are handled inside sdl or gtk blocks above
-                pass
+                if ('gtk' not in sys.argv) and ('sdl' not in sys.argv):
+                    raise RunQemuError('Option %s also needs gtk or sdl option.' % (arg))
             elif arg == 'egl-headless':
                 self.qemu_opt_script += ' -vga virtio -display egl-headless'
                 # As runqemu can be run within bitbake (when using testimage, for example),
Signature · 1 line
2.23.0
#1 lore raw

Thank you for the patch - it needs to go to
[email protected]

Alex

Quoted 31 lines · Vasyl Vavrychuk

runqemu help reports that gtk or sdl option is needed with gl or gl-es option. But if user forgot to add gtk or sdl option, then gl or gl-es options were silently skipped.

---
 scripts/runqemu | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
scripts/runqemu +2 -1
index 310d79fdc5..398f0a0910 100755
@@ -454,7 +454,8 @@ class BaseConfig(object):
                     self.qemu_opt_script += ' -display gtk'
             elif arg == 'gl' or arg == 'gl-es':
                 # These args are handled inside sdl or gtk blocks above
-                pass
+                if ('gtk' not in sys.argv) and ('sdl' not in sys.argv):
+                    raise RunQemuError('Option %s also needs gtk or sdl
 option.' % (arg))
             elif arg == 'egl-headless':
                 self.qemu_opt_script += ' -vga virtio -display

egl-headless'
# As runqemu can be run within bitbake (when using
testimage, for example),
--
2.23.0