]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
tests/qtest/hd-geo-test: Check for the lsi53c895a controller before using it
authorThomas Huth <thuth@redhat.com>
Wed, 22 Dec 2021 15:36:00 +0000 (16:36 +0100)
committerThomas Huth <thuth@redhat.com>
Wed, 5 Jan 2022 10:10:13 +0000 (11:10 +0100)
The lsi53c895a SCSI controller might have been disabled in the target
binary, so let's check for its availability first before using it.

Message-Id: <20211222153600.976588-1-thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
tests/qtest/hd-geo-test.c

index 113126ae06c071cb5f00514c3df2e9ea706009bf..771eaa741b13030d2ccde5c234913f364f730a73 100644 (file)
@@ -960,9 +960,11 @@ int main(int argc, char **argv)
     qtest_add_func("hd-geo/ide/device/user/chst", test_ide_device_user_chst);
     if (have_qemu_img()) {
         qtest_add_func("hd-geo/override/ide", test_override_ide);
-        qtest_add_func("hd-geo/override/scsi", test_override_scsi);
-        qtest_add_func("hd-geo/override/scsi_2_controllers",
-                       test_override_scsi_2_controllers);
+        if (qtest_has_device("lsi53c895a")) {
+            qtest_add_func("hd-geo/override/scsi", test_override_scsi);
+            qtest_add_func("hd-geo/override/scsi_2_controllers",
+                           test_override_scsi_2_controllers);
+        }
         qtest_add_func("hd-geo/override/virtio_blk", test_override_virtio_blk);
         qtest_add_func("hd-geo/override/zero_chs", test_override_zero_chs);
         qtest_add_func("hd-geo/override/scsi_hot_unplug",