Skip to contentSkip to conversation

runqemu: Change virtio-vga to virtio-gpu.

PATCH In review Vasyl Vavrychuk 3 participants 7 messages Aug 30, 2020 – Nov 5, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 runqemu: Change virtio-vga to virtio-gpu.

virtio-vga is available in QEMU only for hppa, i386, and ppc architectures. On the other hand, virtio-gpu is available for all architectures.

---
 scripts/runqemu | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
scripts/runqemu +5 -5
index 7fb5f7db57..5d6b35ffe4 100755
@@ -461,19 +461,19 @@ class BaseConfig(object):
             elif arg == 'sdl':
                 if 'gl' in sys.argv[1:]:
                     self.set_dri_path()
-                    self.qemu_opt_script += ' -vga virtio -display sdl,gl=on,show-cursor=on'
+                    self.qemu_opt_script += ' -device virtio-gpu -display sdl,gl=on,show-cursor=on'
                 elif 'gl-es' in sys.argv[1:]:
                     self.set_dri_path()
-                    self.qemu_opt_script += ' -vga virtio -display sdl,gl=es,show-cursor=on'
+                    self.qemu_opt_script += ' -device virtio-gpu -display sdl,gl=es,show-cursor=on'
                 else:
                     self.qemu_opt_script += ' -display sdl,show-cursor=on'
             elif arg == 'gtk':
                 if 'gl' in sys.argv[1:]:
                     self.set_dri_path()
-                    self.qemu_opt_script += ' -vga virtio -display gtk,gl=on,show-cursor=on'
+                    self.qemu_opt_script += ' -device virtio-gpu -display gtk,gl=on,show-cursor=on'
                 elif 'gl-es' in sys.argv[1:]:
                     self.set_dri_path()
-                    self.qemu_opt_script += ' -vga virtio -display gtk,gl=es,show-cursor=on'
+                    self.qemu_opt_script += ' -device virtio-gpu -display gtk,gl=es,show-cursor=on'
                 else:
                     self.qemu_opt_script += ' -display gtk,show-cursor=on'
             elif arg == 'gl' or arg == 'gl-es':
@@ -482,7 +482,7 @@ class BaseConfig(object):
                     raise RunQemuError('Option %s also needs gtk or sdl option.' % (arg))
             elif arg == 'egl-headless':
                 self.set_dri_path()
-                self.qemu_opt_script += ' -vga virtio -display egl-headless,show-cursor=on'
+                self.qemu_opt_script += ' -device virtio-gpu -display egl-headless,show-cursor=on'
             elif arg == 'serial':
                 self.kernel_cmdline_script += ' console=ttyS0'
                 self.serialconsole = True
Signature · 1 line
2.23.0
#1 lore raw

Do the virgl selftests still pass with this change? Please run

oe-selftest -r runtime_test.TestImage.test_testimage_virgl_gtk_sdl

and

oe-selftest -r runtime_test.TestImage.test_testimage_virgl_headless

Alex

Quoted 62 lines · Vasyl Vavrychuk

virtio-vga is available in QEMU only for hppa, i386, and ppc architectures. On the other hand, virtio-gpu is available for all architectures.

---
 scripts/runqemu | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
scripts/runqemu +0 -1
index 7fb5f7db57..5d6b35ffe4 100755
@@ -461,19 +461,19 @@ class BaseConfig(object):
             elif arg == 'sdl':
                 if 'gl' in sys.argv[1:]:
                     self.set_dri_path()
-                    self.qemu_opt_script += ' -vga virtio -display

sdl,gl=on,show-cursor=on'
+ self.qemu_opt_script += ' -device virtio-gpu -display
sdl,gl=on,show-cursor=on'

                 elif 'gl-es' in sys.argv[1:]:
                     self.set_dri_path()

- self.qemu_opt_script += ' -vga virtio -display
sdl,gl=es,show-cursor=on'
+ self.qemu_opt_script += ' -device virtio-gpu -display
sdl,gl=es,show-cursor=on'

                 else:
                     self.qemu_opt_script += ' -display sdl,show-cursor=on'
             elif arg == 'gtk':
                 if 'gl' in sys.argv[1:]:
                     self.set_dri_path()

- self.qemu_opt_script += ' -vga virtio -display
gtk,gl=on,show-cursor=on'
+ self.qemu_opt_script += ' -device virtio-gpu -display
gtk,gl=on,show-cursor=on'

                 elif 'gl-es' in sys.argv[1:]:
                     self.set_dri_path()

- self.qemu_opt_script += ' -vga virtio -display
gtk,gl=es,show-cursor=on'
+ self.qemu_opt_script += ' -device virtio-gpu -display
gtk,gl=es,show-cursor=on'

                 else:
                     self.qemu_opt_script += ' -display gtk,show-cursor=on'
             elif arg == 'gl' or arg == 'gl-es':
scripts/runqemu +0 -1
@@ -482,7 +482,7 @@ class BaseConfig(object):
                     raise RunQemuError('Option %s also needs gtk or sdl
 option.' % (arg))
             elif arg == 'egl-headless':
                 self.set_dri_path()
-                self.qemu_opt_script += ' -vga virtio -display

egl-headless,show-cursor=on'
+ self.qemu_opt_script += ' -device virtio-gpu -display
egl-headless,show-cursor=on'

             elif arg == 'serial':
                 self.kernel_cmdline_script += ' console=ttyS0'
                 self.serialconsole = True

--
2.23.0

#2 lore raw

Hi, Alexander,

I am trying to run oe-selftest.

I have one question. Is there a way to run oe-selftest incrementally?

Because for now, if I run oe-selftest second time I get

oe-selftest - ERROR - Build directory ... already exists, aborting

Then, I should remove build-st, and only after that oe-selftest can run second time. But it take a lot of time.

Could you please help me?

Thanks,
Vasyl

Quoted 64 lines · Alexander Kanavin

Do the virgl selftests still pass with this change? Please run

oe-selftest -r runtime_test.TestImage.test_testimage_virgl_gtk_sdl

and

oe-selftest -r runtime_test.TestImage.test_testimage_virgl_headless

Alex

Quoted 51 lines · Vasyl Vavrychuk

virtio-vga is available in QEMU only for hppa, i386, and ppc architectures. On the other hand, virtio-gpu is available for all architectures.

---
 scripts/runqemu | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
scripts/runqemu +5 -6
index 7fb5f7db57..5d6b35ffe4 100755
@@ -461,19 +461,19 @@ class BaseConfig(object):
             elif arg == 'sdl':
                 if 'gl' in sys.argv[1:]:
                     self.set_dri_path()
-                    self.qemu_opt_script += ' -vga virtio -display sdl,gl=on,show-cursor=on'
+                    self.qemu_opt_script += ' -device virtio-gpu -display sdl,gl=on,show-cursor=on'
                 elif 'gl-es' in sys.argv[1:]:
                     self.set_dri_path()
-                    self.qemu_opt_script += ' -vga virtio -display sdl,gl=es,show-cursor=on'
+                    self.qemu_opt_script += ' -device virtio-gpu -display sdl,gl=es,show-cursor=on'
                 else:
                     self.qemu_opt_script += ' -display sdl,show-cursor=on'
             elif arg == 'gtk':
                 if 'gl' in sys.argv[1:]:
                     self.set_dri_path()
-                    self.qemu_opt_script += ' -vga virtio -display gtk,gl=on,show-cursor=on'
+                    self.qemu_opt_script += ' -device virtio-gpu -display gtk,gl=on,show-cursor=on'
                 elif 'gl-es' in sys.argv[1:]:
                     self.set_dri_path()
-                    self.qemu_opt_script += ' -vga virtio -display gtk,gl=es,show-cursor=on'
+                    self.qemu_opt_script += ' -device virtio-gpu -display gtk,gl=es,show-cursor=on'
                 else:
                     self.qemu_opt_script += ' -display gtk,show-cursor=on'
             elif arg == 'gl' or arg == 'gl-es':
@@ -482,7 +482,7 @@ class BaseConfig(object):
                     raise RunQemuError('Option %s also needs gtk or sdl option.' % (arg))
             elif arg == 'egl-headless':
                 self.set_dri_path()
-                self.qemu_opt_script += ' -vga virtio -display egl-headless,show-cursor=on'
+                self.qemu_opt_script += ' -device virtio-gpu -display egl-headless,show-cursor=on'
             elif arg == 'serial':
                 self.kernel_cmdline_script += ' console=ttyS0'
                 self.serialconsole = True
--

2.23.0

#3 lore raw

I think you first need to set up a build directory to use sstate-cache in some common location, then build-st will pick it up, and you can then easily delete it without destroying the cache.

Alex

Quoted 99 lines · Vasyl Vavrychuk

Hi, Alexander,

I am trying to run oe-selftest.

I have one question. Is there a way to run oe-selftest incrementally?

Because for now, if I run oe-selftest second time I get

oe-selftest - ERROR - Build directory ... already exists, aborting

Then, I should remove build-st, and only after that oe-selftest can run second time. But it take a lot of time.

Could you please help me?

Thanks,
Vasyl

Quoted 13 lines · Alexander Kanavin

Do the virgl selftests still pass with this change? Please run

oe-selftest -r runtime_test.TestImage.test_testimage_virgl_gtk_sdl

and

oe-selftest -r runtime_test.TestImage.test_testimage_virgl_headless

Alex

On Sun, 30 Aug 2020 at 22:15, Vasyl Vavrychuk <[email protected]>

Quoted 10 lines · wrote:
Quoted 10 lines

virtio-vga is available in QEMU only for hppa, i386, and ppc architectures. On the other hand, virtio-gpu is available for all architectures.

---
 scripts/runqemu | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
Quoted 9 lines

scripts/runqemu class BaseConfig(object): · line 464

Quoted 9 lines
scripts/runqemu +0 -1
index 7fb5f7db57..5d6b35ffe4 100755
@@ -461,19 +461,19 @@ class BaseConfig(object):
             elif arg == 'sdl':
                 if 'gl' in sys.argv[1:]:
                     self.set_dri_path()
-                    self.qemu_opt_script += ' -vga virtio -display

sdl,gl=on,show-cursor=on'

Quoted 1 line

scripts/runqemu class BaseConfig(object): · line 464

Quoted 1 line
scripts/runqemu +1 -0
+                    self.qemu_opt_script += ' -device virtio-gpu

-display sdl,gl=on,show-cursor=on'

Quoted 3 lines

scripts/runqemu class BaseConfig(object):

Quoted 3 lines
scripts/runqemu +0 -1
                 elif 'gl-es' in sys.argv[1:]:
                     self.set_dri_path()
-                    self.qemu_opt_script += ' -vga virtio -display

sdl,gl=es,show-cursor=on'

Quoted 1 line

scripts/runqemu class BaseConfig(object): · line 467

Quoted 1 line
scripts/runqemu +1 -0
+                    self.qemu_opt_script += ' -device virtio-gpu

-display sdl,gl=es,show-cursor=on'

Quoted 2 lines

scripts/runqemu class BaseConfig(object): · line 469

Quoted 2 lines
scripts/runqemu +0 -0
                 else:
                     self.qemu_opt_script += ' -display

sdl,show-cursor=on'

Quoted 4 lines

scripts/runqemu class BaseConfig(object):

Quoted 4 lines
scripts/runqemu +0 -1
             elif arg == 'gtk':
                 if 'gl' in sys.argv[1:]:
                     self.set_dri_path()
-                    self.qemu_opt_script += ' -vga virtio -display

gtk,gl=on,show-cursor=on'

Quoted 1 line

scripts/runqemu class BaseConfig(object): · line 473

Quoted 1 line
scripts/runqemu +1 -0
+                    self.qemu_opt_script += ' -device virtio-gpu

-display gtk,gl=on,show-cursor=on'

Quoted 3 lines

scripts/runqemu class BaseConfig(object):

Quoted 3 lines
scripts/runqemu +0 -1
                 elif 'gl-es' in sys.argv[1:]:
                     self.set_dri_path()
-                    self.qemu_opt_script += ' -vga virtio -display

gtk,gl=es,show-cursor=on'

Quoted 1 line

scripts/runqemu class BaseConfig(object): · line 476

Quoted 1 line
scripts/runqemu +1 -0
+                    self.qemu_opt_script += ' -device virtio-gpu

-display gtk,gl=es,show-cursor=on'

Quoted 2 lines

scripts/runqemu class BaseConfig(object): · line 478

Quoted 2 lines
scripts/runqemu +0 -0
                 else:
                     self.qemu_opt_script += ' -display

gtk,show-cursor=on'

Quoted 3 lines

scripts/runqemu class BaseConfig(object): · line 482

Quoted 3 lines
scripts/runqemu +0 -0
             elif arg == 'gl' or arg == 'gl-es':
@@ -482,7 +482,7 @@ class BaseConfig(object):
                     raise RunQemuError('Option %s also needs gtk or

sdl option.' % (arg))

Quoted 3 lines

scripts/runqemu class BaseConfig(object):

Quoted 3 lines
scripts/runqemu +0 -1
             elif arg == 'egl-headless':
                 self.set_dri_path()
-                self.qemu_opt_script += ' -vga virtio -display

egl-headless,show-cursor=on'

Quoted 1 line

scripts/runqemu class BaseConfig(object): · line 485

Quoted 1 line
scripts/runqemu +1 -0
+                self.qemu_opt_script += ' -device virtio-gpu -display

egl-headless,show-cursor=on'

Quoted 7 lines
Quoted 7 lines
scripts/runqemu +0 -1
             elif arg == 'serial':
                 self.kernel_cmdline_script += ' console=ttyS0'
                 self.serialconsole = True
--

2.23.0

#4 lore raw
Quoted 3 lines · Alexander Kanavin

I think you first need to set up a build directory to use sstate- cache in some common location, then build-st will pick it up, and you can then easily delete it without destroying the cache.

You can do something like the patch below. I would warn that the tests assume clean directories so you have to be careful doing this though.

Cheers,

Richard

Subject: HACK:selftest/context: Allow reuse of existing build directory

---
 meta/lib/oeqa/selftest/context.py | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
meta/lib/oeqa/selftest/context.py +8 -4
index dd3609c1d6..3a2447d026 100644
@@ -73,12 +73,16 @@ class OESelftestTestContext(OETestContext):
         newselftestdir = newbuilddir + "/meta-selftest"
 
         if os.path.exists(newbuilddir):
-            self.logger.error("Build directory %s already exists, aborting" % newbuilddir)
-            sys.exit(1)
+        #    self.logger.error("Build directory %s already exists, aborting" % newbuilddir)
+        #    sys.exit(1)
+            bb.utils.prunedir(newselftestdir)
+            bb.utils.prunedir(newbuilddir + "/conf")
+
+        if not os.path.exists(newbuilddir):
+            bb.utils.mkdirhier(newbuilddir)
+            oe.path.copytree(builddir + "/cache", newbuilddir + "/cache")
 
-        bb.utils.mkdirhier(newbuilddir)
         oe.path.copytree(builddir + "/conf", newbuilddir + "/conf")
-        oe.path.copytree(builddir + "/cache", newbuilddir + "/cache")
         oe.path.copytree(selftestdir, newselftestdir)
 
         for e in os.environ:
#5 lore raw
In reply to Alexander Kanavin

Which MACHINE do you want me to test? _Without_ may changes test

oe-selftest -r runtime_test.TestImage.test_testimage_virgl_gtk_sdl

fails for qemuarm64 MACHINE with

qemu-system-aarch64: Virtio VGA not available

Quoted 64 lines · Alexander Kanavin

Do the virgl selftests still pass with this change? Please run

oe-selftest -r runtime_test.TestImage.test_testimage_virgl_gtk_sdl

and

oe-selftest -r runtime_test.TestImage.test_testimage_virgl_headless

Alex

Quoted 51 lines · Vasyl Vavrychuk

virtio-vga is available in QEMU only for hppa, i386, and ppc architectures. On the other hand, virtio-gpu is available for all architectures.

---
 scripts/runqemu | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
scripts/runqemu +5 -6
index 7fb5f7db57..5d6b35ffe4 100755
@@ -461,19 +461,19 @@ class BaseConfig(object):
             elif arg == 'sdl':
                 if 'gl' in sys.argv[1:]:
                     self.set_dri_path()
-                    self.qemu_opt_script += ' -vga virtio -display sdl,gl=on,show-cursor=on'
+                    self.qemu_opt_script += ' -device virtio-gpu -display sdl,gl=on,show-cursor=on'
                 elif 'gl-es' in sys.argv[1:]:
                     self.set_dri_path()
-                    self.qemu_opt_script += ' -vga virtio -display sdl,gl=es,show-cursor=on'
+                    self.qemu_opt_script += ' -device virtio-gpu -display sdl,gl=es,show-cursor=on'
                 else:
                     self.qemu_opt_script += ' -display sdl,show-cursor=on'
             elif arg == 'gtk':
                 if 'gl' in sys.argv[1:]:
                     self.set_dri_path()
-                    self.qemu_opt_script += ' -vga virtio -display gtk,gl=on,show-cursor=on'
+                    self.qemu_opt_script += ' -device virtio-gpu -display gtk,gl=on,show-cursor=on'
                 elif 'gl-es' in sys.argv[1:]:
                     self.set_dri_path()
-                    self.qemu_opt_script += ' -vga virtio -display gtk,gl=es,show-cursor=on'
+                    self.qemu_opt_script += ' -device virtio-gpu -display gtk,gl=es,show-cursor=on'
                 else:
                     self.qemu_opt_script += ' -display gtk,show-cursor=on'
             elif arg == 'gl' or arg == 'gl-es':
@@ -482,7 +482,7 @@ class BaseConfig(object):
                     raise RunQemuError('Option %s also needs gtk or sdl option.' % (arg))
             elif arg == 'egl-headless':
                 self.set_dri_path()
-                self.qemu_opt_script += ' -vga virtio -display egl-headless,show-cursor=on'
+                self.qemu_opt_script += ' -device virtio-gpu -display egl-headless,show-cursor=on'
             elif arg == 'serial':
                 self.kernel_cmdline_script += ' console=ttyS0'
                 self.serialconsole = True
--

2.23.0

#6 lore raw

Checking x86_64 and aarch64 would be fine (aarch64 may fail for other reasons, but x86_64 should keep working).

Alex

Quoted 89 lines · Vasyl Vavrychuk

Which MACHINE do you want me to test? _Without_ may changes test

oe-selftest -r runtime_test.TestImage.test_testimage_virgl_gtk_sdl

fails for qemuarm64 MACHINE with

qemu-system-aarch64: Virtio VGA not available

Quoted 13 lines · Alexander Kanavin

Do the virgl selftests still pass with this change? Please run

oe-selftest -r runtime_test.TestImage.test_testimage_virgl_gtk_sdl

and

oe-selftest -r runtime_test.TestImage.test_testimage_virgl_headless

Alex

On Sun, 30 Aug 2020 at 22:15, Vasyl Vavrychuk <[email protected]>

Quoted 10 lines · wrote:
Quoted 10 lines

virtio-vga is available in QEMU only for hppa, i386, and ppc architectures. On the other hand, virtio-gpu is available for all architectures.

---
 scripts/runqemu | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
Quoted 9 lines

scripts/runqemu class BaseConfig(object): · line 464

Quoted 9 lines
scripts/runqemu +0 -1
index 7fb5f7db57..5d6b35ffe4 100755
@@ -461,19 +461,19 @@ class BaseConfig(object):
             elif arg == 'sdl':
                 if 'gl' in sys.argv[1:]:
                     self.set_dri_path()
-                    self.qemu_opt_script += ' -vga virtio -display

sdl,gl=on,show-cursor=on'

Quoted 1 line

scripts/runqemu class BaseConfig(object): · line 464

Quoted 1 line
scripts/runqemu +1 -0
+                    self.qemu_opt_script += ' -device virtio-gpu

-display sdl,gl=on,show-cursor=on'

Quoted 3 lines

scripts/runqemu class BaseConfig(object):

Quoted 3 lines
scripts/runqemu +0 -1
                 elif 'gl-es' in sys.argv[1:]:
                     self.set_dri_path()
-                    self.qemu_opt_script += ' -vga virtio -display

sdl,gl=es,show-cursor=on'

Quoted 1 line

scripts/runqemu class BaseConfig(object): · line 467

Quoted 1 line
scripts/runqemu +1 -0
+                    self.qemu_opt_script += ' -device virtio-gpu

-display sdl,gl=es,show-cursor=on'

Quoted 2 lines

scripts/runqemu class BaseConfig(object): · line 469

Quoted 2 lines
scripts/runqemu +0 -0
                 else:
                     self.qemu_opt_script += ' -display

sdl,show-cursor=on'

Quoted 4 lines

scripts/runqemu class BaseConfig(object):

Quoted 4 lines
scripts/runqemu +0 -1
             elif arg == 'gtk':
                 if 'gl' in sys.argv[1:]:
                     self.set_dri_path()
-                    self.qemu_opt_script += ' -vga virtio -display

gtk,gl=on,show-cursor=on'

Quoted 1 line

scripts/runqemu class BaseConfig(object): · line 473

Quoted 1 line
scripts/runqemu +1 -0
+                    self.qemu_opt_script += ' -device virtio-gpu

-display gtk,gl=on,show-cursor=on'

Quoted 3 lines

scripts/runqemu class BaseConfig(object):

Quoted 3 lines
scripts/runqemu +0 -1
                 elif 'gl-es' in sys.argv[1:]:
                     self.set_dri_path()
-                    self.qemu_opt_script += ' -vga virtio -display

gtk,gl=es,show-cursor=on'

Quoted 1 line

scripts/runqemu class BaseConfig(object): · line 476

Quoted 1 line
scripts/runqemu +1 -0
+                    self.qemu_opt_script += ' -device virtio-gpu

-display gtk,gl=es,show-cursor=on'

Quoted 2 lines

scripts/runqemu class BaseConfig(object): · line 478

Quoted 2 lines
scripts/runqemu +0 -0
                 else:
                     self.qemu_opt_script += ' -display

gtk,show-cursor=on'

Quoted 3 lines

scripts/runqemu class BaseConfig(object): · line 482

Quoted 3 lines
scripts/runqemu +0 -0
             elif arg == 'gl' or arg == 'gl-es':
@@ -482,7 +482,7 @@ class BaseConfig(object):
                     raise RunQemuError('Option %s also needs gtk or

sdl option.' % (arg))

Quoted 3 lines

scripts/runqemu class BaseConfig(object):

Quoted 3 lines
scripts/runqemu +0 -1
             elif arg == 'egl-headless':
                 self.set_dri_path()
-                self.qemu_opt_script += ' -vga virtio -display

egl-headless,show-cursor=on'

Quoted 1 line

scripts/runqemu class BaseConfig(object): · line 485

Quoted 1 line
scripts/runqemu +1 -0
+                self.qemu_opt_script += ' -device virtio-gpu -display

egl-headless,show-cursor=on'

Quoted 7 lines
Quoted 7 lines
scripts/runqemu +0 -1
             elif arg == 'serial':
                 self.kernel_cmdline_script += ' console=ttyS0'
                 self.serialconsole = True
--

2.23.0