]> Git Repo - qemu.git/blob - tests/usb-hcd-xhci-test.c
tests/migration: Add source to PC boot block
[qemu.git] / tests / usb-hcd-xhci-test.c
1 /*
2  * QTest testcase for USB xHCI controller
3  *
4  * Copyright (c) 2014 HUAWEI TECHNOLOGIES CO., LTD.
5  *
6  * This work is licensed under the terms of the GNU GPL, version 2 or later.
7  * See the COPYING file in the top-level directory.
8  */
9
10 #include "qemu/osdep.h"
11 #include "libqtest.h"
12 #include "libqos/usb.h"
13
14
15 static void test_xhci_init(void)
16 {
17 }
18
19 static void test_xhci_hotplug(void)
20 {
21     usb_test_hotplug("xhci", 1, NULL);
22 }
23
24 static void test_usb_uas_hotplug(void)
25 {
26     qtest_qmp_device_add("usb-uas", "uas", NULL);
27     qtest_qmp_device_add("scsi-hd", "scsihd", "'drive': 'drive0'");
28
29     /* TODO:
30         UAS HBA driver in libqos, to check that
31         added disk is visible after BUS rescan
32     */
33
34     qtest_qmp_device_del("scsihd");
35     qtest_qmp_device_del("uas");
36 }
37
38 int main(int argc, char **argv)
39 {
40     int ret;
41
42     g_test_init(&argc, &argv, NULL);
43
44     qtest_add_func("/xhci/pci/init", test_xhci_init);
45     qtest_add_func("/xhci/pci/hotplug", test_xhci_hotplug);
46     qtest_add_func("/xhci/pci/hotplug/usb-uas", test_usb_uas_hotplug);
47
48     qtest_start("-device nec-usb-xhci,id=xhci"
49                 " -drive id=drive0,if=none,file=null-co://,format=raw");
50     ret = g_test_run();
51     qtest_end();
52
53     return ret;
54 }
This page took 0.024705 seconds and 4 git commands to generate.