[PATCH] tests/qtest/virtio-ccw: Fix device presence checking

Samuel Tardieu posted 1 patch 10 months, 3 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20240106130121.1244993-1-sam@rfc1149.net
Maintainers: Thomas Huth <thuth@redhat.com>, Laurent Vivier <lvivier@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>
tests/qtest/virtio-ccw-test.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] tests/qtest/virtio-ccw: Fix device presence checking
Posted by Samuel Tardieu 10 months, 3 weeks ago
An apparent copy-paste error tests for the presence of the
virtio-rng-ccw device in order to perform tests on the virtio-scsi-ccw
device.

Signed-off-by: Samuel Tardieu <sam@rfc1149.net>
---
 tests/qtest/virtio-ccw-test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/qtest/virtio-ccw-test.c b/tests/qtest/virtio-ccw-test.c
index f4f5858b84..7a5357c212 100644
--- a/tests/qtest/virtio-ccw-test.c
+++ b/tests/qtest/virtio-ccw-test.c
@@ -85,7 +85,7 @@ int main(int argc, char **argv)
     if (qtest_has_device("virtio-rng-ccw")) {
         qtest_add_func("/virtio/rng/nop", virtio_rng_nop);
     }
-    if (qtest_has_device("virtio-rng-ccw")) {
+    if (qtest_has_device("virtio-scsi-ccw")) {
         qtest_add_func("/virtio/scsi/nop", virtio_scsi_nop);
         qtest_add_func("/virtio/scsi/hotplug", virtio_scsi_hotplug);
     }
-- 
2.42.0
Re: [PATCH] tests/qtest/virtio-ccw: Fix device presence checking
Posted by Thomas Huth 10 months, 3 weeks ago
On 06/01/2024 14.01, Samuel Tardieu wrote:
> An apparent copy-paste error tests for the presence of the
> virtio-rng-ccw device in order to perform tests on the virtio-scsi-ccw
> device.
> 
> Signed-off-by: Samuel Tardieu <sam@rfc1149.net>
> ---
>   tests/qtest/virtio-ccw-test.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tests/qtest/virtio-ccw-test.c b/tests/qtest/virtio-ccw-test.c
> index f4f5858b84..7a5357c212 100644
> --- a/tests/qtest/virtio-ccw-test.c
> +++ b/tests/qtest/virtio-ccw-test.c
> @@ -85,7 +85,7 @@ int main(int argc, char **argv)
>       if (qtest_has_device("virtio-rng-ccw")) {
>           qtest_add_func("/virtio/rng/nop", virtio_rng_nop);
>       }
> -    if (qtest_has_device("virtio-rng-ccw")) {
> +    if (qtest_has_device("virtio-scsi-ccw")) {
>           qtest_add_func("/virtio/scsi/nop", virtio_scsi_nop);
>           qtest_add_func("/virtio/scsi/hotplug", virtio_scsi_hotplug);
>       }

Ooops, thanks for catching it!

I'll queue the patch for my next pull request.

  Thomas
Re: [PATCH] tests/qtest/virtio-ccw: Fix device presence checking
Posted by Philippe Mathieu-Daudé 10 months, 3 weeks ago
On 6/1/24 14:01, Samuel Tardieu wrote:
> An apparent copy-paste error tests for the presence of the
> virtio-rng-ccw device in order to perform tests on the virtio-scsi-ccw
> device.
> 

Fixes: 65331bf5d1 ("tests/qtest: Check for virtio-ccw devices before 
using them")

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>

> Signed-off-by: Samuel Tardieu <sam@rfc1149.net>
> ---
>   tests/qtest/virtio-ccw-test.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tests/qtest/virtio-ccw-test.c b/tests/qtest/virtio-ccw-test.c
> index f4f5858b84..7a5357c212 100644
> --- a/tests/qtest/virtio-ccw-test.c
> +++ b/tests/qtest/virtio-ccw-test.c
> @@ -85,7 +85,7 @@ int main(int argc, char **argv)
>       if (qtest_has_device("virtio-rng-ccw")) {
>           qtest_add_func("/virtio/rng/nop", virtio_rng_nop);
>       }
> -    if (qtest_has_device("virtio-rng-ccw")) {
> +    if (qtest_has_device("virtio-scsi-ccw")) {
>           qtest_add_func("/virtio/scsi/nop", virtio_scsi_nop);
>           qtest_add_func("/virtio/scsi/hotplug", virtio_scsi_hotplug);
>       }