Skip to contentSkip to conversation

tests/qtest/virtio-ccw: Fix device presence checking

PATCH In review Samuel Tardieu 3 participants 3 messages Jan 6, 2024 – Jan 8, 2024

lore
Share & tools
lore
#0 lore raw

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

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.

---
 tests/qtest/virtio-ccw-test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/qtest/virtio-ccw-test.c +1 -1
index f4f5858b84..7a5357c212 100644
@@ -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);
     }
Signature · 1 line
2.42.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Samuel Tardieu

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")
Quoted 18 lines
---
  tests/qtest/virtio-ccw-test.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
tests/qtest/virtio-ccw-test.c +1 -1
index f4f5858b84..7a5357c212 100644
@@ -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 lore raw
In reply to Samuel Tardieu
Quoted 14 lines · Samuel Tardieu

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.

---
  tests/qtest/virtio-ccw-test.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
tests/qtest/virtio-ccw-test.c +0 -0
index f4f5858b84..7a5357c212 100644

tests/qtest/virtio-ccw-test.c int main(int argc, char **argv) · line 91

Quoted 8 lines
tests/qtest/virtio-ccw-test.c +1 -1
@@ -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