* [Qemu-devel] [PATCH for-1.6? v2 00/21] qtest: Test all targets
@ 2013-08-05 13:27 Andreas Färber
2013-08-05 13:27 ` [Qemu-devel] [PATCH for-1.6? v2 01/21] mips_mipssim: Silence BIOS loading warning for qtest Andreas Färber
` (21 more replies)
0 siblings, 22 replies; 38+ messages in thread
From: Andreas Färber @ 2013-08-05 13:27 UTC (permalink / raw)
To: qemu-devel
Cc: Aurélien Jarno, Andreas Färber, Anthony Liguori,
Peter Maydell
Hello Anthony/Aurélien,
This series extends test coverage to all 16 targets.
For now it tests that QOM type changes do not lead to QOM cast assertions.
v2 extends it to cover virtually all machines (except Xen and pc*-x.y).
Where an fprintf() is touched, use error_report() instead.
Regards,
Andreas
v1 -> v2:
* gumstix, z2: Avoided conditionalizing use of pflash device in favor of NULL bdrv.
* puv3: Limited qtest workaround to a NULL kernel_filename.
* Added error workarounds for milkymist, ppc405, shix and leon3.
* Cleaned up debug output for ppc405 and shix.
* Extended qom-test to cover virtually all machines, including n800 and pc.
* Moved machine names to arrays wherever sensible, to aid with extensibility.
* Adopted error_report() for armv7m, too.
Cc: Anthony Liguori <anthony@codemonkey.ws>
Cc: Aurélien Jarno <aurelien@aurel32.net>
Cc: Peter Maydell <peter.maydell@linaro.org>
Andreas Färber (21):
mips_mipssim: Silence BIOS loading warning for qtest
arm/boot: Turn arm_load_kernel() into no-op for qtest without -kernel
puv3: Turn puv3_load_kernel() into a no-op for qtest without -kernel
mainstone: Don't enforce use of -pflash for qtest
gumstix: Don't enforce use of -pflash for qtest
z2: Don't enforce use of -pflash for qtest
palm: Don't enforce loading ROM or kernel for qtest
omap_sx1: Don't enforce use of kernel or flash for qtest
exynos4_boards: Silence lack of -smp 2 warning for qtest
armv7m: Don't enforce use of kernel for qtest
axis_dev88: Don't enforce use of kernel for qtest
mcf5208: Don't enforce use of kernel for qtest
an5206: Don't enforce use of kernel for qtest
milkymist: Suppress -kernel/-bios/-drive error for qtest
ppc405_boards: Disable debug output
ppc405_uc: Disable debug output
ppc405_boards: Don't enforce presence of firmware for qtest
shix: Drop debug output
shix: Don't require firmware presence for qtest
leon3: Don't enforce use of -bios with qtest
qtest: Prepare QOM machine tests
hw/arm/armv7m.c | 25 +++--
hw/arm/boot.c | 4 +
hw/arm/exynos4_boards.c | 3 +-
hw/arm/gumstix.c | 11 +-
hw/arm/mainstone.c | 5 +-
hw/arm/omap_sx1.c | 3 +-
hw/arm/palm.c | 3 +-
hw/arm/z2.c | 5 +-
hw/block/tc58128.c | 10 +-
hw/cris/axis_dev88.c | 11 +-
hw/lm32/milkymist.c | 3 +-
hw/m68k/an5206.c | 4 +
hw/m68k/mcf5208.c | 4 +
hw/mips/mips_mipssim.c | 4 +-
hw/ppc/ppc405_boards.c | 39 ++++---
hw/ppc/ppc405_uc.c | 16 +--
hw/sh4/shix.c | 16 +--
hw/sparc/leon3.c | 3 +-
hw/unicore32/puv3.c | 4 +
tests/Makefile | 26 +++++
tests/qom-test.c | 280 ++++++++++++++++++++++++++++++++++++++++++++++++
21 files changed, 410 insertions(+), 69 deletions(-)
create mode 100644 tests/qom-test.c
--
1.8.1.4
^ permalink raw reply [flat|nested] 38+ messages in thread
* [Qemu-devel] [PATCH for-1.6? v2 01/21] mips_mipssim: Silence BIOS loading warning for qtest
2013-08-05 13:27 [Qemu-devel] [PATCH for-1.6? v2 00/21] qtest: Test all targets Andreas Färber
@ 2013-08-05 13:27 ` Andreas Färber
2013-08-07 10:12 ` Aurelien Jarno
2013-08-05 13:27 ` [Qemu-devel] [PATCH for-1.6? v2 02/21] arm/boot: Turn arm_load_kernel() into no-op for qtest without -kernel Andreas Färber
` (20 subsequent siblings)
21 siblings, 1 reply; 38+ messages in thread
From: Andreas Färber @ 2013-08-05 13:27 UTC (permalink / raw)
To: qemu-devel; +Cc: Andreas Färber, Aurelien Jarno
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
hw/mips/mips_mipssim.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/hw/mips/mips_mipssim.c b/hw/mips/mips_mipssim.c
index fea1a15..d8c4347 100644
--- a/hw/mips/mips_mipssim.c
+++ b/hw/mips/mips_mipssim.c
@@ -37,6 +37,7 @@
#include "elf.h"
#include "hw/sysbus.h"
#include "exec/address-spaces.h"
+#include "sysemu/qtest.h"
static struct _loaderparams {
int ram_size;
@@ -189,7 +190,8 @@ mips_mipssim_init(QEMUMachineInitArgs *args)
} else {
bios_size = -1;
}
- if ((bios_size < 0 || bios_size > BIOS_SIZE) && !kernel_filename) {
+ if ((bios_size < 0 || bios_size > BIOS_SIZE) &&
+ !kernel_filename && !qtest_enabled()) {
/* Bail out if we have neither a kernel image nor boot vector code. */
fprintf(stderr,
"qemu: Warning, could not load MIPS bios '%s', and no -kernel argument was specified\n",
--
1.8.1.4
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [Qemu-devel] [PATCH for-1.6? v2 02/21] arm/boot: Turn arm_load_kernel() into no-op for qtest without -kernel
2013-08-05 13:27 [Qemu-devel] [PATCH for-1.6? v2 00/21] qtest: Test all targets Andreas Färber
2013-08-05 13:27 ` [Qemu-devel] [PATCH for-1.6? v2 01/21] mips_mipssim: Silence BIOS loading warning for qtest Andreas Färber
@ 2013-08-05 13:27 ` Andreas Färber
2013-08-05 13:27 ` [Qemu-devel] [PATCH for-1.6? v2 03/21] puv3: Turn puv3_load_kernel() into a " Andreas Färber
` (19 subsequent siblings)
21 siblings, 0 replies; 38+ messages in thread
From: Andreas Färber @ 2013-08-05 13:27 UTC (permalink / raw)
To: qemu-devel; +Cc: Peter Maydell, Andreas Färber, Paul Brook
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
hw/arm/boot.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/hw/arm/boot.c b/hw/arm/boot.c
index 2cbeefd..0c6d611 100644
--- a/hw/arm/boot.c
+++ b/hw/arm/boot.c
@@ -15,6 +15,7 @@
#include "hw/loader.h"
#include "elf.h"
#include "sysemu/device_tree.h"
+#include "sysemu/qtest.h"
#include "qemu/config-file.h"
#define KERNEL_ARGS_ADDR 0x100
@@ -354,6 +355,9 @@ void arm_load_kernel(ARMCPU *cpu, struct arm_boot_info *info)
/* Load the kernel. */
if (!info->kernel_filename) {
+ if (qtest_enabled()) {
+ return;
+ }
fprintf(stderr, "Kernel image must be specified\n");
exit(1);
}
--
1.8.1.4
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [Qemu-devel] [PATCH for-1.6? v2 03/21] puv3: Turn puv3_load_kernel() into a no-op for qtest without -kernel
2013-08-05 13:27 [Qemu-devel] [PATCH for-1.6? v2 00/21] qtest: Test all targets Andreas Färber
2013-08-05 13:27 ` [Qemu-devel] [PATCH for-1.6? v2 01/21] mips_mipssim: Silence BIOS loading warning for qtest Andreas Färber
2013-08-05 13:27 ` [Qemu-devel] [PATCH for-1.6? v2 02/21] arm/boot: Turn arm_load_kernel() into no-op for qtest without -kernel Andreas Färber
@ 2013-08-05 13:27 ` Andreas Färber
2013-08-05 13:27 ` [Qemu-devel] [PATCH for-1.6? v2 04/21] mainstone: Don't enforce use of -pflash for qtest Andreas Färber
` (18 subsequent siblings)
21 siblings, 0 replies; 38+ messages in thread
From: Andreas Färber @ 2013-08-05 13:27 UTC (permalink / raw)
To: qemu-devel; +Cc: Guan Xuetao, Andreas Färber
Replacing the assert() with more user-friendly error handling is left
for a follow-up.
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
hw/unicore32/puv3.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/hw/unicore32/puv3.c b/hw/unicore32/puv3.c
index 5ff0dc9..0d84cd9 100644
--- a/hw/unicore32/puv3.c
+++ b/hw/unicore32/puv3.c
@@ -17,6 +17,7 @@
#include "hw/boards.h"
#include "hw/loader.h"
#include "hw/i386/pc.h"
+#include "sysemu/qtest.h"
#undef DEBUG_PUV3
#include "hw/unicore32/puv3.h"
@@ -84,6 +85,9 @@ static void puv3_load_kernel(const char *kernel_filename)
{
int size;
+ if (kernel_filename == NULL && qtest_enabled()) {
+ return;
+ }
assert(kernel_filename != NULL);
/* only zImage format supported */
--
1.8.1.4
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [Qemu-devel] [PATCH for-1.6? v2 04/21] mainstone: Don't enforce use of -pflash for qtest
2013-08-05 13:27 [Qemu-devel] [PATCH for-1.6? v2 00/21] qtest: Test all targets Andreas Färber
` (2 preceding siblings ...)
2013-08-05 13:27 ` [Qemu-devel] [PATCH for-1.6? v2 03/21] puv3: Turn puv3_load_kernel() into a " Andreas Färber
@ 2013-08-05 13:27 ` Andreas Färber
2013-08-05 13:27 ` [Qemu-devel] [PATCH for-1.6? v2 05/21] gumstix: " Andreas Färber
` (17 subsequent siblings)
21 siblings, 0 replies; 38+ messages in thread
From: Andreas Färber @ 2013-08-05 13:27 UTC (permalink / raw)
To: qemu-devel; +Cc: Peter Maydell, Andreas Färber, Paul Brook
Simply skip flash setup for now.
Also drop useless debug output.
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
hw/arm/mainstone.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/hw/arm/mainstone.c b/hw/arm/mainstone.c
index 8e5fc26..e9d4b98 100644
--- a/hw/arm/mainstone.c
+++ b/hw/arm/mainstone.c
@@ -21,6 +21,7 @@
#include "sysemu/blockdev.h"
#include "hw/sysbus.h"
#include "exec/address-spaces.h"
+#include "sysemu/qtest.h"
/* Device addresses */
#define MST_FPGA_PHYS 0x08000000
@@ -127,6 +128,9 @@ static void mainstone_common_init(MemoryRegion *address_space_mem,
for (i = 0; i < 2; i ++) {
dinfo = drive_get(IF_PFLASH, 0, i);
if (!dinfo) {
+ if (qtest_enabled()) {
+ break;
+ }
fprintf(stderr, "Two flash images must be given with the "
"'pflash' parameter\n");
exit(1);
@@ -147,7 +151,6 @@ static void mainstone_common_init(MemoryRegion *address_space_mem,
qdev_get_gpio_in(mpu->gpio, 0));
/* setup keypad */
- printf("map addr %p\n", &map);
pxa27x_register_keypad(mpu->kp, map, 0xe0);
/* MMC/SD host */
--
1.8.1.4
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [Qemu-devel] [PATCH for-1.6? v2 05/21] gumstix: Don't enforce use of -pflash for qtest
2013-08-05 13:27 [Qemu-devel] [PATCH for-1.6? v2 00/21] qtest: Test all targets Andreas Färber
` (3 preceding siblings ...)
2013-08-05 13:27 ` [Qemu-devel] [PATCH for-1.6? v2 04/21] mainstone: Don't enforce use of -pflash for qtest Andreas Färber
@ 2013-08-05 13:27 ` Andreas Färber
2013-08-05 13:27 ` [Qemu-devel] [PATCH for-1.6? v2 06/21] z2: " Andreas Färber
` (16 subsequent siblings)
21 siblings, 0 replies; 38+ messages in thread
From: Andreas Färber @ 2013-08-05 13:27 UTC (permalink / raw)
To: qemu-devel; +Cc: Peter Maydell, Andreas Färber, Paul Brook
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
hw/arm/gumstix.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/hw/arm/gumstix.c b/hw/arm/gumstix.c
index b8cab10..a9015ed 100644
--- a/hw/arm/gumstix.c
+++ b/hw/arm/gumstix.c
@@ -42,6 +42,7 @@
#include "hw/boards.h"
#include "sysemu/blockdev.h"
#include "exec/address-spaces.h"
+#include "sysemu/qtest.h"
static const int sector_len = 128 * 1024;
@@ -58,7 +59,7 @@ static void connex_init(QEMUMachineInitArgs *args)
cpu = pxa255_init(address_space_mem, connex_ram);
dinfo = drive_get(IF_PFLASH, 0, 0);
- if (!dinfo) {
+ if (!dinfo && !qtest_enabled()) {
fprintf(stderr, "A flash image must be given with the "
"'pflash' parameter\n");
exit(1);
@@ -70,7 +71,8 @@ static void connex_init(QEMUMachineInitArgs *args)
be = 0;
#endif
if (!pflash_cfi01_register(0x00000000, NULL, "connext.rom", connex_rom,
- dinfo->bdrv, sector_len, connex_rom / sector_len,
+ dinfo ? dinfo->bdrv : NULL,
+ sector_len, connex_rom / sector_len,
2, 0, 0, 0, 0, be)) {
fprintf(stderr, "qemu: Error registering flash memory.\n");
exit(1);
@@ -95,7 +97,7 @@ static void verdex_init(QEMUMachineInitArgs *args)
cpu = pxa270_init(address_space_mem, verdex_ram, cpu_model ?: "pxa270-c0");
dinfo = drive_get(IF_PFLASH, 0, 0);
- if (!dinfo) {
+ if (!dinfo && !qtest_enabled()) {
fprintf(stderr, "A flash image must be given with the "
"'pflash' parameter\n");
exit(1);
@@ -107,7 +109,8 @@ static void verdex_init(QEMUMachineInitArgs *args)
be = 0;
#endif
if (!pflash_cfi01_register(0x00000000, NULL, "verdex.rom", verdex_rom,
- dinfo->bdrv, sector_len, verdex_rom / sector_len,
+ dinfo ? dinfo->bdrv : NULL,
+ sector_len, verdex_rom / sector_len,
2, 0, 0, 0, 0, be)) {
fprintf(stderr, "qemu: Error registering flash memory.\n");
exit(1);
--
1.8.1.4
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [Qemu-devel] [PATCH for-1.6? v2 06/21] z2: Don't enforce use of -pflash for qtest
2013-08-05 13:27 [Qemu-devel] [PATCH for-1.6? v2 00/21] qtest: Test all targets Andreas Färber
` (4 preceding siblings ...)
2013-08-05 13:27 ` [Qemu-devel] [PATCH for-1.6? v2 05/21] gumstix: " Andreas Färber
@ 2013-08-05 13:27 ` Andreas Färber
2013-08-05 13:27 ` [Qemu-devel] [PATCH for-1.6? v2 07/21] palm: Don't enforce loading ROM or kernel " Andreas Färber
` (15 subsequent siblings)
21 siblings, 0 replies; 38+ messages in thread
From: Andreas Färber @ 2013-08-05 13:27 UTC (permalink / raw)
To: qemu-devel; +Cc: Peter Maydell, Andreas Färber, Paul Brook
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
hw/arm/z2.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/hw/arm/z2.c b/hw/arm/z2.c
index 07a127b..a4cbaeb 100644
--- a/hw/arm/z2.c
+++ b/hw/arm/z2.c
@@ -24,6 +24,7 @@
#include "ui/console.h"
#include "audio/audio.h"
#include "exec/address-spaces.h"
+#include "sysemu/qtest.h"
#ifdef DEBUG_Z2
#define DPRINTF(fmt, ...) \
@@ -323,7 +324,7 @@ static void z2_init(QEMUMachineInitArgs *args)
be = 0;
#endif
dinfo = drive_get(IF_PFLASH, 0, 0);
- if (!dinfo) {
+ if (!dinfo && !qtest_enabled()) {
fprintf(stderr, "Flash image must be given with the "
"'pflash' parameter\n");
exit(1);
@@ -331,7 +332,7 @@ static void z2_init(QEMUMachineInitArgs *args)
if (!pflash_cfi01_register(Z2_FLASH_BASE,
NULL, "z2.flash0", Z2_FLASH_SIZE,
- dinfo->bdrv, sector_len,
+ dinfo ? dinfo->bdrv : NULL, sector_len,
Z2_FLASH_SIZE / sector_len, 4, 0, 0, 0, 0,
be)) {
fprintf(stderr, "qemu: Error registering flash memory.\n");
--
1.8.1.4
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [Qemu-devel] [PATCH for-1.6? v2 07/21] palm: Don't enforce loading ROM or kernel for qtest
2013-08-05 13:27 [Qemu-devel] [PATCH for-1.6? v2 00/21] qtest: Test all targets Andreas Färber
` (5 preceding siblings ...)
2013-08-05 13:27 ` [Qemu-devel] [PATCH for-1.6? v2 06/21] z2: " Andreas Färber
@ 2013-08-05 13:27 ` Andreas Färber
2013-08-05 13:27 ` [Qemu-devel] [PATCH for-1.6? v2 08/21] omap_sx1: Don't enforce use of kernel or flash " Andreas Färber
` (14 subsequent siblings)
21 siblings, 0 replies; 38+ messages in thread
From: Andreas Färber @ 2013-08-05 13:27 UTC (permalink / raw)
To: qemu-devel; +Cc: Peter Maydell, Andreas Färber, Paul Brook
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
hw/arm/palm.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/hw/arm/palm.c b/hw/arm/palm.c
index cdc3c3a..dc4bbcd 100644
--- a/hw/arm/palm.c
+++ b/hw/arm/palm.c
@@ -19,6 +19,7 @@
#include "hw/hw.h"
#include "audio/audio.h"
#include "sysemu/sysemu.h"
+#include "sysemu/qtest.h"
#include "ui/console.h"
#include "hw/arm/omap.h"
#include "hw/boards.h"
@@ -255,7 +256,7 @@ static void palmte_init(QEMUMachineInitArgs *args)
}
}
- if (!rom_loaded && !kernel_filename) {
+ if (!rom_loaded && !kernel_filename && !qtest_enabled()) {
fprintf(stderr, "Kernel or ROM image must be specified\n");
exit(1);
}
--
1.8.1.4
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [Qemu-devel] [PATCH for-1.6? v2 08/21] omap_sx1: Don't enforce use of kernel or flash for qtest
2013-08-05 13:27 [Qemu-devel] [PATCH for-1.6? v2 00/21] qtest: Test all targets Andreas Färber
` (6 preceding siblings ...)
2013-08-05 13:27 ` [Qemu-devel] [PATCH for-1.6? v2 07/21] palm: Don't enforce loading ROM or kernel " Andreas Färber
@ 2013-08-05 13:27 ` Andreas Färber
2013-08-05 13:27 ` [Qemu-devel] [PATCH for-1.6? v2 09/21] exynos4_boards: Silence lack of -smp 2 warning " Andreas Färber
` (13 subsequent siblings)
21 siblings, 0 replies; 38+ messages in thread
From: Andreas Färber @ 2013-08-05 13:27 UTC (permalink / raw)
To: qemu-devel; +Cc: Peter Maydell, Andreas Färber, Paul Brook
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
hw/arm/omap_sx1.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/hw/arm/omap_sx1.c b/hw/arm/omap_sx1.c
index 05b0353..d9bd8d6 100644
--- a/hw/arm/omap_sx1.c
+++ b/hw/arm/omap_sx1.c
@@ -32,6 +32,7 @@
#include "hw/arm/arm.h"
#include "hw/block/flash.h"
#include "sysemu/blockdev.h"
+#include "sysemu/qtest.h"
#include "exec/address-spaces.h"
/*****************************************************************************/
@@ -188,7 +189,7 @@ static void sx1_init(QEMUMachineInitArgs *args, const int version)
OMAP_CS1_BASE, &cs[1]);
}
- if (!args->kernel_filename && !fl_idx) {
+ if (!args->kernel_filename && !fl_idx && !qtest_enabled()) {
fprintf(stderr, "Kernel or Flash image must be specified\n");
exit(1);
}
--
1.8.1.4
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [Qemu-devel] [PATCH for-1.6? v2 09/21] exynos4_boards: Silence lack of -smp 2 warning for qtest
2013-08-05 13:27 [Qemu-devel] [PATCH for-1.6? v2 00/21] qtest: Test all targets Andreas Färber
` (7 preceding siblings ...)
2013-08-05 13:27 ` [Qemu-devel] [PATCH for-1.6? v2 08/21] omap_sx1: Don't enforce use of kernel or flash " Andreas Färber
@ 2013-08-05 13:27 ` Andreas Färber
2013-08-05 13:27 ` [Qemu-devel] [PATCH for-1.6? v2 10/21] armv7m: Don't enforce use of kernel " Andreas Färber
` (12 subsequent siblings)
21 siblings, 0 replies; 38+ messages in thread
From: Andreas Färber @ 2013-08-05 13:27 UTC (permalink / raw)
To: qemu-devel
Cc: Peter Maydell, Evgeny Voevodin, Igor Mitsyanko, Paul Brook,
Maksim Kozlov, Andreas Färber, Dmitry Solodkiy
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
hw/arm/exynos4_boards.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/hw/arm/exynos4_boards.c b/hw/arm/exynos4_boards.c
index 7c90b2d..0be5f8c 100644
--- a/hw/arm/exynos4_boards.c
+++ b/hw/arm/exynos4_boards.c
@@ -22,6 +22,7 @@
*/
#include "sysemu/sysemu.h"
+#include "sysemu/qtest.h"
#include "hw/sysbus.h"
#include "net/net.h"
#include "hw/arm/arm.h"
@@ -96,7 +97,7 @@ static void lan9215_init(uint32_t base, qemu_irq irq)
static Exynos4210State *exynos4_boards_init_common(QEMUMachineInitArgs *args,
Exynos4BoardType board_type)
{
- if (smp_cpus != EXYNOS4210_NCPUS) {
+ if (smp_cpus != EXYNOS4210_NCPUS && !qtest_enabled()) {
fprintf(stderr, "%s board supports only %d CPU cores. Ignoring smp_cpus"
" value.\n",
exynos4_machines[board_type].name,
--
1.8.1.4
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [Qemu-devel] [PATCH for-1.6? v2 10/21] armv7m: Don't enforce use of kernel for qtest
2013-08-05 13:27 [Qemu-devel] [PATCH for-1.6? v2 00/21] qtest: Test all targets Andreas Färber
` (8 preceding siblings ...)
2013-08-05 13:27 ` [Qemu-devel] [PATCH for-1.6? v2 09/21] exynos4_boards: Silence lack of -smp 2 warning " Andreas Färber
@ 2013-08-05 13:27 ` Andreas Färber
2013-08-05 13:27 ` [Qemu-devel] [PATCH for-1.6? v2 11/21] axis_dev88: " Andreas Färber
` (11 subsequent siblings)
21 siblings, 0 replies; 38+ messages in thread
From: Andreas Färber @ 2013-08-05 13:27 UTC (permalink / raw)
To: qemu-devel; +Cc: Peter Maydell, Andreas Färber, Paul Brook
Adopt error_report().
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
hw/arm/armv7m.c | 25 ++++++++++++++-----------
1 file changed, 14 insertions(+), 11 deletions(-)
diff --git a/hw/arm/armv7m.c b/hw/arm/armv7m.c
index 82d36fb..ddbaf8c 100644
--- a/hw/arm/armv7m.c
+++ b/hw/arm/armv7m.c
@@ -11,6 +11,8 @@
#include "hw/arm/arm.h"
#include "hw/loader.h"
#include "elf.h"
+#include "sysemu/qtest.h"
+#include "qemu/error-report.h"
/* Bitbanded IO. Each word corresponds to a single bit. */
@@ -233,21 +235,22 @@ qemu_irq *armv7m_init(MemoryRegion *address_space_mem,
big_endian = 0;
#endif
- if (!kernel_filename) {
+ if (!kernel_filename && !qtest_enabled()) {
fprintf(stderr, "Guest image must be specified (using -kernel)\n");
exit(1);
}
- image_size = load_elf(kernel_filename, NULL, NULL, &entry, &lowaddr,
- NULL, big_endian, ELF_MACHINE, 1);
- if (image_size < 0) {
- image_size = load_image_targphys(kernel_filename, 0, flash_size);
- lowaddr = 0;
- }
- if (image_size < 0) {
- fprintf(stderr, "qemu: could not load kernel '%s'\n",
- kernel_filename);
- exit(1);
+ if (kernel_filename) {
+ image_size = load_elf(kernel_filename, NULL, NULL, &entry, &lowaddr,
+ NULL, big_endian, ELF_MACHINE, 1);
+ if (image_size < 0) {
+ image_size = load_image_targphys(kernel_filename, 0, flash_size);
+ lowaddr = 0;
+ }
+ if (image_size < 0) {
+ error_report("Could not load kernel '%s'", kernel_filename);
+ exit(1);
+ }
}
/* Hack to map an additional page of ram at the top of the address
--
1.8.1.4
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [Qemu-devel] [PATCH for-1.6? v2 11/21] axis_dev88: Don't enforce use of kernel for qtest
2013-08-05 13:27 [Qemu-devel] [PATCH for-1.6? v2 00/21] qtest: Test all targets Andreas Färber
` (9 preceding siblings ...)
2013-08-05 13:27 ` [Qemu-devel] [PATCH for-1.6? v2 10/21] armv7m: Don't enforce use of kernel " Andreas Färber
@ 2013-08-05 13:27 ` Andreas Färber
2013-08-05 13:27 ` [Qemu-devel] [PATCH for-1.6? v2 12/21] mcf5208: " Andreas Färber
` (10 subsequent siblings)
21 siblings, 0 replies; 38+ messages in thread
From: Andreas Färber @ 2013-08-05 13:27 UTC (permalink / raw)
To: qemu-devel; +Cc: Edgar E. Iglesias, Andreas Färber
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
hw/cris/axis_dev88.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/hw/cris/axis_dev88.c b/hw/cris/axis_dev88.c
index 9104d61..6673c66 100644
--- a/hw/cris/axis_dev88.c
+++ b/hw/cris/axis_dev88.c
@@ -32,6 +32,7 @@
#include "boot.h"
#include "sysemu/blockdev.h"
#include "exec/address-spaces.h"
+#include "sysemu/qtest.h"
#define D(x)
#define DNAND(x)
@@ -340,14 +341,14 @@ void axisdev88_init(QEMUMachineInitArgs *args)
irq[0x14 + i]);
}
- if (!kernel_filename) {
+ if (kernel_filename) {
+ li.image_filename = kernel_filename;
+ li.cmdline = kernel_cmdline;
+ cris_load_image(cpu, &li);
+ } else if (!qtest_enabled()) {
fprintf(stderr, "Kernel image must be specified\n");
exit(1);
}
-
- li.image_filename = kernel_filename;
- li.cmdline = kernel_cmdline;
- cris_load_image(cpu, &li);
}
static QEMUMachine axisdev88_machine = {
--
1.8.1.4
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [Qemu-devel] [PATCH for-1.6? v2 12/21] mcf5208: Don't enforce use of kernel for qtest
2013-08-05 13:27 [Qemu-devel] [PATCH for-1.6? v2 00/21] qtest: Test all targets Andreas Färber
` (10 preceding siblings ...)
2013-08-05 13:27 ` [Qemu-devel] [PATCH for-1.6? v2 11/21] axis_dev88: " Andreas Färber
@ 2013-08-05 13:27 ` Andreas Färber
2013-08-05 13:27 ` [Qemu-devel] [PATCH for-1.6? v2 13/21] an5206: " Andreas Färber
` (9 subsequent siblings)
21 siblings, 0 replies; 38+ messages in thread
From: Andreas Färber @ 2013-08-05 13:27 UTC (permalink / raw)
To: qemu-devel; +Cc: Andreas Färber, Paul Brook
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
hw/m68k/mcf5208.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/hw/m68k/mcf5208.c b/hw/m68k/mcf5208.c
index 9cf000f..14fecc4 100644
--- a/hw/m68k/mcf5208.c
+++ b/hw/m68k/mcf5208.c
@@ -10,6 +10,7 @@
#include "qemu/timer.h"
#include "hw/ptimer.h"
#include "sysemu/sysemu.h"
+#include "sysemu/qtest.h"
#include "net/net.h"
#include "hw/boards.h"
#include "hw/loader.h"
@@ -267,6 +268,9 @@ static void mcf5208evb_init(QEMUMachineInitArgs *args)
/* Load kernel. */
if (!kernel_filename) {
+ if (qtest_enabled()) {
+ return;
+ }
fprintf(stderr, "Kernel image must be specified\n");
exit(1);
}
--
1.8.1.4
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [Qemu-devel] [PATCH for-1.6? v2 13/21] an5206: Don't enforce use of kernel for qtest
2013-08-05 13:27 [Qemu-devel] [PATCH for-1.6? v2 00/21] qtest: Test all targets Andreas Färber
` (11 preceding siblings ...)
2013-08-05 13:27 ` [Qemu-devel] [PATCH for-1.6? v2 12/21] mcf5208: " Andreas Färber
@ 2013-08-05 13:27 ` Andreas Färber
2013-08-05 13:27 ` [Qemu-devel] [PATCH for-1.6? v2 14/21] milkymist: Suppress -kernel/-bios/-drive error " Andreas Färber
` (8 subsequent siblings)
21 siblings, 0 replies; 38+ messages in thread
From: Andreas Färber @ 2013-08-05 13:27 UTC (permalink / raw)
To: qemu-devel; +Cc: Andreas Färber, Paul Brook
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
hw/m68k/an5206.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/hw/m68k/an5206.c b/hw/m68k/an5206.c
index 0c03a87..abf7d1c 100644
--- a/hw/m68k/an5206.c
+++ b/hw/m68k/an5206.c
@@ -12,6 +12,7 @@
#include "hw/loader.h"
#include "elf.h"
#include "exec/address-spaces.h"
+#include "sysemu/qtest.h"
#define KERNEL_LOAD_ADDR 0x10000
#define AN5206_MBAR_ADDR 0x10000000
@@ -62,6 +63,9 @@ static void an5206_init(QEMUMachineInitArgs *args)
/* Load kernel. */
if (!kernel_filename) {
+ if (qtest_enabled()) {
+ return;
+ }
fprintf(stderr, "Kernel image must be specified\n");
exit(1);
}
--
1.8.1.4
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [Qemu-devel] [PATCH for-1.6? v2 14/21] milkymist: Suppress -kernel/-bios/-drive error for qtest
2013-08-05 13:27 [Qemu-devel] [PATCH for-1.6? v2 00/21] qtest: Test all targets Andreas Färber
` (12 preceding siblings ...)
2013-08-05 13:27 ` [Qemu-devel] [PATCH for-1.6? v2 13/21] an5206: " Andreas Färber
@ 2013-08-05 13:27 ` Andreas Färber
2013-08-07 5:34 ` Michael Walle
2013-08-05 13:27 ` [Qemu-devel] [PATCH for-1.6? v2 15/21] ppc405_boards: Disable debug output Andreas Färber
` (7 subsequent siblings)
21 siblings, 1 reply; 38+ messages in thread
From: Andreas Färber @ 2013-08-05 13:27 UTC (permalink / raw)
To: qemu-devel; +Cc: Michael Walle, Andreas Färber
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
hw/lm32/milkymist.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/hw/lm32/milkymist.c b/hw/lm32/milkymist.c
index 7ceedb8..a8e7230 100644
--- a/hw/lm32/milkymist.c
+++ b/hw/lm32/milkymist.c
@@ -21,6 +21,7 @@
#include "hw/hw.h"
#include "hw/block/flash.h"
#include "sysemu/sysemu.h"
+#include "sysemu/qtest.h"
#include "hw/devices.h"
#include "hw/boards.h"
#include "hw/loader.h"
@@ -143,7 +144,7 @@ milkymist_init(QEMUMachineInitArgs *args)
reset_info->bootstrap_pc = BIOS_OFFSET;
/* if no kernel is given no valid bios rom is a fatal error */
- if (!kernel_filename && !dinfo && !bios_filename) {
+ if (!kernel_filename && !dinfo && !bios_filename && !qtest_enabled()) {
fprintf(stderr, "qemu: could not load Milkymist One bios '%s'\n",
bios_name);
exit(1);
--
1.8.1.4
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [Qemu-devel] [PATCH for-1.6? v2 15/21] ppc405_boards: Disable debug output
2013-08-05 13:27 [Qemu-devel] [PATCH for-1.6? v2 00/21] qtest: Test all targets Andreas Färber
` (13 preceding siblings ...)
2013-08-05 13:27 ` [Qemu-devel] [PATCH for-1.6? v2 14/21] milkymist: Suppress -kernel/-bios/-drive error " Andreas Färber
@ 2013-08-05 13:27 ` Andreas Färber
2013-08-14 17:54 ` Alexander Graf
2013-08-05 13:27 ` [Qemu-devel] [PATCH for-1.6? v2 16/21] ppc405_uc: " Andreas Färber
` (6 subsequent siblings)
21 siblings, 1 reply; 38+ messages in thread
From: Andreas Färber @ 2013-08-05 13:27 UTC (permalink / raw)
To: qemu-devel; +Cc: open list:ppc4xx, Andreas Färber, Alexander Graf
Also move one stray debug output into an #ifdef.
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
hw/ppc/ppc405_boards.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/ppc/ppc405_boards.c b/hw/ppc/ppc405_boards.c
index f74e5e5..807ada0 100644
--- a/hw/ppc/ppc405_boards.c
+++ b/hw/ppc/ppc405_boards.c
@@ -42,7 +42,7 @@
#define USE_FLASH_BIOS
-#define DEBUG_BOARD_INIT
+//#define DEBUG_BOARD_INIT
/*****************************************************************************/
/* PPC405EP reference board (IBM) */
@@ -353,9 +353,9 @@ static void ref405ep_init(QEMUMachineInitArgs *args)
bdloc = 0;
}
#ifdef DEBUG_BOARD_INIT
+ printf("bdloc " RAM_ADDR_FMT "\n", bdloc);
printf("%s: Done\n", __func__);
#endif
- printf("bdloc " RAM_ADDR_FMT "\n", bdloc);
}
static QEMUMachine ref405ep_machine = {
--
1.8.1.4
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [Qemu-devel] [PATCH for-1.6? v2 16/21] ppc405_uc: Disable debug output
2013-08-05 13:27 [Qemu-devel] [PATCH for-1.6? v2 00/21] qtest: Test all targets Andreas Färber
` (14 preceding siblings ...)
2013-08-05 13:27 ` [Qemu-devel] [PATCH for-1.6? v2 15/21] ppc405_boards: Disable debug output Andreas Färber
@ 2013-08-05 13:27 ` Andreas Färber
2013-08-14 17:55 ` Alexander Graf
2013-08-05 13:27 ` [Qemu-devel] [PATCH for-1.6? v2 17/21] ppc405_boards: Don't enforce presence of firmware for qtest Andreas Färber
` (5 subsequent siblings)
21 siblings, 1 reply; 38+ messages in thread
From: Andreas Färber @ 2013-08-05 13:27 UTC (permalink / raw)
To: qemu-devel; +Cc: open list:ppc4xx, Andreas Färber, Alexander Graf
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
hw/ppc/ppc405_uc.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/hw/ppc/ppc405_uc.c b/hw/ppc/ppc405_uc.c
index 290f71a..5fc330b 100644
--- a/hw/ppc/ppc405_uc.c
+++ b/hw/ppc/ppc405_uc.c
@@ -30,15 +30,15 @@
#include "qemu/log.h"
#include "exec/address-spaces.h"
-#define DEBUG_OPBA
-#define DEBUG_SDRAM
-#define DEBUG_GPIO
-#define DEBUG_SERIAL
-#define DEBUG_OCM
+//#define DEBUG_OPBA
+//#define DEBUG_SDRAM
+//#define DEBUG_GPIO
+//#define DEBUG_SERIAL
+//#define DEBUG_OCM
//#define DEBUG_I2C
-#define DEBUG_GPT
-#define DEBUG_MAL
-#define DEBUG_CLOCKS
+//#define DEBUG_GPT
+//#define DEBUG_MAL
+//#define DEBUG_CLOCKS
//#define DEBUG_CLOCKS_LL
ram_addr_t ppc405_set_bootinfo (CPUPPCState *env, ppc4xx_bd_info_t *bd,
--
1.8.1.4
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [Qemu-devel] [PATCH for-1.6? v2 17/21] ppc405_boards: Don't enforce presence of firmware for qtest
2013-08-05 13:27 [Qemu-devel] [PATCH for-1.6? v2 00/21] qtest: Test all targets Andreas Färber
` (15 preceding siblings ...)
2013-08-05 13:27 ` [Qemu-devel] [PATCH for-1.6? v2 16/21] ppc405_uc: " Andreas Färber
@ 2013-08-05 13:27 ` Andreas Färber
2013-08-14 17:55 ` Alexander Graf
2013-08-05 13:27 ` [Qemu-devel] [PATCH for-1.6? v2 18/21] shix: Drop debug output Andreas Färber
` (4 subsequent siblings)
21 siblings, 1 reply; 38+ messages in thread
From: Andreas Färber @ 2013-08-05 13:27 UTC (permalink / raw)
To: qemu-devel; +Cc: open list:ppc4xx, Andreas Färber, Alexander Graf
Adopt error_report() while at it.
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
hw/ppc/ppc405_boards.c | 35 ++++++++++++++++++++---------------
1 file changed, 20 insertions(+), 15 deletions(-)
diff --git a/hw/ppc/ppc405_boards.c b/hw/ppc/ppc405_boards.c
index 807ada0..75b2177 100644
--- a/hw/ppc/ppc405_boards.c
+++ b/hw/ppc/ppc405_boards.c
@@ -27,9 +27,11 @@
#include "hw/timer/m48t59.h"
#include "hw/block/flash.h"
#include "sysemu/sysemu.h"
+#include "sysemu/qtest.h"
#include "block/block.h"
#include "hw/boards.h"
#include "qemu/log.h"
+#include "qemu/error-report.h"
#include "hw/loader.h"
#include "sysemu/blockdev.h"
#include "exec/address-spaces.h"
@@ -252,17 +254,20 @@ static void ref405ep_init(QEMUMachineInitArgs *args)
if (filename) {
bios_size = load_image(filename, memory_region_get_ram_ptr(bios));
g_free(filename);
+ if (bios_size < 0 || bios_size > BIOS_SIZE) {
+ error_report("Could not load PowerPC BIOS '%s'", bios_name);
+ exit(1);
+ }
+ bios_size = (bios_size + 0xfff) & ~0xfff;
+ memory_region_add_subregion(sysmem, (uint32_t)(-bios_size), bios);
+ } else if (!qtest_enabled() || kernel_filename != NULL) {
+ error_report("Could not load PowerPC BIOS '%s'", bios_name);
+ exit(1);
} else {
+ /* Avoid an uninitialized variable warning */
bios_size = -1;
}
- if (bios_size < 0 || bios_size > BIOS_SIZE) {
- fprintf(stderr, "qemu: could not load PowerPC bios '%s'\n",
- bios_name);
- exit(1);
- }
- bios_size = (bios_size + 0xfff) & ~0xfff;
memory_region_set_readonly(bios, true);
- memory_region_add_subregion(sysmem, (uint32_t)(-bios_size), bios);
}
/* Register FPGA */
#ifdef DEBUG_BOARD_INIT
@@ -569,17 +574,17 @@ static void taihu_405ep_init(QEMUMachineInitArgs *args)
if (filename) {
bios_size = load_image(filename, memory_region_get_ram_ptr(bios));
g_free(filename);
- } else {
- bios_size = -1;
- }
- if (bios_size < 0 || bios_size > BIOS_SIZE) {
- fprintf(stderr, "qemu: could not load PowerPC bios '%s'\n",
- bios_name);
+ if (bios_size < 0 || bios_size > BIOS_SIZE) {
+ error_report("Could not load PowerPC BIOS '%s'", bios_name);
+ exit(1);
+ }
+ bios_size = (bios_size + 0xfff) & ~0xfff;
+ memory_region_add_subregion(sysmem, (uint32_t)(-bios_size), bios);
+ } else if (!qtest_enabled()) {
+ error_report("Could not load PowerPC BIOS '%s'", bios_name);
exit(1);
}
- bios_size = (bios_size + 0xfff) & ~0xfff;
memory_region_set_readonly(bios, true);
- memory_region_add_subregion(sysmem, (uint32_t)(-bios_size), bios);
}
/* Register Linux flash */
dinfo = drive_get(IF_PFLASH, 0, fl_idx);
--
1.8.1.4
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [Qemu-devel] [PATCH for-1.6? v2 18/21] shix: Drop debug output
2013-08-05 13:27 [Qemu-devel] [PATCH for-1.6? v2 00/21] qtest: Test all targets Andreas Färber
` (16 preceding siblings ...)
2013-08-05 13:27 ` [Qemu-devel] [PATCH for-1.6? v2 17/21] ppc405_boards: Don't enforce presence of firmware for qtest Andreas Färber
@ 2013-08-05 13:27 ` Andreas Färber
2013-08-07 10:13 ` Aurelien Jarno
2013-08-05 13:27 ` [Qemu-devel] [PATCH for-1.6? v2 19/21] shix: Don't require firmware presence for qtest Andreas Färber
` (3 subsequent siblings)
21 siblings, 1 reply; 38+ messages in thread
From: Andreas Färber @ 2013-08-05 13:27 UTC (permalink / raw)
To: qemu-devel; +Cc: Andreas Färber, Aurelien Jarno
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
hw/sh4/shix.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/hw/sh4/shix.c b/hw/sh4/shix.c
index 84dd666..66cbea4 100644
--- a/hw/sh4/shix.c
+++ b/hw/sh4/shix.c
@@ -50,7 +50,6 @@ static void shix_init(QEMUMachineInitArgs *args)
if (!cpu_model)
cpu_model = "any";
- printf("Initializing CPU\n");
cpu = cpu_sh4_init(cpu_model);
if (cpu == NULL) {
fprintf(stderr, "Unable to find CPU definition\n");
@@ -58,16 +57,13 @@ static void shix_init(QEMUMachineInitArgs *args)
}
/* Allocate memory space */
- printf("Allocating ROM\n");
memory_region_init_ram(rom, NULL, "shix.rom", 0x4000);
vmstate_register_ram_global(rom);
memory_region_set_readonly(rom, true);
memory_region_add_subregion(sysmem, 0x00000000, rom);
- printf("Allocating SDRAM 1\n");
memory_region_init_ram(&sdram[0], NULL, "shix.sdram1", 0x01000000);
vmstate_register_ram_global(&sdram[0]);
memory_region_add_subregion(sysmem, 0x08000000, &sdram[0]);
- printf("Allocating SDRAM 2\n");
memory_region_init_ram(&sdram[1], NULL, "shix.sdram2", 0x01000000);
vmstate_register_ram_global(&sdram[1]);
memory_region_add_subregion(sysmem, 0x0c000000, &sdram[1]);
@@ -75,10 +71,8 @@ static void shix_init(QEMUMachineInitArgs *args)
/* Load BIOS in 0 (and access it through P2, 0xA0000000) */
if (bios_name == NULL)
bios_name = BIOS_FILENAME;
- printf("%s: load BIOS '%s'\n", __func__, bios_name);
ret = load_image_targphys(bios_name, 0, 0x4000);
if (ret < 0) { /* Check bios size */
- fprintf(stderr, "ret=%d\n", ret);
fprintf(stderr, "qemu: could not load SHIX bios '%s'\n",
bios_name);
exit(1);
@@ -88,7 +82,6 @@ static void shix_init(QEMUMachineInitArgs *args)
s = sh7750_init(cpu, sysmem);
/* XXXXX Check success */
tc58128_init(s, "shix_linux_nand.bin", NULL);
- fprintf(stderr, "initialization terminated\n");
}
static QEMUMachine shix_machine = {
--
1.8.1.4
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [Qemu-devel] [PATCH for-1.6? v2 19/21] shix: Don't require firmware presence for qtest
2013-08-05 13:27 [Qemu-devel] [PATCH for-1.6? v2 00/21] qtest: Test all targets Andreas Färber
` (17 preceding siblings ...)
2013-08-05 13:27 ` [Qemu-devel] [PATCH for-1.6? v2 18/21] shix: Drop debug output Andreas Färber
@ 2013-08-05 13:27 ` Andreas Färber
2013-08-06 8:05 ` Stefan Hajnoczi
2013-08-07 10:13 ` Aurelien Jarno
2013-08-05 13:27 ` [Qemu-devel] [PATCH for-1.6? v2 20/21] leon3: Don't enforce use of -bios with qtest Andreas Färber
` (2 subsequent siblings)
21 siblings, 2 replies; 38+ messages in thread
From: Andreas Färber @ 2013-08-05 13:27 UTC (permalink / raw)
To: qemu-devel
Cc: Kevin Wolf, Aurelien Jarno, Andreas Färber, Stefan Hajnoczi
Adopt error_report() while at it.
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
hw/block/tc58128.c | 10 ++++++----
hw/sh4/shix.c | 9 +++++----
2 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/hw/block/tc58128.c b/hw/block/tc58128.c
index a3929d4..728f1c3 100644
--- a/hw/block/tc58128.c
+++ b/hw/block/tc58128.c
@@ -1,6 +1,8 @@
#include "hw/hw.h"
#include "hw/sh4/sh.h"
#include "hw/loader.h"
+#include "sysemu/qtest.h"
+#include "qemu/error-report.h"
#define CE1 0x0100
#define CE2 0x0200
@@ -36,10 +38,10 @@ static void init_dev(tc58128_dev * dev, const char *filename)
/* Load flash image skipping the first block */
ret = load_image(filename, dev->flash_contents + 528 * 32);
if (ret < 0) {
- fprintf(stderr, "ret=%d\n", ret);
- fprintf(stderr, "qemu: could not load flash image %s\n",
- filename);
- exit(1);
+ if (!qtest_enabled()) {
+ error_report("Could not load flash image %s", filename);
+ exit(1);
+ }
} else {
/* Build first block with number of blocks */
blocks = (ret + 528 * 32 - 1) / (528 * 32);
diff --git a/hw/sh4/shix.c b/hw/sh4/shix.c
index 66cbea4..5ee7af6 100644
--- a/hw/sh4/shix.c
+++ b/hw/sh4/shix.c
@@ -30,9 +30,11 @@
#include "hw/hw.h"
#include "hw/sh4/sh.h"
#include "sysemu/sysemu.h"
+#include "sysemu/qtest.h"
#include "hw/boards.h"
#include "hw/loader.h"
#include "exec/address-spaces.h"
+#include "qemu/error-report.h"
#define BIOS_FILENAME "shix_bios.bin"
#define BIOS_ADDRESS 0xA0000000
@@ -72,10 +74,9 @@ static void shix_init(QEMUMachineInitArgs *args)
if (bios_name == NULL)
bios_name = BIOS_FILENAME;
ret = load_image_targphys(bios_name, 0, 0x4000);
- if (ret < 0) { /* Check bios size */
- fprintf(stderr, "qemu: could not load SHIX bios '%s'\n",
- bios_name);
- exit(1);
+ if (ret < 0 && !qtest_enabled()) {
+ error_report("Could not load SHIX bios '%s'", bios_name);
+ exit(1);
}
/* Register peripherals */
--
1.8.1.4
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [Qemu-devel] [PATCH for-1.6? v2 20/21] leon3: Don't enforce use of -bios with qtest
2013-08-05 13:27 [Qemu-devel] [PATCH for-1.6? v2 00/21] qtest: Test all targets Andreas Färber
` (18 preceding siblings ...)
2013-08-05 13:27 ` [Qemu-devel] [PATCH for-1.6? v2 19/21] shix: Don't require firmware presence for qtest Andreas Färber
@ 2013-08-05 13:27 ` Andreas Färber
2013-08-05 13:27 ` [Qemu-devel] [PATCH for-1.6? v2 21/21] qtest: Prepare QOM machine tests Andreas Färber
2013-08-06 8:39 ` [Qemu-devel] [PATCH for-1.6? v2 00/21] qtest: Test all targets Markus Armbruster
21 siblings, 0 replies; 38+ messages in thread
From: Andreas Färber @ 2013-08-05 13:27 UTC (permalink / raw)
To: qemu-devel; +Cc: Blue Swirl, Andreas Färber, Fabien Chouteau
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
hw/sparc/leon3.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/hw/sparc/leon3.c b/hw/sparc/leon3.c
index 5ef282f..1d60cb7 100644
--- a/hw/sparc/leon3.c
+++ b/hw/sparc/leon3.c
@@ -26,6 +26,7 @@
#include "hw/ptimer.h"
#include "sysemu/char.h"
#include "sysemu/sysemu.h"
+#include "sysemu/qtest.h"
#include "hw/boards.h"
#include "hw/loader.h"
#include "elf.h"
@@ -178,7 +179,7 @@ static void leon3_generic_hw_init(QEMUMachineInitArgs *args)
fprintf(stderr, "qemu: could not load prom '%s'\n", filename);
exit(1);
}
- } else if (kernel_filename == NULL) {
+ } else if (kernel_filename == NULL && !qtest_enabled()) {
fprintf(stderr, "Can't read bios image %s\n", filename);
exit(1);
}
--
1.8.1.4
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [Qemu-devel] [PATCH for-1.6? v2 21/21] qtest: Prepare QOM machine tests
2013-08-05 13:27 [Qemu-devel] [PATCH for-1.6? v2 00/21] qtest: Test all targets Andreas Färber
` (19 preceding siblings ...)
2013-08-05 13:27 ` [Qemu-devel] [PATCH for-1.6? v2 20/21] leon3: Don't enforce use of -bios with qtest Andreas Färber
@ 2013-08-05 13:27 ` Andreas Färber
2013-08-25 17:22 ` Alexander Graf
2013-08-25 17:33 ` Peter Maydell
2013-08-06 8:39 ` [Qemu-devel] [PATCH for-1.6? v2 00/21] qtest: Test all targets Markus Armbruster
21 siblings, 2 replies; 38+ messages in thread
From: Andreas Färber @ 2013-08-05 13:27 UTC (permalink / raw)
To: qemu-devel; +Cc: Andreas Färber
Instantiate all [*] machines per target, so that they get a bit of test
coverage at all. This has proven helpful during QOM refactorings.
[*] ppcemb target contains some non-working non-embedded machines, and
ppc405 CPUs are not available there either.
i386 and x86_64 do not cover pc*-x.y or xenfv.
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
tests/Makefile | 26 ++++++
tests/qom-test.c | 280 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 306 insertions(+)
create mode 100644 tests/qom-test.c
diff --git a/tests/Makefile b/tests/Makefile
index d044908..a7e1319 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -63,25 +63,50 @@ check-qtest-i386-y += tests/boot-order-test$(EXESUF)
check-qtest-i386-y += tests/rtc-test$(EXESUF)
check-qtest-i386-y += tests/i440fx-test$(EXESUF)
check-qtest-i386-y += tests/fw_cfg-test$(EXESUF)
+check-qtest-i386-y += tests/qom-test$(EXESUF)
check-qtest-x86_64-y = $(check-qtest-i386-y)
gcov-files-i386-y += i386-softmmu/hw/mc146818rtc.c
gcov-files-x86_64-y = $(subst i386-softmmu/,x86_64-softmmu/,$(gcov-files-i386-y))
check-qtest-mips-y = tests/endianness-test$(EXESUF)
check-qtest-mips64-y = tests/endianness-test$(EXESUF)
check-qtest-mips64el-y = tests/endianness-test$(EXESUF)
+check-qtest-mips-y += tests/qom-test$(EXESUF)
+check-qtest-mipsel-y += tests/qom-test$(EXESUF)
+check-qtest-mips64-y += tests/qom-test$(EXESUF)
+check-qtest-mips64el-y += tests/qom-test$(EXESUF)
check-qtest-ppc-y = tests/endianness-test$(EXESUF)
check-qtest-ppc64-y = tests/endianness-test$(EXESUF)
check-qtest-sh4-y = tests/endianness-test$(EXESUF)
check-qtest-sh4eb-y = tests/endianness-test$(EXESUF)
+check-qtest-sh4-y += tests/qom-test$(EXESUF)
+check-qtest-sh4eb-y += tests/qom-test$(EXESUF)
check-qtest-sparc64-y = tests/endianness-test$(EXESUF)
#check-qtest-sparc-y = tests/m48t59-test$(EXESUF)
#check-qtest-sparc64-y += tests/m48t59-test$(EXESUF)
gcov-files-sparc-y += hw/m48t59.c
gcov-files-sparc64-y += hw/m48t59.c
+check-qtest-sparc-y += tests/qom-test$(EXESUF)
+check-qtest-sparc64-y += tests/qom-test$(EXESUF)
check-qtest-arm-y = tests/tmp105-test$(EXESUF)
gcov-files-arm-y += hw/tmp105.c
+check-qtest-arm-y += tests/qom-test$(EXESUF)
check-qtest-ppc-y += tests/boot-order-test$(EXESUF)
check-qtest-ppc64-y += tests/boot-order-test$(EXESUF)
+check-qtest-ppc-y += tests/qom-test$(EXESUF)
+check-qtest-ppc64-y += tests/qom-test$(EXESUF)
+check-qtest-ppcemb-y += tests/qom-test$(EXESUF)
+check-qtest-alpha-y += tests/qom-test$(EXESUF)
+check-qtest-cris-y += tests/qom-test$(EXESUF)
+check-qtest-lm32-y += tests/qom-test$(EXESUF)
+check-qtest-m68k-y += tests/qom-test$(EXESUF)
+check-qtest-microblaze-y += tests/qom-test$(EXESUF)
+check-qtest-microblazeel-y = $(check-qtest-microblaze-y)
+check-qtest-moxie-y += tests/qom-test$(EXESUF)
+check-qtest-or32-y += tests/qom-test$(EXESUF)
+check-qtest-s390x-y += tests/qom-test$(EXESUF)
+check-qtest-unicore32-y += tests/qom-test$(EXESUF)
+check-qtest-xtensa-y += tests/qom-test$(EXESUF)
+check-qtest-xtensaeb-y = $(check-qtest-xtensa-y)
check-qapi-schema-y := $(addprefix tests/qapi-schema/, \
comments.json empty.json funny-char.json indented-expr.json \
@@ -161,6 +186,7 @@ tests/boot-order-test$(EXESUF): tests/boot-order-test.o $(libqos-obj-y)
tests/tmp105-test$(EXESUF): tests/tmp105-test.o $(libqos-omap-obj-y)
tests/i440fx-test$(EXESUF): tests/i440fx-test.o $(libqos-pc-obj-y)
tests/fw_cfg-test$(EXESUF): tests/fw_cfg-test.o $(libqos-pc-obj-y)
+tests/qom-test$(EXESUF): tests/qom-test.o
# QTest rules
diff --git a/tests/qom-test.c b/tests/qom-test.c
new file mode 100644
index 0000000..c9494e0
--- /dev/null
+++ b/tests/qom-test.c
@@ -0,0 +1,280 @@
+/*
+ * QTest testcase for QOM
+ *
+ * Copyright (c) 2013 SUSE LINUX Products GmbH
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ */
+#include "libqtest.h"
+
+#include <glib.h>
+#include <string.h>
+#include "qemu/osdep.h"
+
+static void test_nop(gconstpointer data)
+{
+ QTestState *s;
+ const char *machine = data;
+ char *args;
+
+ args = g_strdup_printf("-display none -machine %s", machine);
+ s = qtest_start(args);
+ if (s) {
+ qtest_quit(s);
+ }
+ g_free(args);
+}
+
+static const char *x86_machines[] = {
+ "pc",
+ "isapc",
+ "q35",
+};
+
+static const char *alpha_machines[] = {
+ "clipper",
+};
+
+static const char *arm_machines[] = {
+ "integratorcp",
+ "versatilepb",
+ "versatileab",
+ "lm3s811evb",
+ "lm3s6965evb",
+ "collie",
+ "akita",
+ "spitz",
+ "borzoi",
+ "terrier",
+ "tosa",
+ "cheetah",
+ "sx1-v1",
+ "sx1",
+ "realview-eb",
+ "realview-eb-mpcore",
+ "realview-pb-a8",
+ "realview-pbx-a9",
+ "musicpal",
+ "mainstone",
+ "connex",
+ "verdex",
+ "z2",
+ "n800",
+ "n810",
+ "kzm",
+ "vexpress-a9",
+ "vexpress-a15",
+ "smdkc210",
+ "nuri",
+ "xilinx-zynq-a9",
+ "highbank",
+ "midway",
+};
+
+static const char *cris_machines[] = {
+ "axis-dev88",
+};
+
+static const char *lm32_machines[] = {
+ "lm32-evr",
+ "lm32-uclinux",
+ "milkymist",
+};
+
+static const char *m68k_machines[] = {
+ "mcf5208evb",
+ "an5206",
+ "dummy",
+};
+
+static const char *microblaze_machines[] = {
+ "petalogix-ml605",
+ "petalogix-s3adsp1800",
+};
+
+static const char *mips_machines[] = {
+ "malta",
+ "magnum",
+ "mips",
+ "mipssim",
+ "pica61",
+};
+
+static const char *moxie_machines[] = {
+ "moxiesim",
+};
+
+static const char *openrisc_machines[] = {
+ "or32-sim",
+};
+
+static const char *ppc_machines[] = {
+ "g3beige",
+ "mac99",
+ "prep",
+ "mpc8544ds",
+ "ppce500",
+};
+
+static const char *ppc405_machines[] = {
+ "ref405ep",
+ "taihu",
+};
+
+static const char *ppc440_machines[] = {
+ "bamboo",
+ "virtex-ml507",
+};
+
+static const char *s390_machines[] = {
+ "s390-virtio",
+ "s390-ccw-virtio",
+};
+
+static const char *superh_machines[] = {
+ "r2d",
+ "shix",
+};
+
+static const char *sparc_machines[] = {
+ "SS-4",
+ "SS-5",
+ "SS-10",
+ "SS-20",
+ "SS-600MP",
+ "LX",
+ "SPARCClassic",
+ "SPARCbook",
+ "leon3_generic",
+};
+
+static const char *sparc64_machines[] = {
+ "sun4u",
+ "sun4v",
+ "Niagara",
+};
+
+static const char *unicore32_machines[] = {
+ "puv3",
+};
+
+static const char *xtensa_machines[] = {
+ "sim",
+ "lx60",
+ "lx200",
+};
+
+static void add_test_cases(const char *arch, const char *machine)
+{
+ char *path;
+ path = g_strdup_printf("/%s/qom/%s", arch, machine);
+ g_test_add_data_func(path, machine, test_nop);
+}
+
+int main(int argc, char **argv)
+{
+ const char *arch = qtest_get_arch();
+ int i;
+
+ g_test_init(&argc, &argv, NULL);
+
+ add_test_cases(arch, "none");
+
+ if (strcmp(arch, "i386") == 0 ||
+ strcmp(arch, "x86_64") == 0) {
+ for (i = 0; i < ARRAY_SIZE(x86_machines); i++) {
+ add_test_cases(arch, x86_machines[i]);
+ }
+ } else if (strcmp(arch, "alpha") == 0) {
+ for (i = 0; i < ARRAY_SIZE(alpha_machines); i++) {
+ add_test_cases(arch, alpha_machines[i]);
+ }
+ } else if (strcmp(arch, "arm") == 0) {
+ for (i = 0; i < ARRAY_SIZE(arm_machines); i++) {
+ add_test_cases(arch, arm_machines[i]);
+ }
+ } else if (strcmp(arch, "cris") == 0) {
+ for (i = 0; i < ARRAY_SIZE(cris_machines); i++) {
+ add_test_cases(arch, cris_machines[i]);
+ }
+ } else if (strcmp(arch, "lm32") == 0) {
+ for (i = 0; i < ARRAY_SIZE(lm32_machines); i++) {
+ add_test_cases(arch, lm32_machines[i]);
+ }
+ } else if (strcmp(arch, "m68k") == 0) {
+ for (i = 0; i < ARRAY_SIZE(m68k_machines); i++) {
+ add_test_cases(arch, m68k_machines[i]);
+ }
+ } else if (strcmp(arch, "microblaze") == 0 ||
+ strcmp(arch, "microblazeel") == 0) {
+ for (i = 0; i < ARRAY_SIZE(microblaze_machines); i++) {
+ add_test_cases(arch, microblaze_machines[i]);
+ }
+ } else if (strcmp(arch, "mips") == 0 ||
+ strcmp(arch, "mipsel") == 0 ||
+ strcmp(arch, "mips64") == 0 ||
+ strcmp(arch, "mips64el") == 0) {
+ for (i = 0; i < ARRAY_SIZE(mips_machines); i++) {
+ add_test_cases(arch, mips_machines[i]);
+ }
+ if (strcmp(arch, "mips64el") == 0) {
+ add_test_cases(arch, "fulong2e");
+ }
+ } else if (strcmp(arch, "moxie") == 0) {
+ for (i = 0; i < ARRAY_SIZE(moxie_machines); i++) {
+ add_test_cases(arch, moxie_machines[i]);
+ }
+ } else if (strcmp(arch, "or32") == 0) {
+ for (i = 0; i < ARRAY_SIZE(openrisc_machines); i++) {
+ add_test_cases(arch, openrisc_machines[i]);
+ }
+ } else if (strcmp(arch, "ppc") == 0 ||
+ strcmp(arch, "ppc64") == 0 ||
+ strcmp(arch, "ppcemb") == 0) {
+ if (strcmp(arch, "ppcemb") != 0) {
+ /* XXX Currently available in ppcemb but shouldn't be */
+ for (i = 0; i < ARRAY_SIZE(ppc_machines); i++) {
+ add_test_cases(arch, ppc_machines[i]);
+ }
+ /* XXX Currently available in ppcemb but don't work */
+ for (i = 0; i < ARRAY_SIZE(ppc405_machines); i++) {
+ add_test_cases(arch, ppc405_machines[i]);
+ }
+ }
+ for (i = 0; i < ARRAY_SIZE(ppc440_machines); i++) {
+ add_test_cases(arch, ppc440_machines[i]);
+ }
+ if (strcmp(arch, "ppc64") == 0) {
+ add_test_cases(arch, "pseries");
+ }
+ } else if (strcmp(arch, "s390x") == 0) {
+ for (i = 0; i < ARRAY_SIZE(s390_machines); i++) {
+ add_test_cases(arch, s390_machines[i]);
+ }
+ } else if (strcmp(arch, "sh4") == 0 ||
+ strcmp(arch, "sh4eb") == 0) {
+ for (i = 0; i < ARRAY_SIZE(superh_machines); i++) {
+ add_test_cases(arch, superh_machines[i]);
+ }
+ } else if (strcmp(arch, "sparc") == 0) {
+ for (i = 0; i < ARRAY_SIZE(sparc_machines); i++) {
+ add_test_cases(arch, sparc_machines[i]);
+ }
+ } else if (strcmp(arch, "sparc64") == 0) {
+ for (i = 0; i < ARRAY_SIZE(sparc64_machines); i++) {
+ add_test_cases(arch, sparc64_machines[i]);
+ }
+ } else if (strcmp(arch, "unicore32") == 0) {
+ for (i = 0; i < ARRAY_SIZE(unicore32_machines); i++) {
+ add_test_cases(arch, unicore32_machines[i]);
+ }
+ } else if (strcmp(arch, "xtensa") == 0 ||
+ strcmp(arch, "xtensaeb") == 0) {
+ for (i = 0; i < ARRAY_SIZE(xtensa_machines); i++) {
+ add_test_cases(arch, xtensa_machines[i]);
+ }
+ }
+
+ return g_test_run();
+}
--
1.8.1.4
^ permalink raw reply related [flat|nested] 38+ messages in thread
* Re: [Qemu-devel] [PATCH for-1.6? v2 19/21] shix: Don't require firmware presence for qtest
2013-08-05 13:27 ` [Qemu-devel] [PATCH for-1.6? v2 19/21] shix: Don't require firmware presence for qtest Andreas Färber
@ 2013-08-06 8:05 ` Stefan Hajnoczi
2013-08-07 10:13 ` Aurelien Jarno
1 sibling, 0 replies; 38+ messages in thread
From: Stefan Hajnoczi @ 2013-08-06 8:05 UTC (permalink / raw)
To: Andreas Färber; +Cc: Kevin Wolf, qemu-devel, Aurelien Jarno
On Mon, Aug 05, 2013 at 03:27:25PM +0200, Andreas Färber wrote:
> Adopt error_report() while at it.
>
> Signed-off-by: Andreas Färber <afaerber@suse.de>
> ---
> hw/block/tc58128.c | 10 ++++++----
> hw/sh4/shix.c | 9 +++++----
> 2 files changed, 11 insertions(+), 8 deletions(-)
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [Qemu-devel] [PATCH for-1.6? v2 00/21] qtest: Test all targets
2013-08-05 13:27 [Qemu-devel] [PATCH for-1.6? v2 00/21] qtest: Test all targets Andreas Färber
` (20 preceding siblings ...)
2013-08-05 13:27 ` [Qemu-devel] [PATCH for-1.6? v2 21/21] qtest: Prepare QOM machine tests Andreas Färber
@ 2013-08-06 8:39 ` Markus Armbruster
2013-08-06 9:04 ` Andreas Färber
21 siblings, 1 reply; 38+ messages in thread
From: Markus Armbruster @ 2013-08-06 8:39 UTC (permalink / raw)
To: Andreas Färber
Cc: Anthony Liguori, Peter Maydell, qemu-devel, Aurélien Jarno
Andreas Färber <afaerber@suse.de> writes:
> Hello Anthony/Aurélien,
>
> This series extends test coverage to all 16 targets.
> For now it tests that QOM type changes do not lead to QOM cast assertions.
>
> v2 extends it to cover virtually all machines (except Xen and pc*-x.y).
> Where an fprintf() is touched, use error_report() instead.
Yes, we need such a smoke test for all targets.
I toyed with it myself, but I haven't been able to go beyond the crude
hackery we discussed about a year ago:
https://lists.nongnu.org/archive/html/qemu-devel/2012-08/msg01197.html
The problem is that many targets have mandatory options (fun oxymoron),
such as -kernel or -pflash.
If I understand your approach correctly, you solve it by making these
mandatory options optional when qtest_enabled().
My idea was to create suitable dummy images, so we can provide the
mandatory options. Guest won't be happy, but that's fine, as this smoke
test doesn't want to run any guest code.
I like my idea better, because with it we can run unmodified standard
code. No testing of qtest_enabled().
However, you've got patches, and I haven't, and that means I like your
*patches* infinitely more than mine ;)
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [Qemu-devel] [PATCH for-1.6? v2 00/21] qtest: Test all targets
2013-08-06 8:39 ` [Qemu-devel] [PATCH for-1.6? v2 00/21] qtest: Test all targets Markus Armbruster
@ 2013-08-06 9:04 ` Andreas Färber
2013-08-06 9:45 ` Markus Armbruster
0 siblings, 1 reply; 38+ messages in thread
From: Andreas Färber @ 2013-08-06 9:04 UTC (permalink / raw)
To: Markus Armbruster
Cc: Anthony Liguori, Peter Maydell, qemu-devel, Aurélien Jarno
Am 06.08.2013 10:39, schrieb Markus Armbruster:
> Andreas Färber <afaerber@suse.de> writes:
>
>> Hello Anthony/Aurélien,
>>
>> This series extends test coverage to all 16 targets.
>> For now it tests that QOM type changes do not lead to QOM cast assertions.
>>
>> v2 extends it to cover virtually all machines (except Xen and pc*-x.y).
>> Where an fprintf() is touched, use error_report() instead.
>
> Yes, we need such a smoke test for all targets.
>
> I toyed with it myself, but I haven't been able to go beyond the crude
> hackery we discussed about a year ago:
> https://lists.nongnu.org/archive/html/qemu-devel/2012-08/msg01197.html
>
> The problem is that many targets have mandatory options (fun oxymoron),
> such as -kernel or -pflash.
>
> If I understand your approach correctly, you solve it by making these
> mandatory options optional when qtest_enabled().
>
> My idea was to create suitable dummy images, so we can provide the
> mandatory options. Guest won't be happy, but that's fine, as this smoke
> test doesn't want to run any guest code.
Peter rejected having a U-Boot per machine. And from my own arm porting
experiences that would mean having close to one source of U-Boot per
machine since upstreaming works really badly in the embedded world. :(
Anthony's JeOS project doesn't seem to be actively worked on any more,
at least my patch unbreaking .gitmodules never seemed to get
incorporated, and I ran into the issue of openrisc and unicore32 (the
targets where we didn't have any test images at the time) not having
upstream binutils/gcc support yet. I really hate to say: I did predict
one source of binutils/gcc/uClibc/kernel/etc. was not going to be
sufficient for all targets...
> I like my idea better, because with it we can run unmodified standard
> code. No testing of qtest_enabled().
>
> However, you've got patches, and I haven't, and that means I like your
> *patches* infinitely more than mine ;)
Thanks. I'm thinking "qtest" is easy to grep for in machines and most
should be easy to revert/replace once we have a better plan.
Andreas
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [Qemu-devel] [PATCH for-1.6? v2 00/21] qtest: Test all targets
2013-08-06 9:04 ` Andreas Färber
@ 2013-08-06 9:45 ` Markus Armbruster
0 siblings, 0 replies; 38+ messages in thread
From: Markus Armbruster @ 2013-08-06 9:45 UTC (permalink / raw)
To: Andreas Färber
Cc: Anthony Liguori, Peter Maydell, qemu-devel, Aurélien Jarno
Andreas Färber <afaerber@suse.de> writes:
> Am 06.08.2013 10:39, schrieb Markus Armbruster:
>> Andreas Färber <afaerber@suse.de> writes:
>>
>>> Hello Anthony/Aurélien,
>>>
>>> This series extends test coverage to all 16 targets.
>>> For now it tests that QOM type changes do not lead to QOM cast assertions.
>>>
>>> v2 extends it to cover virtually all machines (except Xen and pc*-x.y).
>>> Where an fprintf() is touched, use error_report() instead.
>>
>> Yes, we need such a smoke test for all targets.
>>
>> I toyed with it myself, but I haven't been able to go beyond the crude
>> hackery we discussed about a year ago:
>> https://lists.nongnu.org/archive/html/qemu-devel/2012-08/msg01197.html
>>
>> The problem is that many targets have mandatory options (fun oxymoron),
>> such as -kernel or -pflash.
>>
>> If I understand your approach correctly, you solve it by making these
>> mandatory options optional when qtest_enabled().
>>
>> My idea was to create suitable dummy images, so we can provide the
>> mandatory options. Guest won't be happy, but that's fine, as this smoke
>> test doesn't want to run any guest code.
>
> Peter rejected having a U-Boot per machine. And from my own arm porting
> experiences that would mean having close to one source of U-Boot per
> machine since upstreaming works really badly in the embedded world. :(
Mind, I said "dummy images". Just good enough to fool QEMU into loading
them. Guest surviving even a single cycle after reset is entirely
optional.
[...]
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [Qemu-devel] [PATCH for-1.6? v2 14/21] milkymist: Suppress -kernel/-bios/-drive error for qtest
2013-08-05 13:27 ` [Qemu-devel] [PATCH for-1.6? v2 14/21] milkymist: Suppress -kernel/-bios/-drive error " Andreas Färber
@ 2013-08-07 5:34 ` Michael Walle
0 siblings, 0 replies; 38+ messages in thread
From: Michael Walle @ 2013-08-07 5:34 UTC (permalink / raw)
To: Andreas Färber; +Cc: qemu-devel
Am 2013-08-05 15:27, schrieb Andreas Färber:
> Signed-off-by: Andreas Färber <afaerber@suse.de>
Acked-by: Michael Walle <michael@walle.cc>
> ---
> hw/lm32/milkymist.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/hw/lm32/milkymist.c b/hw/lm32/milkymist.c
> index 7ceedb8..a8e7230 100644
> --- a/hw/lm32/milkymist.c
> +++ b/hw/lm32/milkymist.c
> @@ -21,6 +21,7 @@
> #include "hw/hw.h"
> #include "hw/block/flash.h"
> #include "sysemu/sysemu.h"
> +#include "sysemu/qtest.h"
> #include "hw/devices.h"
> #include "hw/boards.h"
> #include "hw/loader.h"
> @@ -143,7 +144,7 @@ milkymist_init(QEMUMachineInitArgs *args)
> reset_info->bootstrap_pc = BIOS_OFFSET;
>
> /* if no kernel is given no valid bios rom is a fatal error */
> - if (!kernel_filename && !dinfo && !bios_filename) {
> + if (!kernel_filename && !dinfo && !bios_filename &&
> !qtest_enabled()) {
> fprintf(stderr, "qemu: could not load Milkymist One bios
> '%s'\n",
> bios_name);
> exit(1);
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [Qemu-devel] [PATCH for-1.6? v2 01/21] mips_mipssim: Silence BIOS loading warning for qtest
2013-08-05 13:27 ` [Qemu-devel] [PATCH for-1.6? v2 01/21] mips_mipssim: Silence BIOS loading warning for qtest Andreas Färber
@ 2013-08-07 10:12 ` Aurelien Jarno
0 siblings, 0 replies; 38+ messages in thread
From: Aurelien Jarno @ 2013-08-07 10:12 UTC (permalink / raw)
To: Andreas Färber; +Cc: qemu-devel
On Mon, Aug 05, 2013 at 03:27:07PM +0200, Andreas Färber wrote:
> Signed-off-by: Andreas Färber <afaerber@suse.de>
> ---
> hw/mips/mips_mipssim.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/hw/mips/mips_mipssim.c b/hw/mips/mips_mipssim.c
> index fea1a15..d8c4347 100644
> --- a/hw/mips/mips_mipssim.c
> +++ b/hw/mips/mips_mipssim.c
> @@ -37,6 +37,7 @@
> #include "elf.h"
> #include "hw/sysbus.h"
> #include "exec/address-spaces.h"
> +#include "sysemu/qtest.h"
>
> static struct _loaderparams {
> int ram_size;
> @@ -189,7 +190,8 @@ mips_mipssim_init(QEMUMachineInitArgs *args)
> } else {
> bios_size = -1;
> }
> - if ((bios_size < 0 || bios_size > BIOS_SIZE) && !kernel_filename) {
> + if ((bios_size < 0 || bios_size > BIOS_SIZE) &&
> + !kernel_filename && !qtest_enabled()) {
> /* Bail out if we have neither a kernel image nor boot vector code. */
> fprintf(stderr,
> "qemu: Warning, could not load MIPS bios '%s', and no -kernel argument was specified\n",
Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
--
Aurelien Jarno GPG: 1024D/F1BCDB73
aurelien@aurel32.net http://www.aurel32.net
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [Qemu-devel] [PATCH for-1.6? v2 18/21] shix: Drop debug output
2013-08-05 13:27 ` [Qemu-devel] [PATCH for-1.6? v2 18/21] shix: Drop debug output Andreas Färber
@ 2013-08-07 10:13 ` Aurelien Jarno
0 siblings, 0 replies; 38+ messages in thread
From: Aurelien Jarno @ 2013-08-07 10:13 UTC (permalink / raw)
To: Andreas Färber; +Cc: qemu-devel
On Mon, Aug 05, 2013 at 03:27:24PM +0200, Andreas Färber wrote:
> Signed-off-by: Andreas Färber <afaerber@suse.de>
> ---
> hw/sh4/shix.c | 7 -------
> 1 file changed, 7 deletions(-)
>
> diff --git a/hw/sh4/shix.c b/hw/sh4/shix.c
> index 84dd666..66cbea4 100644
> --- a/hw/sh4/shix.c
> +++ b/hw/sh4/shix.c
> @@ -50,7 +50,6 @@ static void shix_init(QEMUMachineInitArgs *args)
> if (!cpu_model)
> cpu_model = "any";
>
> - printf("Initializing CPU\n");
> cpu = cpu_sh4_init(cpu_model);
> if (cpu == NULL) {
> fprintf(stderr, "Unable to find CPU definition\n");
> @@ -58,16 +57,13 @@ static void shix_init(QEMUMachineInitArgs *args)
> }
>
> /* Allocate memory space */
> - printf("Allocating ROM\n");
> memory_region_init_ram(rom, NULL, "shix.rom", 0x4000);
> vmstate_register_ram_global(rom);
> memory_region_set_readonly(rom, true);
> memory_region_add_subregion(sysmem, 0x00000000, rom);
> - printf("Allocating SDRAM 1\n");
> memory_region_init_ram(&sdram[0], NULL, "shix.sdram1", 0x01000000);
> vmstate_register_ram_global(&sdram[0]);
> memory_region_add_subregion(sysmem, 0x08000000, &sdram[0]);
> - printf("Allocating SDRAM 2\n");
> memory_region_init_ram(&sdram[1], NULL, "shix.sdram2", 0x01000000);
> vmstate_register_ram_global(&sdram[1]);
> memory_region_add_subregion(sysmem, 0x0c000000, &sdram[1]);
> @@ -75,10 +71,8 @@ static void shix_init(QEMUMachineInitArgs *args)
> /* Load BIOS in 0 (and access it through P2, 0xA0000000) */
> if (bios_name == NULL)
> bios_name = BIOS_FILENAME;
> - printf("%s: load BIOS '%s'\n", __func__, bios_name);
> ret = load_image_targphys(bios_name, 0, 0x4000);
> if (ret < 0) { /* Check bios size */
> - fprintf(stderr, "ret=%d\n", ret);
> fprintf(stderr, "qemu: could not load SHIX bios '%s'\n",
> bios_name);
> exit(1);
> @@ -88,7 +82,6 @@ static void shix_init(QEMUMachineInitArgs *args)
> s = sh7750_init(cpu, sysmem);
> /* XXXXX Check success */
> tc58128_init(s, "shix_linux_nand.bin", NULL);
> - fprintf(stderr, "initialization terminated\n");
> }
>
> static QEMUMachine shix_machine = {
Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
--
Aurelien Jarno GPG: 1024D/F1BCDB73
aurelien@aurel32.net http://www.aurel32.net
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [Qemu-devel] [PATCH for-1.6? v2 19/21] shix: Don't require firmware presence for qtest
2013-08-05 13:27 ` [Qemu-devel] [PATCH for-1.6? v2 19/21] shix: Don't require firmware presence for qtest Andreas Färber
2013-08-06 8:05 ` Stefan Hajnoczi
@ 2013-08-07 10:13 ` Aurelien Jarno
1 sibling, 0 replies; 38+ messages in thread
From: Aurelien Jarno @ 2013-08-07 10:13 UTC (permalink / raw)
To: Andreas Färber; +Cc: Kevin Wolf, qemu-devel, Stefan Hajnoczi
On Mon, Aug 05, 2013 at 03:27:25PM +0200, Andreas Färber wrote:
> Adopt error_report() while at it.
>
> Signed-off-by: Andreas Färber <afaerber@suse.de>
> ---
> hw/block/tc58128.c | 10 ++++++----
> hw/sh4/shix.c | 9 +++++----
> 2 files changed, 11 insertions(+), 8 deletions(-)
>
> diff --git a/hw/block/tc58128.c b/hw/block/tc58128.c
> index a3929d4..728f1c3 100644
> --- a/hw/block/tc58128.c
> +++ b/hw/block/tc58128.c
> @@ -1,6 +1,8 @@
> #include "hw/hw.h"
> #include "hw/sh4/sh.h"
> #include "hw/loader.h"
> +#include "sysemu/qtest.h"
> +#include "qemu/error-report.h"
>
> #define CE1 0x0100
> #define CE2 0x0200
> @@ -36,10 +38,10 @@ static void init_dev(tc58128_dev * dev, const char *filename)
> /* Load flash image skipping the first block */
> ret = load_image(filename, dev->flash_contents + 528 * 32);
> if (ret < 0) {
> - fprintf(stderr, "ret=%d\n", ret);
> - fprintf(stderr, "qemu: could not load flash image %s\n",
> - filename);
> - exit(1);
> + if (!qtest_enabled()) {
> + error_report("Could not load flash image %s", filename);
> + exit(1);
> + }
> } else {
> /* Build first block with number of blocks */
> blocks = (ret + 528 * 32 - 1) / (528 * 32);
> diff --git a/hw/sh4/shix.c b/hw/sh4/shix.c
> index 66cbea4..5ee7af6 100644
> --- a/hw/sh4/shix.c
> +++ b/hw/sh4/shix.c
> @@ -30,9 +30,11 @@
> #include "hw/hw.h"
> #include "hw/sh4/sh.h"
> #include "sysemu/sysemu.h"
> +#include "sysemu/qtest.h"
> #include "hw/boards.h"
> #include "hw/loader.h"
> #include "exec/address-spaces.h"
> +#include "qemu/error-report.h"
>
> #define BIOS_FILENAME "shix_bios.bin"
> #define BIOS_ADDRESS 0xA0000000
> @@ -72,10 +74,9 @@ static void shix_init(QEMUMachineInitArgs *args)
> if (bios_name == NULL)
> bios_name = BIOS_FILENAME;
> ret = load_image_targphys(bios_name, 0, 0x4000);
> - if (ret < 0) { /* Check bios size */
> - fprintf(stderr, "qemu: could not load SHIX bios '%s'\n",
> - bios_name);
> - exit(1);
> + if (ret < 0 && !qtest_enabled()) {
> + error_report("Could not load SHIX bios '%s'", bios_name);
> + exit(1);
> }
>
> /* Register peripherals */
Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
--
Aurelien Jarno GPG: 1024D/F1BCDB73
aurelien@aurel32.net http://www.aurel32.net
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [Qemu-devel] [PATCH for-1.6? v2 15/21] ppc405_boards: Disable debug output
2013-08-05 13:27 ` [Qemu-devel] [PATCH for-1.6? v2 15/21] ppc405_boards: Disable debug output Andreas Färber
@ 2013-08-14 17:54 ` Alexander Graf
0 siblings, 0 replies; 38+ messages in thread
From: Alexander Graf @ 2013-08-14 17:54 UTC (permalink / raw)
To: Andreas Färber; +Cc: open list:ppc4xx, qemu-devel
On 05.08.2013, at 15:27, Andreas Färber wrote:
> Also move one stray debug output into an #ifdef.
>
> Signed-off-by: Andreas Färber <afaerber@suse.de>
Thanks, applied to ppc-next.
Alex
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [Qemu-devel] [PATCH for-1.6? v2 16/21] ppc405_uc: Disable debug output
2013-08-05 13:27 ` [Qemu-devel] [PATCH for-1.6? v2 16/21] ppc405_uc: " Andreas Färber
@ 2013-08-14 17:55 ` Alexander Graf
0 siblings, 0 replies; 38+ messages in thread
From: Alexander Graf @ 2013-08-14 17:55 UTC (permalink / raw)
To: Andreas Färber; +Cc: open list:ppc4xx, qemu-devel
On 05.08.2013, at 15:27, Andreas Färber wrote:
> Signed-off-by: Andreas Färber <afaerber@suse.de>
Thanks, applied to ppc-next.
Alex
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [Qemu-devel] [PATCH for-1.6? v2 17/21] ppc405_boards: Don't enforce presence of firmware for qtest
2013-08-05 13:27 ` [Qemu-devel] [PATCH for-1.6? v2 17/21] ppc405_boards: Don't enforce presence of firmware for qtest Andreas Färber
@ 2013-08-14 17:55 ` Alexander Graf
0 siblings, 0 replies; 38+ messages in thread
From: Alexander Graf @ 2013-08-14 17:55 UTC (permalink / raw)
To: Andreas Färber; +Cc: open list:ppc4xx, qemu-devel
On 05.08.2013, at 15:27, Andreas Färber wrote:
> Adopt error_report() while at it.
>
> Signed-off-by: Andreas Färber <afaerber@suse.de>
Thanks, applied to ppc-next.
Alex
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [Qemu-devel] [PATCH for-1.6? v2 21/21] qtest: Prepare QOM machine tests
2013-08-05 13:27 ` [Qemu-devel] [PATCH for-1.6? v2 21/21] qtest: Prepare QOM machine tests Andreas Färber
@ 2013-08-25 17:22 ` Alexander Graf
2013-08-25 17:34 ` Andreas Färber
2013-08-25 17:33 ` Peter Maydell
1 sibling, 1 reply; 38+ messages in thread
From: Alexander Graf @ 2013-08-25 17:22 UTC (permalink / raw)
To: Andreas Färber; +Cc: qemu-devel
On 05.08.2013, at 14:27, Andreas Färber wrote:
> Instantiate all [*] machines per target, so that they get a bit of test
> coverage at all. This has proven helpful during QOM refactorings.
>
> [*] ppcemb target contains some non-working non-embedded machines, and
> ppc405 CPUs are not available there either.
So I just looked up the spec and ppc405 does support 1k TLB entries, so it is eligible for the ppcemb target. The fact that it doesn't work is a bug :).
> i386 and x86_64 do not cover pc*-x.y or xenfv.
>
> Signed-off-by: Andreas Färber <afaerber@suse.de>
> ---
> tests/Makefile | 26 ++++++
> tests/qom-test.c | 280 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
> 2 files changed, 306 insertions(+)
> create mode 100644 tests/qom-test.c
>
> diff --git a/tests/Makefile b/tests/Makefile
> index d044908..a7e1319 100644
> --- a/tests/Makefile
> +++ b/tests/Makefile
> @@ -63,25 +63,50 @@ check-qtest-i386-y += tests/boot-order-test$(EXESUF)
> check-qtest-i386-y += tests/rtc-test$(EXESUF)
> check-qtest-i386-y += tests/i440fx-test$(EXESUF)
> check-qtest-i386-y += tests/fw_cfg-test$(EXESUF)
> +check-qtest-i386-y += tests/qom-test$(EXESUF)
> check-qtest-x86_64-y = $(check-qtest-i386-y)
> gcov-files-i386-y += i386-softmmu/hw/mc146818rtc.c
> gcov-files-x86_64-y = $(subst i386-softmmu/,x86_64-softmmu/,$(gcov-files-i386-y))
> check-qtest-mips-y = tests/endianness-test$(EXESUF)
> check-qtest-mips64-y = tests/endianness-test$(EXESUF)
> check-qtest-mips64el-y = tests/endianness-test$(EXESUF)
> +check-qtest-mips-y += tests/qom-test$(EXESUF)
> +check-qtest-mipsel-y += tests/qom-test$(EXESUF)
> +check-qtest-mips64-y += tests/qom-test$(EXESUF)
> +check-qtest-mips64el-y += tests/qom-test$(EXESUF)
> check-qtest-ppc-y = tests/endianness-test$(EXESUF)
> check-qtest-ppc64-y = tests/endianness-test$(EXESUF)
> check-qtest-sh4-y = tests/endianness-test$(EXESUF)
> check-qtest-sh4eb-y = tests/endianness-test$(EXESUF)
> +check-qtest-sh4-y += tests/qom-test$(EXESUF)
> +check-qtest-sh4eb-y += tests/qom-test$(EXESUF)
> check-qtest-sparc64-y = tests/endianness-test$(EXESUF)
> #check-qtest-sparc-y = tests/m48t59-test$(EXESUF)
> #check-qtest-sparc64-y += tests/m48t59-test$(EXESUF)
> gcov-files-sparc-y += hw/m48t59.c
> gcov-files-sparc64-y += hw/m48t59.c
> +check-qtest-sparc-y += tests/qom-test$(EXESUF)
> +check-qtest-sparc64-y += tests/qom-test$(EXESUF)
> check-qtest-arm-y = tests/tmp105-test$(EXESUF)
> gcov-files-arm-y += hw/tmp105.c
> +check-qtest-arm-y += tests/qom-test$(EXESUF)
> check-qtest-ppc-y += tests/boot-order-test$(EXESUF)
> check-qtest-ppc64-y += tests/boot-order-test$(EXESUF)
> +check-qtest-ppc-y += tests/qom-test$(EXESUF)
> +check-qtest-ppc64-y += tests/qom-test$(EXESUF)
> +check-qtest-ppcemb-y += tests/qom-test$(EXESUF)
> +check-qtest-alpha-y += tests/qom-test$(EXESUF)
> +check-qtest-cris-y += tests/qom-test$(EXESUF)
> +check-qtest-lm32-y += tests/qom-test$(EXESUF)
> +check-qtest-m68k-y += tests/qom-test$(EXESUF)
> +check-qtest-microblaze-y += tests/qom-test$(EXESUF)
> +check-qtest-microblazeel-y = $(check-qtest-microblaze-y)
> +check-qtest-moxie-y += tests/qom-test$(EXESUF)
> +check-qtest-or32-y += tests/qom-test$(EXESUF)
> +check-qtest-s390x-y += tests/qom-test$(EXESUF)
> +check-qtest-unicore32-y += tests/qom-test$(EXESUF)
> +check-qtest-xtensa-y += tests/qom-test$(EXESUF)
> +check-qtest-xtensaeb-y = $(check-qtest-xtensa-y)
>
> check-qapi-schema-y := $(addprefix tests/qapi-schema/, \
> comments.json empty.json funny-char.json indented-expr.json \
> @@ -161,6 +186,7 @@ tests/boot-order-test$(EXESUF): tests/boot-order-test.o $(libqos-obj-y)
> tests/tmp105-test$(EXESUF): tests/tmp105-test.o $(libqos-omap-obj-y)
> tests/i440fx-test$(EXESUF): tests/i440fx-test.o $(libqos-pc-obj-y)
> tests/fw_cfg-test$(EXESUF): tests/fw_cfg-test.o $(libqos-pc-obj-y)
> +tests/qom-test$(EXESUF): tests/qom-test.o
>
> # QTest rules
>
> diff --git a/tests/qom-test.c b/tests/qom-test.c
> new file mode 100644
> index 0000000..c9494e0
> --- /dev/null
> +++ b/tests/qom-test.c
> @@ -0,0 +1,280 @@
> +/*
> + * QTest testcase for QOM
> + *
> + * Copyright (c) 2013 SUSE LINUX Products GmbH
> + *
> + * This work is licensed under the terms of the GNU GPL, version 2 or later.
> + * See the COPYING file in the top-level directory.
> + */
> +#include "libqtest.h"
> +
> +#include <glib.h>
> +#include <string.h>
> +#include "qemu/osdep.h"
> +
> +static void test_nop(gconstpointer data)
> +{
> + QTestState *s;
> + const char *machine = data;
> + char *args;
> +
> + args = g_strdup_printf("-display none -machine %s", machine);
> + s = qtest_start(args);
> + if (s) {
> + qtest_quit(s);
> + }
> + g_free(args);
> +}
> +
> +static const char *x86_machines[] = {
> + "pc",
> + "isapc",
> + "q35",
> +};
> +
> +static const char *alpha_machines[] = {
> + "clipper",
> +};
> +
> +static const char *arm_machines[] = {
> + "integratorcp",
> + "versatilepb",
> + "versatileab",
> + "lm3s811evb",
> + "lm3s6965evb",
> + "collie",
> + "akita",
> + "spitz",
> + "borzoi",
> + "terrier",
> + "tosa",
> + "cheetah",
> + "sx1-v1",
> + "sx1",
> + "realview-eb",
> + "realview-eb-mpcore",
> + "realview-pb-a8",
> + "realview-pbx-a9",
> + "musicpal",
> + "mainstone",
> + "connex",
> + "verdex",
> + "z2",
> + "n800",
> + "n810",
> + "kzm",
> + "vexpress-a9",
> + "vexpress-a15",
> + "smdkc210",
> + "nuri",
> + "xilinx-zynq-a9",
> + "highbank",
> + "midway",
> +};
> +
> +static const char *cris_machines[] = {
> + "axis-dev88",
> +};
> +
> +static const char *lm32_machines[] = {
> + "lm32-evr",
> + "lm32-uclinux",
> + "milkymist",
> +};
> +
> +static const char *m68k_machines[] = {
> + "mcf5208evb",
> + "an5206",
> + "dummy",
> +};
> +
> +static const char *microblaze_machines[] = {
> + "petalogix-ml605",
> + "petalogix-s3adsp1800",
> +};
> +
> +static const char *mips_machines[] = {
> + "malta",
> + "magnum",
> + "mips",
> + "mipssim",
> + "pica61",
> +};
> +
> +static const char *moxie_machines[] = {
> + "moxiesim",
> +};
> +
> +static const char *openrisc_machines[] = {
> + "or32-sim",
> +};
> +
> +static const char *ppc_machines[] = {
> + "g3beige",
> + "mac99",
> + "prep",
> + "mpc8544ds",
> + "ppce500",
> +};
> +
> +static const char *ppc405_machines[] = {
> + "ref405ep",
> + "taihu",
> +};
> +
> +static const char *ppc440_machines[] = {
> + "bamboo",
> + "virtex-ml507",
> +};
> +
> +static const char *s390_machines[] = {
> + "s390-virtio",
> + "s390-ccw-virtio",
> +};
> +
> +static const char *superh_machines[] = {
> + "r2d",
> + "shix",
> +};
> +
> +static const char *sparc_machines[] = {
> + "SS-4",
> + "SS-5",
> + "SS-10",
> + "SS-20",
> + "SS-600MP",
> + "LX",
> + "SPARCClassic",
> + "SPARCbook",
> + "leon3_generic",
> +};
> +
> +static const char *sparc64_machines[] = {
> + "sun4u",
> + "sun4v",
> + "Niagara",
> +};
> +
> +static const char *unicore32_machines[] = {
> + "puv3",
> +};
> +
> +static const char *xtensa_machines[] = {
> + "sim",
> + "lx60",
> + "lx200",
> +};
> +
> +static void add_test_cases(const char *arch, const char *machine)
> +{
> + char *path;
> + path = g_strdup_printf("/%s/qom/%s", arch, machine);
> + g_test_add_data_func(path, machine, test_nop);
> +}
> +
> +int main(int argc, char **argv)
> +{
> + const char *arch = qtest_get_arch();
> + int i;
> +
> + g_test_init(&argc, &argv, NULL);
> +
> + add_test_cases(arch, "none");
> +
> + if (strcmp(arch, "i386") == 0 ||
> + strcmp(arch, "x86_64") == 0) {
> + for (i = 0; i < ARRAY_SIZE(x86_machines); i++) {
> + add_test_cases(arch, x86_machines[i]);
> + }
> + } else if (strcmp(arch, "alpha") == 0) {
> + for (i = 0; i < ARRAY_SIZE(alpha_machines); i++) {
> + add_test_cases(arch, alpha_machines[i]);
> + }
> + } else if (strcmp(arch, "arm") == 0) {
> + for (i = 0; i < ARRAY_SIZE(arm_machines); i++) {
> + add_test_cases(arch, arm_machines[i]);
> + }
> + } else if (strcmp(arch, "cris") == 0) {
> + for (i = 0; i < ARRAY_SIZE(cris_machines); i++) {
> + add_test_cases(arch, cris_machines[i]);
> + }
> + } else if (strcmp(arch, "lm32") == 0) {
> + for (i = 0; i < ARRAY_SIZE(lm32_machines); i++) {
> + add_test_cases(arch, lm32_machines[i]);
> + }
> + } else if (strcmp(arch, "m68k") == 0) {
> + for (i = 0; i < ARRAY_SIZE(m68k_machines); i++) {
> + add_test_cases(arch, m68k_machines[i]);
> + }
> + } else if (strcmp(arch, "microblaze") == 0 ||
> + strcmp(arch, "microblazeel") == 0) {
> + for (i = 0; i < ARRAY_SIZE(microblaze_machines); i++) {
> + add_test_cases(arch, microblaze_machines[i]);
> + }
> + } else if (strcmp(arch, "mips") == 0 ||
> + strcmp(arch, "mipsel") == 0 ||
> + strcmp(arch, "mips64") == 0 ||
> + strcmp(arch, "mips64el") == 0) {
strncmp?
> + for (i = 0; i < ARRAY_SIZE(mips_machines); i++) {
> + add_test_cases(arch, mips_machines[i]);
> + }
> + if (strcmp(arch, "mips64el") == 0) {
> + add_test_cases(arch, "fulong2e");
> + }
> + } else if (strcmp(arch, "moxie") == 0) {
> + for (i = 0; i < ARRAY_SIZE(moxie_machines); i++) {
> + add_test_cases(arch, moxie_machines[i]);
> + }
> + } else if (strcmp(arch, "or32") == 0) {
> + for (i = 0; i < ARRAY_SIZE(openrisc_machines); i++) {
> + add_test_cases(arch, openrisc_machines[i]);
> + }
> + } else if (strcmp(arch, "ppc") == 0 ||
> + strcmp(arch, "ppc64") == 0 ||
> + strcmp(arch, "ppcemb") == 0) {
I think it's more readable to list the targets individually here in separate branches.
ppcemb
ppcemb_machines
ppc
ppcemb_machines
ppc_machines
ppc64
ppcemb_machines
ppc_machines
ppc64_machines
with ppcemb_machines == ppc405_machines + ppc440_machines.
I think it would also make sense to create a macro for the for loops
#define MACHINES_ADD(array) for (i = 0; i < ARRAY_SIZE(array); i++) { \
add_test_cases(arch, array[i]); \
}
} else if(!strcmp(arch, "ppcemb")) {
MACHINES_ADD(ppcemb_machines);
} else if(!strcmp(arch, "ppc")) {
MACHINES_ADD(ppcemb_machines);
MACHINES_ADD(ppc_machines);
} else if (!strcmp(arch, "ppc64")) {
MACHINES_ADD(ppcemb_machines);
MACHINES_ADD(ppc_machines);
MACHINES_ADD(ppc64_machines);
}
> + if (strcmp(arch, "ppcemb") != 0) {
> + /* XXX Currently available in ppcemb but shouldn't be */
> + for (i = 0; i < ARRAY_SIZE(ppc_machines); i++) {
> + add_test_cases(arch, ppc_machines[i]);
> + }
> + /* XXX Currently available in ppcemb but don't work */
> + for (i = 0; i < ARRAY_SIZE(ppc405_machines); i++) {
> + add_test_cases(arch, ppc405_machines[i]);
> + }
> + }
> + for (i = 0; i < ARRAY_SIZE(ppc440_machines); i++) {
> + add_test_cases(arch, ppc440_machines[i]);
> + }
> + if (strcmp(arch, "ppc64") == 0) {
> + add_test_cases(arch, "pseries");
> + }
> + } else if (strcmp(arch, "s390x") == 0) {
> + for (i = 0; i < ARRAY_SIZE(s390_machines); i++) {
> + add_test_cases(arch, s390_machines[i]);
> + }
> + } else if (strcmp(arch, "sh4") == 0 ||
> + strcmp(arch, "sh4eb") == 0) {
strncmp maybe?
> + for (i = 0; i < ARRAY_SIZE(superh_machines); i++) {
> + add_test_cases(arch, superh_machines[i]);
> + }
> + } else if (strcmp(arch, "sparc") == 0) {
> + for (i = 0; i < ARRAY_SIZE(sparc_machines); i++) {
> + add_test_cases(arch, sparc_machines[i]);
> + }
> + } else if (strcmp(arch, "sparc64") == 0) {
> + for (i = 0; i < ARRAY_SIZE(sparc64_machines); i++) {
> + add_test_cases(arch, sparc64_machines[i]);
> + }
> + } else if (strcmp(arch, "unicore32") == 0) {
> + for (i = 0; i < ARRAY_SIZE(unicore32_machines); i++) {
> + add_test_cases(arch, unicore32_machines[i]);
> + }
> + } else if (strcmp(arch, "xtensa") == 0 ||
> + strcmp(arch, "xtensaeb") == 0) {
strncmp?
Alex
> + for (i = 0; i < ARRAY_SIZE(xtensa_machines); i++) {
> + add_test_cases(arch, xtensa_machines[i]);
> + }
> + }
> +
> + return g_test_run();
> +}
> --
> 1.8.1.4
>
>
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [Qemu-devel] [PATCH for-1.6? v2 21/21] qtest: Prepare QOM machine tests
2013-08-05 13:27 ` [Qemu-devel] [PATCH for-1.6? v2 21/21] qtest: Prepare QOM machine tests Andreas Färber
2013-08-25 17:22 ` Alexander Graf
@ 2013-08-25 17:33 ` Peter Maydell
2013-08-25 17:42 ` Andreas Färber
1 sibling, 1 reply; 38+ messages in thread
From: Peter Maydell @ 2013-08-25 17:33 UTC (permalink / raw)
To: Andreas Färber; +Cc: QEMU Developers
On 5 August 2013 14:27, Andreas Färber <afaerber@suse.de> wrote:
> +static const char *arm_machines[] = {
> + "integratorcp",
> + "versatilepb",
> + "versatileab",
> + "lm3s811evb",
> + "lm3s6965evb",
> + "collie",
[etc]
I'd rather have these tests than not have them, but can't we autodetect
the list of machines (by parsing the output of -M help, or otherwise)?
-- PMM
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [Qemu-devel] [PATCH for-1.6? v2 21/21] qtest: Prepare QOM machine tests
2013-08-25 17:22 ` Alexander Graf
@ 2013-08-25 17:34 ` Andreas Färber
0 siblings, 0 replies; 38+ messages in thread
From: Andreas Färber @ 2013-08-25 17:34 UTC (permalink / raw)
To: Alexander Graf; +Cc: qemu-devel
Am 25.08.2013 19:22, schrieb Alexander Graf:
>
> On 05.08.2013, at 14:27, Andreas Färber wrote:
>
>> Instantiate all [*] machines per target, so that they get a bit of test
>> coverage at all. This has proven helpful during QOM refactorings.
>>
>> [*] ppcemb target contains some non-working non-embedded machines, and
>> ppc405 CPUs are not available there either.
>
> So I just looked up the spec and ppc405 does support 1k TLB entries, so it is eligible for the ppcemb target. The fact that it doesn't work is a bug :).
Thanks for clarifying!
>> i386 and x86_64 do not cover pc*-x.y or xenfv.
>>
>> Signed-off-by: Andreas Färber <afaerber@suse.de>
>> ---
>> tests/Makefile | 26 ++++++
>> tests/qom-test.c | 280 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
>> 2 files changed, 306 insertions(+)
>> create mode 100644 tests/qom-test.c
>>
>> diff --git a/tests/Makefile b/tests/Makefile
>> index d044908..a7e1319 100644
>> --- a/tests/Makefile
>> +++ b/tests/Makefile
>> @@ -63,25 +63,50 @@ check-qtest-i386-y += tests/boot-order-test$(EXESUF)
>> check-qtest-i386-y += tests/rtc-test$(EXESUF)
>> check-qtest-i386-y += tests/i440fx-test$(EXESUF)
>> check-qtest-i386-y += tests/fw_cfg-test$(EXESUF)
>> +check-qtest-i386-y += tests/qom-test$(EXESUF)
>> check-qtest-x86_64-y = $(check-qtest-i386-y)
>> gcov-files-i386-y += i386-softmmu/hw/mc146818rtc.c
>> gcov-files-x86_64-y = $(subst i386-softmmu/,x86_64-softmmu/,$(gcov-files-i386-y))
>> check-qtest-mips-y = tests/endianness-test$(EXESUF)
>> check-qtest-mips64-y = tests/endianness-test$(EXESUF)
>> check-qtest-mips64el-y = tests/endianness-test$(EXESUF)
>> +check-qtest-mips-y += tests/qom-test$(EXESUF)
>> +check-qtest-mipsel-y += tests/qom-test$(EXESUF)
>> +check-qtest-mips64-y += tests/qom-test$(EXESUF)
>> +check-qtest-mips64el-y += tests/qom-test$(EXESUF)
>> check-qtest-ppc-y = tests/endianness-test$(EXESUF)
>> check-qtest-ppc64-y = tests/endianness-test$(EXESUF)
>> check-qtest-sh4-y = tests/endianness-test$(EXESUF)
>> check-qtest-sh4eb-y = tests/endianness-test$(EXESUF)
>> +check-qtest-sh4-y += tests/qom-test$(EXESUF)
>> +check-qtest-sh4eb-y += tests/qom-test$(EXESUF)
>> check-qtest-sparc64-y = tests/endianness-test$(EXESUF)
>> #check-qtest-sparc-y = tests/m48t59-test$(EXESUF)
>> #check-qtest-sparc64-y += tests/m48t59-test$(EXESUF)
>> gcov-files-sparc-y += hw/m48t59.c
>> gcov-files-sparc64-y += hw/m48t59.c
>> +check-qtest-sparc-y += tests/qom-test$(EXESUF)
>> +check-qtest-sparc64-y += tests/qom-test$(EXESUF)
>> check-qtest-arm-y = tests/tmp105-test$(EXESUF)
>> gcov-files-arm-y += hw/tmp105.c
>> +check-qtest-arm-y += tests/qom-test$(EXESUF)
>> check-qtest-ppc-y += tests/boot-order-test$(EXESUF)
>> check-qtest-ppc64-y += tests/boot-order-test$(EXESUF)
>> +check-qtest-ppc-y += tests/qom-test$(EXESUF)
>> +check-qtest-ppc64-y += tests/qom-test$(EXESUF)
>> +check-qtest-ppcemb-y += tests/qom-test$(EXESUF)
>> +check-qtest-alpha-y += tests/qom-test$(EXESUF)
>> +check-qtest-cris-y += tests/qom-test$(EXESUF)
>> +check-qtest-lm32-y += tests/qom-test$(EXESUF)
>> +check-qtest-m68k-y += tests/qom-test$(EXESUF)
>> +check-qtest-microblaze-y += tests/qom-test$(EXESUF)
>> +check-qtest-microblazeel-y = $(check-qtest-microblaze-y)
>> +check-qtest-moxie-y += tests/qom-test$(EXESUF)
>> +check-qtest-or32-y += tests/qom-test$(EXESUF)
>> +check-qtest-s390x-y += tests/qom-test$(EXESUF)
>> +check-qtest-unicore32-y += tests/qom-test$(EXESUF)
>> +check-qtest-xtensa-y += tests/qom-test$(EXESUF)
>> +check-qtest-xtensaeb-y = $(check-qtest-xtensa-y)
>>
>> check-qapi-schema-y := $(addprefix tests/qapi-schema/, \
>> comments.json empty.json funny-char.json indented-expr.json \
>> @@ -161,6 +186,7 @@ tests/boot-order-test$(EXESUF): tests/boot-order-test.o $(libqos-obj-y)
>> tests/tmp105-test$(EXESUF): tests/tmp105-test.o $(libqos-omap-obj-y)
>> tests/i440fx-test$(EXESUF): tests/i440fx-test.o $(libqos-pc-obj-y)
>> tests/fw_cfg-test$(EXESUF): tests/fw_cfg-test.o $(libqos-pc-obj-y)
>> +tests/qom-test$(EXESUF): tests/qom-test.o
>>
>> # QTest rules
>>
>> diff --git a/tests/qom-test.c b/tests/qom-test.c
>> new file mode 100644
>> index 0000000..c9494e0
>> --- /dev/null
>> +++ b/tests/qom-test.c
>> @@ -0,0 +1,280 @@
>> +/*
>> + * QTest testcase for QOM
>> + *
>> + * Copyright (c) 2013 SUSE LINUX Products GmbH
>> + *
>> + * This work is licensed under the terms of the GNU GPL, version 2 or later.
>> + * See the COPYING file in the top-level directory.
>> + */
>> +#include "libqtest.h"
>> +
>> +#include <glib.h>
>> +#include <string.h>
>> +#include "qemu/osdep.h"
>> +
>> +static void test_nop(gconstpointer data)
>> +{
>> + QTestState *s;
>> + const char *machine = data;
>> + char *args;
>> +
>> + args = g_strdup_printf("-display none -machine %s", machine);
>> + s = qtest_start(args);
>> + if (s) {
>> + qtest_quit(s);
>> + }
>> + g_free(args);
>> +}
>> +
>> +static const char *x86_machines[] = {
>> + "pc",
>> + "isapc",
>> + "q35",
>> +};
>> +
>> +static const char *alpha_machines[] = {
>> + "clipper",
>> +};
>> +
>> +static const char *arm_machines[] = {
>> + "integratorcp",
>> + "versatilepb",
>> + "versatileab",
>> + "lm3s811evb",
>> + "lm3s6965evb",
>> + "collie",
>> + "akita",
>> + "spitz",
>> + "borzoi",
>> + "terrier",
>> + "tosa",
>> + "cheetah",
>> + "sx1-v1",
>> + "sx1",
>> + "realview-eb",
>> + "realview-eb-mpcore",
>> + "realview-pb-a8",
>> + "realview-pbx-a9",
>> + "musicpal",
>> + "mainstone",
>> + "connex",
>> + "verdex",
>> + "z2",
>> + "n800",
>> + "n810",
>> + "kzm",
>> + "vexpress-a9",
>> + "vexpress-a15",
>> + "smdkc210",
>> + "nuri",
>> + "xilinx-zynq-a9",
>> + "highbank",
>> + "midway",
>> +};
>> +
>> +static const char *cris_machines[] = {
>> + "axis-dev88",
>> +};
>> +
>> +static const char *lm32_machines[] = {
>> + "lm32-evr",
>> + "lm32-uclinux",
>> + "milkymist",
>> +};
>> +
>> +static const char *m68k_machines[] = {
>> + "mcf5208evb",
>> + "an5206",
>> + "dummy",
>> +};
>> +
>> +static const char *microblaze_machines[] = {
>> + "petalogix-ml605",
>> + "petalogix-s3adsp1800",
>> +};
>> +
>> +static const char *mips_machines[] = {
>> + "malta",
>> + "magnum",
>> + "mips",
>> + "mipssim",
>> + "pica61",
>> +};
>> +
>> +static const char *moxie_machines[] = {
>> + "moxiesim",
>> +};
>> +
>> +static const char *openrisc_machines[] = {
>> + "or32-sim",
>> +};
>> +
>> +static const char *ppc_machines[] = {
>> + "g3beige",
>> + "mac99",
>> + "prep",
>> + "mpc8544ds",
>> + "ppce500",
>> +};
>> +
>> +static const char *ppc405_machines[] = {
>> + "ref405ep",
>> + "taihu",
>> +};
>> +
>> +static const char *ppc440_machines[] = {
>> + "bamboo",
>> + "virtex-ml507",
>> +};
>> +
>> +static const char *s390_machines[] = {
>> + "s390-virtio",
>> + "s390-ccw-virtio",
>> +};
>> +
>> +static const char *superh_machines[] = {
>> + "r2d",
>> + "shix",
>> +};
>> +
>> +static const char *sparc_machines[] = {
>> + "SS-4",
>> + "SS-5",
>> + "SS-10",
>> + "SS-20",
>> + "SS-600MP",
>> + "LX",
>> + "SPARCClassic",
>> + "SPARCbook",
>> + "leon3_generic",
>> +};
>> +
>> +static const char *sparc64_machines[] = {
>> + "sun4u",
>> + "sun4v",
>> + "Niagara",
>> +};
>> +
>> +static const char *unicore32_machines[] = {
>> + "puv3",
>> +};
>> +
>> +static const char *xtensa_machines[] = {
>> + "sim",
>> + "lx60",
>> + "lx200",
>> +};
>> +
>> +static void add_test_cases(const char *arch, const char *machine)
>> +{
>> + char *path;
>> + path = g_strdup_printf("/%s/qom/%s", arch, machine);
>> + g_test_add_data_func(path, machine, test_nop);
>> +}
>> +
>> +int main(int argc, char **argv)
>> +{
>> + const char *arch = qtest_get_arch();
>> + int i;
>> +
>> + g_test_init(&argc, &argv, NULL);
>> +
>> + add_test_cases(arch, "none");
>> +
>> + if (strcmp(arch, "i386") == 0 ||
>> + strcmp(arch, "x86_64") == 0) {
>> + for (i = 0; i < ARRAY_SIZE(x86_machines); i++) {
>> + add_test_cases(arch, x86_machines[i]);
>> + }
>> + } else if (strcmp(arch, "alpha") == 0) {
>> + for (i = 0; i < ARRAY_SIZE(alpha_machines); i++) {
>> + add_test_cases(arch, alpha_machines[i]);
>> + }
>> + } else if (strcmp(arch, "arm") == 0) {
>> + for (i = 0; i < ARRAY_SIZE(arm_machines); i++) {
>> + add_test_cases(arch, arm_machines[i]);
>> + }
>> + } else if (strcmp(arch, "cris") == 0) {
>> + for (i = 0; i < ARRAY_SIZE(cris_machines); i++) {
>> + add_test_cases(arch, cris_machines[i]);
>> + }
>> + } else if (strcmp(arch, "lm32") == 0) {
>> + for (i = 0; i < ARRAY_SIZE(lm32_machines); i++) {
>> + add_test_cases(arch, lm32_machines[i]);
>> + }
>> + } else if (strcmp(arch, "m68k") == 0) {
>> + for (i = 0; i < ARRAY_SIZE(m68k_machines); i++) {
>> + add_test_cases(arch, m68k_machines[i]);
>> + }
>> + } else if (strcmp(arch, "microblaze") == 0 ||
>> + strcmp(arch, "microblazeel") == 0) {
>> + for (i = 0; i < ARRAY_SIZE(microblaze_machines); i++) {
>> + add_test_cases(arch, microblaze_machines[i]);
>> + }
>> + } else if (strcmp(arch, "mips") == 0 ||
>> + strcmp(arch, "mipsel") == 0 ||
>> + strcmp(arch, "mips64") == 0 ||
>> + strcmp(arch, "mips64el") == 0) {
>
> strncmp?
I don't like the idea of allowing trailing junk so much...
>> + for (i = 0; i < ARRAY_SIZE(mips_machines); i++) {
>> + add_test_cases(arch, mips_machines[i]);
>> + }
>> + if (strcmp(arch, "mips64el") == 0) {
>> + add_test_cases(arch, "fulong2e");
>> + }
>> + } else if (strcmp(arch, "moxie") == 0) {
>> + for (i = 0; i < ARRAY_SIZE(moxie_machines); i++) {
>> + add_test_cases(arch, moxie_machines[i]);
>> + }
>> + } else if (strcmp(arch, "or32") == 0) {
>> + for (i = 0; i < ARRAY_SIZE(openrisc_machines); i++) {
>> + add_test_cases(arch, openrisc_machines[i]);
>> + }
>> + } else if (strcmp(arch, "ppc") == 0 ||
>> + strcmp(arch, "ppc64") == 0 ||
>> + strcmp(arch, "ppcemb") == 0) {
>
> I think it's more readable to list the targets individually here in separate branches.
>
> ppcemb
> ppcemb_machines
> ppc
> ppcemb_machines
> ppc_machines
> ppc64
> ppcemb_machines
> ppc_machines
> ppc64_machines
>
> with ppcemb_machines == ppc405_machines + ppc440_machines.
>
> I think it would also make sense to create a macro for the for loops
>
> #define MACHINES_ADD(array) for (i = 0; i < ARRAY_SIZE(array); i++) { \
> add_test_cases(arch, array[i]); \
> }
>
> } else if(!strcmp(arch, "ppcemb")) {
> MACHINES_ADD(ppcemb_machines);
> } else if(!strcmp(arch, "ppc")) {
> MACHINES_ADD(ppcemb_machines);
> MACHINES_ADD(ppc_machines);
> } else if (!strcmp(arch, "ppc64")) {
> MACHINES_ADD(ppcemb_machines);
> MACHINES_ADD(ppc_machines);
> MACHINES_ADD(ppc64_machines);
> }
Good idea!
Thanks,
Andreas
>
>> + if (strcmp(arch, "ppcemb") != 0) {
>> + /* XXX Currently available in ppcemb but shouldn't be */
>> + for (i = 0; i < ARRAY_SIZE(ppc_machines); i++) {
>> + add_test_cases(arch, ppc_machines[i]);
>> + }
>> + /* XXX Currently available in ppcemb but don't work */
>> + for (i = 0; i < ARRAY_SIZE(ppc405_machines); i++) {
>> + add_test_cases(arch, ppc405_machines[i]);
>> + }
>> + }
>> + for (i = 0; i < ARRAY_SIZE(ppc440_machines); i++) {
>> + add_test_cases(arch, ppc440_machines[i]);
>> + }
>> + if (strcmp(arch, "ppc64") == 0) {
>> + add_test_cases(arch, "pseries");
>> + }
>> + } else if (strcmp(arch, "s390x") == 0) {
>> + for (i = 0; i < ARRAY_SIZE(s390_machines); i++) {
>> + add_test_cases(arch, s390_machines[i]);
>> + }
>> + } else if (strcmp(arch, "sh4") == 0 ||
>> + strcmp(arch, "sh4eb") == 0) {
>
> strncmp maybe?
>
>> + for (i = 0; i < ARRAY_SIZE(superh_machines); i++) {
>> + add_test_cases(arch, superh_machines[i]);
>> + }
>> + } else if (strcmp(arch, "sparc") == 0) {
>> + for (i = 0; i < ARRAY_SIZE(sparc_machines); i++) {
>> + add_test_cases(arch, sparc_machines[i]);
>> + }
>> + } else if (strcmp(arch, "sparc64") == 0) {
>> + for (i = 0; i < ARRAY_SIZE(sparc64_machines); i++) {
>> + add_test_cases(arch, sparc64_machines[i]);
>> + }
>> + } else if (strcmp(arch, "unicore32") == 0) {
>> + for (i = 0; i < ARRAY_SIZE(unicore32_machines); i++) {
>> + add_test_cases(arch, unicore32_machines[i]);
>> + }
>> + } else if (strcmp(arch, "xtensa") == 0 ||
>> + strcmp(arch, "xtensaeb") == 0) {
>
> strncmp?
>
>
> Alex
>
>> + for (i = 0; i < ARRAY_SIZE(xtensa_machines); i++) {
>> + add_test_cases(arch, xtensa_machines[i]);
>> + }
>> + }
>> +
>> + return g_test_run();
>> +}
>> --
>> 1.8.1.4
>>
>>
>
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [Qemu-devel] [PATCH for-1.6? v2 21/21] qtest: Prepare QOM machine tests
2013-08-25 17:33 ` Peter Maydell
@ 2013-08-25 17:42 ` Andreas Färber
2013-08-26 13:19 ` Luiz Capitulino
0 siblings, 1 reply; 38+ messages in thread
From: Andreas Färber @ 2013-08-25 17:42 UTC (permalink / raw)
To: Peter Maydell; +Cc: QEMU Developers, Luiz Capitulino
Am 25.08.2013 19:33, schrieb Peter Maydell:
> On 5 August 2013 14:27, Andreas Färber <afaerber@suse.de> wrote:
>> +static const char *arm_machines[] = {
>> + "integratorcp",
>> + "versatilepb",
>> + "versatileab",
>> + "lm3s811evb",
>> + "lm3s6965evb",
>> + "collie",
>
> [etc]
>
> I'd rather have these tests than not have them, but can't we autodetect
> the list of machines (by parsing the output of -M help, or otherwise)?
If you want to implement that, feel free to. :) We neither have working
QMP parsing nor a QMP method for obtaining machines that I'm aware of.
My opinion is that if I merge a complete but fixed list today and
afterwards someone adds a new machine and forgets to cover it with
custom or this generic qtest, then it's their fault if I unknowingly
break their machine.
Andreas
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [Qemu-devel] [PATCH for-1.6? v2 21/21] qtest: Prepare QOM machine tests
2013-08-25 17:42 ` Andreas Färber
@ 2013-08-26 13:19 ` Luiz Capitulino
0 siblings, 0 replies; 38+ messages in thread
From: Luiz Capitulino @ 2013-08-26 13:19 UTC (permalink / raw)
To: Andreas Färber; +Cc: Peter Maydell, QEMU Developers
On Sun, 25 Aug 2013 19:42:56 +0200
Andreas Färber <afaerber@suse.de> wrote:
> Am 25.08.2013 19:33, schrieb Peter Maydell:
> > On 5 August 2013 14:27, Andreas Färber <afaerber@suse.de> wrote:
> >> +static const char *arm_machines[] = {
> >> + "integratorcp",
> >> + "versatilepb",
> >> + "versatileab",
> >> + "lm3s811evb",
> >> + "lm3s6965evb",
> >> + "collie",
> >
> > [etc]
> >
> > I'd rather have these tests than not have them, but can't we autodetect
> > the list of machines (by parsing the output of -M help, or otherwise)?
>
> If you want to implement that, feel free to. :) We neither have working
> QMP parsing nor a QMP method for obtaining machines that I'm aware of.
Not sure what the context is here, but we have query-machines. It's a
bit simple though. We also have query-cpu-definitions.
^ permalink raw reply [flat|nested] 38+ messages in thread
end of thread, other threads:[~2013-08-26 13:19 UTC | newest]
Thread overview: 38+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-05 13:27 [Qemu-devel] [PATCH for-1.6? v2 00/21] qtest: Test all targets Andreas Färber
2013-08-05 13:27 ` [Qemu-devel] [PATCH for-1.6? v2 01/21] mips_mipssim: Silence BIOS loading warning for qtest Andreas Färber
2013-08-07 10:12 ` Aurelien Jarno
2013-08-05 13:27 ` [Qemu-devel] [PATCH for-1.6? v2 02/21] arm/boot: Turn arm_load_kernel() into no-op for qtest without -kernel Andreas Färber
2013-08-05 13:27 ` [Qemu-devel] [PATCH for-1.6? v2 03/21] puv3: Turn puv3_load_kernel() into a " Andreas Färber
2013-08-05 13:27 ` [Qemu-devel] [PATCH for-1.6? v2 04/21] mainstone: Don't enforce use of -pflash for qtest Andreas Färber
2013-08-05 13:27 ` [Qemu-devel] [PATCH for-1.6? v2 05/21] gumstix: " Andreas Färber
2013-08-05 13:27 ` [Qemu-devel] [PATCH for-1.6? v2 06/21] z2: " Andreas Färber
2013-08-05 13:27 ` [Qemu-devel] [PATCH for-1.6? v2 07/21] palm: Don't enforce loading ROM or kernel " Andreas Färber
2013-08-05 13:27 ` [Qemu-devel] [PATCH for-1.6? v2 08/21] omap_sx1: Don't enforce use of kernel or flash " Andreas Färber
2013-08-05 13:27 ` [Qemu-devel] [PATCH for-1.6? v2 09/21] exynos4_boards: Silence lack of -smp 2 warning " Andreas Färber
2013-08-05 13:27 ` [Qemu-devel] [PATCH for-1.6? v2 10/21] armv7m: Don't enforce use of kernel " Andreas Färber
2013-08-05 13:27 ` [Qemu-devel] [PATCH for-1.6? v2 11/21] axis_dev88: " Andreas Färber
2013-08-05 13:27 ` [Qemu-devel] [PATCH for-1.6? v2 12/21] mcf5208: " Andreas Färber
2013-08-05 13:27 ` [Qemu-devel] [PATCH for-1.6? v2 13/21] an5206: " Andreas Färber
2013-08-05 13:27 ` [Qemu-devel] [PATCH for-1.6? v2 14/21] milkymist: Suppress -kernel/-bios/-drive error " Andreas Färber
2013-08-07 5:34 ` Michael Walle
2013-08-05 13:27 ` [Qemu-devel] [PATCH for-1.6? v2 15/21] ppc405_boards: Disable debug output Andreas Färber
2013-08-14 17:54 ` Alexander Graf
2013-08-05 13:27 ` [Qemu-devel] [PATCH for-1.6? v2 16/21] ppc405_uc: " Andreas Färber
2013-08-14 17:55 ` Alexander Graf
2013-08-05 13:27 ` [Qemu-devel] [PATCH for-1.6? v2 17/21] ppc405_boards: Don't enforce presence of firmware for qtest Andreas Färber
2013-08-14 17:55 ` Alexander Graf
2013-08-05 13:27 ` [Qemu-devel] [PATCH for-1.6? v2 18/21] shix: Drop debug output Andreas Färber
2013-08-07 10:13 ` Aurelien Jarno
2013-08-05 13:27 ` [Qemu-devel] [PATCH for-1.6? v2 19/21] shix: Don't require firmware presence for qtest Andreas Färber
2013-08-06 8:05 ` Stefan Hajnoczi
2013-08-07 10:13 ` Aurelien Jarno
2013-08-05 13:27 ` [Qemu-devel] [PATCH for-1.6? v2 20/21] leon3: Don't enforce use of -bios with qtest Andreas Färber
2013-08-05 13:27 ` [Qemu-devel] [PATCH for-1.6? v2 21/21] qtest: Prepare QOM machine tests Andreas Färber
2013-08-25 17:22 ` Alexander Graf
2013-08-25 17:34 ` Andreas Färber
2013-08-25 17:33 ` Peter Maydell
2013-08-25 17:42 ` Andreas Färber
2013-08-26 13:19 ` Luiz Capitulino
2013-08-06 8:39 ` [Qemu-devel] [PATCH for-1.6? v2 00/21] qtest: Test all targets Markus Armbruster
2013-08-06 9:04 ` Andreas Färber
2013-08-06 9:45 ` Markus Armbruster
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).