[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 3/7] tests/qtest/usb-hcd-xhci-test: Check availability of devices
From: |
Thomas Huth |
Subject: |
[PULL 3/7] tests/qtest/usb-hcd-xhci-test: Check availability of devices before using them |
Date: |
Thu, 31 Aug 2023 21:17:15 +0200 |
The "usb-uas" and "usb-ccid" might not be compiled into the QEMU binary,
so let's better check first whether they are available.
Message-Id: <20230822163024.61529-1-thuth@redhat.com>
Reviewed-by: Fabiano Rosas <farosas@suse.de>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
tests/qtest/usb-hcd-xhci-test.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/tests/qtest/usb-hcd-xhci-test.c b/tests/qtest/usb-hcd-xhci-test.c
index 10ef9d2a91..80bc039446 100644
--- a/tests/qtest/usb-hcd-xhci-test.c
+++ b/tests/qtest/usb-hcd-xhci-test.c
@@ -56,8 +56,12 @@ int main(int argc, char **argv)
qtest_add_func("/xhci/pci/init", test_xhci_init);
qtest_add_func("/xhci/pci/hotplug", test_xhci_hotplug);
- qtest_add_func("/xhci/pci/hotplug/usb-uas", test_usb_uas_hotplug);
- qtest_add_func("/xhci/pci/hotplug/usb-ccid", test_usb_ccid_hotplug);
+ if (qtest_has_device("usb-uas")) {
+ qtest_add_func("/xhci/pci/hotplug/usb-uas", test_usb_uas_hotplug);
+ }
+ if (qtest_has_device("usb-ccid")) {
+ qtest_add_func("/xhci/pci/hotplug/usb-ccid", test_usb_ccid_hotplug);
+ }
qtest_start("-device nec-usb-xhci,id=xhci"
" -drive id=drive0,if=none,file=null-co://,"
--
2.39.3
- [PULL 0/7] s390x and qtest patches, Thomas Huth, 2023/08/31
- [PULL 1/7] target/s390x: Define TARGET_HAS_PRECISE_SMC, Thomas Huth, 2023/08/31
- [PULL 3/7] tests/qtest/usb-hcd-xhci-test: Check availability of devices before using them,
Thomas Huth <=
- [PULL 2/7] tests/tcg/s390x: Test precise self-modifying code handling, Thomas Huth, 2023/08/31
- [PULL 4/7] tests/qtest/netdev-socket: Avoid variable-length array in inet_get_free_port_multiple(), Thomas Huth, 2023/08/31
- [PULL 5/7] tests/qtest/bios-tables-test: Check for virtio-iommu device before using it, Thomas Huth, 2023/08/31
- [PULL 6/7] subprojects/berkeley-testfloat-3: Update to fix a problem with compiler warnings, Thomas Huth, 2023/08/31
- [PULL 7/7] meson: test for CONFIG_TCG in config_all, Thomas Huth, 2023/08/31