@@ -175,6 +175,19 @@ static void pci_qtest_stop(void)
qtest_end();
}
+static void test_ehci_hotplug(void)
+{
+ qtest_start("");
+
+ /* hotplug an ehci controller */
+ qmp_exec_hmp_cmd("", "device_add usb-ehci,id=ehci");
+
+ /* hot unplug an ehci controller */
+ qmp_exec_hmp_cmd("", "device_del ehci");
+
+ qtest_end();
+}
+
int main(int argc, char **argv)
{
int ret;
@@ -191,6 +204,8 @@ int main(int argc, char **argv)
qtest_add_func("/ehci/pci/ehci-port-2", pci_ehci_port_2);
qtest_add_func("/ehci/pci/qtest_stop", pci_qtest_stop);
+ qtest_add_func("/ehci/pci/ehci-hotplug", test_ehci_hotplug);
+
ret = g_test_run();
return ret;