[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PULL 01/16] tests: minor cleanups in usb-hcd-uhci-test
From: |
David Gibson |
Subject: |
[Qemu-ppc] [PULL 01/16] tests: minor cleanups in usb-hcd-uhci-test |
Date: |
Mon, 17 Oct 2016 13:43:24 +1100 |
From: Laurent Vivier <address@hidden>
Two minor cleanups:
- exit gracefully in case on unsupported target,
- put machine command line in a constant to avoid
to duplicate it.
Signed-off-by: Laurent Vivier <address@hidden>
Reviewed-by: Gerd Hoffmann <address@hidden>
Signed-off-by: David Gibson <address@hidden>
---
tests/usb-hcd-uhci-test.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/tests/usb-hcd-uhci-test.c b/tests/usb-hcd-uhci-test.c
index 4b951ce..e956b9c 100644
--- a/tests/usb-hcd-uhci-test.c
+++ b/tests/usb-hcd-uhci-test.c
@@ -77,6 +77,9 @@ static void test_usb_storage_hotplug(void)
int main(int argc, char **argv)
{
const char *arch = qtest_get_arch();
+ const char *cmd = "-device piix3-usb-uhci,id=uhci,addr=1d.0"
+ " -drive id=drive0,if=none,file=/dev/null,format=raw"
+ " -device usb-tablet,bus=uhci.0,port=1";
int ret;
g_test_init(&argc, &argv, NULL);
@@ -87,13 +90,13 @@ int main(int argc, char **argv)
qtest_add_func("/uhci/pci/hotplug/usb-storage", test_usb_storage_hotplug);
if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) {
- qs = qtest_pc_boot("-device piix3-usb-uhci,id=uhci,addr=1d.0"
- " -drive
id=drive0,if=none,file=/dev/null,format=raw"
- " -device usb-tablet,bus=uhci.0,port=1");
+ qs = qtest_pc_boot(cmd);
} else if (strcmp(arch, "ppc64") == 0) {
- qs = qtest_spapr_boot("-device piix3-usb-uhci,id=uhci,addr=1d.0"
- " -drive
id=drive0,if=none,file=/dev/null,format=raw"
- " -device usb-tablet,bus=uhci.0,port=1");
+ qs = qtest_spapr_boot(cmd);
+ } else {
+ g_printerr("usb-hcd-uhci-test tests are only "
+ "available on x86 or ppc64\n");
+ exit(EXIT_FAILURE);
}
ret = g_test_run();
qtest_shutdown(qs);
--
2.7.4
- [Qemu-ppc] [PULL 00/16] ppc-for-2.8 queue 20161017, David Gibson, 2016/10/16
- [Qemu-ppc] [PULL 01/16] tests: minor cleanups in usb-hcd-uhci-test,
David Gibson <=
- [Qemu-ppc] [PULL 05/16] tests/boot-sector: Increase time-out to 90 seconds, David Gibson, 2016/10/16
- [Qemu-ppc] [PULL 03/16] tests/boot-sector: Use minimum length for the Forth boot script, David Gibson, 2016/10/16
- [Qemu-ppc] [PULL 14/16] spapr: Adjust placement of PCI host bridge to allow > 1TiB RAM, David Gibson, 2016/10/16
- [Qemu-ppc] [PULL 11/16] libqos: Correct error in PCI hole sizing for spapr, David Gibson, 2016/10/16
- [Qemu-ppc] [PULL 07/16] spapr: fix inheritance chain for default machine options, David Gibson, 2016/10/16
- [Qemu-ppc] [PULL 02/16] qtest: ask endianness of the target in qtest_init(), David Gibson, 2016/10/16
- [Qemu-ppc] [PULL 06/16] target-ppc: implement vexts[bh]2w and vexts[bhw]2d, David Gibson, 2016/10/16
- [Qemu-ppc] [PULL 12/16] libqos: Limit spapr-pci to 32-bit MMIO for now, David Gibson, 2016/10/16
- [Qemu-ppc] [PULL 13/16] spapr_pci: Delegate placement of PCI host bridges to machine type, David Gibson, 2016/10/16
- [Qemu-ppc] [PULL 04/16] tests/boot-sector: Use mkstemp() to create a unique file name, David Gibson, 2016/10/16