* [PATCH] tests/qtest/usb-hcd-xhci-test: Check availability of devices before using them
@ 2023-08-22 16:30 Thomas Huth
2023-08-23 13:32 ` Fabiano Rosas
0 siblings, 1 reply; 2+ messages in thread
From: Thomas Huth @ 2023-08-22 16:30 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann, Fabiano Rosas
The "usb-uas" and "usb-ccid" might not be compiled into the QEMU binary,
so let's better check first whether they are available.
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] tests/qtest/usb-hcd-xhci-test: Check availability of devices before using them
2023-08-22 16:30 [PATCH] tests/qtest/usb-hcd-xhci-test: Check availability of devices before using them Thomas Huth
@ 2023-08-23 13:32 ` Fabiano Rosas
0 siblings, 0 replies; 2+ messages in thread
From: Fabiano Rosas @ 2023-08-23 13:32 UTC (permalink / raw)
To: Thomas Huth, qemu-devel; +Cc: Gerd Hoffmann
Thomas Huth <thuth@redhat.com> writes:
> The "usb-uas" and "usb-ccid" might not be compiled into the QEMU binary,
> so let's better check first whether they are available.
>
> Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Fabiano Rosas <farosas@suse.de>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-08-23 13:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-22 16:30 [PATCH] tests/qtest/usb-hcd-xhci-test: Check availability of devices before using them Thomas Huth
2023-08-23 13:32 ` Fabiano Rosas
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).