[PATCH 2/7] tests/functional/test_virtio_gpu: Remove legacy '-machine foo,accel=bar'

Philippe Mathieu-Daudé posted 7 patches 11 months ago
There is a newer version of this series
[PATCH 2/7] tests/functional/test_virtio_gpu: Remove legacy '-machine foo,accel=bar'
Posted by Philippe Mathieu-Daudé 11 months ago
Since commit 6f6e1698a68 ("vl: configure accelerators from -accel
options") we prefer the '-accel bar' command line option.

Replace '-machine foo,accel=bar' -> '-machine foo -accel bar' in
functional tests.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 tests/functional/test_virtio_gpu.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tests/functional/test_virtio_gpu.py b/tests/functional/test_virtio_gpu.py
index d5027487ac4..cc0ec234861 100755
--- a/tests/functional/test_virtio_gpu.py
+++ b/tests/functional/test_virtio_gpu.py
@@ -61,7 +61,8 @@ def test_virtio_vga_virgl(self):
         self.vm.set_console()
         self.vm.add_args("-cpu", "host")
         self.vm.add_args("-m", "2G")
-        self.vm.add_args("-machine", "pc,accel=kvm")
+        self.vm.add_args('-accel', 'kvm')
+        self.vm.add_args("-machine", "pc")
         self.vm.add_args("-device", "virtio-vga-gl")
         self.vm.add_args("-display", "egl-headless")
         self.vm.add_args(
@@ -118,10 +119,11 @@ def test_vhost_user_vga_virgl(self):
         )
 
         self.vm.set_console()
+        self.vm.add_args('-accel', 'kvm')
         self.vm.add_args("-cpu", "host")
         self.vm.add_args("-m", "2G")
         self.vm.add_args("-object", "memory-backend-memfd,id=mem,size=2G")
-        self.vm.add_args("-machine", "pc,memory-backend=mem,accel=kvm")
+        self.vm.add_args("-machine", "pc,memory-backend=mem")
         self.vm.add_args("-chardev", "socket,id=vug,fd=%d" % qemu_sock.fileno())
         self.vm.add_args("-device", "vhost-user-vga,chardev=vug")
         self.vm.add_args("-display", "egl-headless")
-- 
2.45.2


Re: [PATCH 2/7] tests/functional/test_virtio_gpu: Remove legacy '-machine foo,accel=bar'
Posted by Thomas Huth 11 months ago
On 03/12/2024 10.21, Philippe Mathieu-Daudé wrote:
> Since commit 6f6e1698a68 ("vl: configure accelerators from -accel
> options") we prefer the '-accel bar' command line option.
> 
> Replace '-machine foo,accel=bar' -> '-machine foo -accel bar' in
> functional tests.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   tests/functional/test_virtio_gpu.py | 6 ++++--
>   1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/functional/test_virtio_gpu.py b/tests/functional/test_virtio_gpu.py
> index d5027487ac4..cc0ec234861 100755
> --- a/tests/functional/test_virtio_gpu.py
> +++ b/tests/functional/test_virtio_gpu.py
> @@ -61,7 +61,8 @@ def test_virtio_vga_virgl(self):
>           self.vm.set_console()
>           self.vm.add_args("-cpu", "host")
>           self.vm.add_args("-m", "2G")
> -        self.vm.add_args("-machine", "pc,accel=kvm")
> +        self.vm.add_args('-accel', 'kvm')
> +        self.vm.add_args("-machine", "pc")

While you're at it, could you please change this test to use 
"self.set_machine('pc')" at the very beginning of the test function instead 
of using -machine pc here? That way the test gets properly skipped in case 
the machine is not available in the QEMU binary.

  Thanks,
   Thomas


>           self.vm.add_args("-device", "virtio-vga-gl")
>           self.vm.add_args("-display", "egl-headless")
>           self.vm.add_args(
> @@ -118,10 +119,11 @@ def test_vhost_user_vga_virgl(self):
>           )
>   
>           self.vm.set_console()
> +        self.vm.add_args('-accel', 'kvm')
>           self.vm.add_args("-cpu", "host")
>           self.vm.add_args("-m", "2G")
>           self.vm.add_args("-object", "memory-backend-memfd,id=mem,size=2G")
> -        self.vm.add_args("-machine", "pc,memory-backend=mem,accel=kvm")
> +        self.vm.add_args("-machine", "pc,memory-backend=mem")
>           self.vm.add_args("-chardev", "socket,id=vug,fd=%d" % qemu_sock.fileno())
>           self.vm.add_args("-device", "vhost-user-vga,chardev=vug")
>           self.vm.add_args("-display", "egl-headless")


Re: [PATCH 2/7] tests/functional/test_virtio_gpu: Remove legacy '-machine foo,accel=bar'
Posted by Daniel P. Berrangé 11 months ago
On Tue, Dec 03, 2024 at 10:21:48AM +0100, Philippe Mathieu-Daudé wrote:
> Since commit 6f6e1698a68 ("vl: configure accelerators from -accel
> options") we prefer the '-accel bar' command line option.
> 
> Replace '-machine foo,accel=bar' -> '-machine foo -accel bar' in
> functional tests.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>  tests/functional/test_virtio_gpu.py | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|