tests/qtest/hd-geo-test: Check for the lsi53c895a controller before using it
PATCH 1/1 tests/qtest/hd-geo-test: Check for the lsi53c895a controller before using it
The lsi53c895a SCSI controller might have been disabled in the target binary, so let's check for its availability first before using it.
Signed-off-by Thomas Huth <[email protected]>
--- tests/qtest/hd-geo-test.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
tests/qtest/hd-geo-test.c +5 -3
@@ -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",
Signature · 1 line
2.27.0
Quoted 29 lines · Thomas Huth
The lsi53c895a SCSI controller might have been disabled in the target binary, so let's check for its availability first before using it.
Signed-off-by Thomas Huth <[email protected]>--- tests/qtest/hd-geo-test.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)tests/qtest/hd-geo-test.c +5
-4@@ -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", --
Quoted 2 lines
2.27.0
Acked-by John Snow <[email protected]>
Quoted 7 lines · Thomas Huth
The lsi53c895a SCSI controller might have been disabled in the target binary, so let's check for its availability first before using it.
Signed-off-by Thomas Huth <[email protected]>--- tests/qtest/hd-geo-test.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
Reviewed-by Philippe Mathieu-Daudé <[email protected]>