qtest: Test all targets
cover qtest: Test all targets
Hello Anthony,
Based on my qtest output cleanups but not dependent thereon, this series extends trivial test coverage to all 16 targets. Please consider applying these two before my upcoming pull for your testing convenience. :)
I am fully aware that the test code itself could use some love for extensibility, but I believe we can clean it up after 1.6 (or during the Hard Freeze if you want to add more machines sooner rather than later).
For now it tests that QOM type changes do not lead to QOM cast assertions.
For the future I would envision it to do some QMP qom-set, e.g., for realized=false and realized=true or the like. Depending on our plans, once machines grow test cases of their own for their chipsets, they can be taken out of this generic test, e.g., n800 is tested via tmp105-test already.
Regards,
Andreas
Andreas Färber (14):
mips_mipssim: Silence BIOS loading warning for qtest arm/boot: Turn arm_load_kernel() into 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
puv3: Don't assert kernel filename for qtest
mcf5208: Don't enforce use of kernel for qtest
an5206: Don't enforce use of kernel for qtest
qtest: Add dummy machine tests
hw/arm/armv7m.c | 25 ++++++------ hw/arm/boot.c | 4 ++ hw/arm/exynos4_boards.c | 3 +- hw/arm/gumstix.c | 31 +++++++++------ hw/arm/mainstone.c | 5 ++- hw/arm/omap_sx1.c | 3 +- hw/arm/palm.c | 3 +- hw/arm/z2.c | 19 +++++---- hw/cris/axis_dev88.c | 11 +++--- hw/m68k/an5206.c | 4 ++ hw/m68k/mcf5208.c | 4 ++ hw/mips/mips_mipssim.c | 4 +- hw/unicore32/puv3.c | 4 ++ tests/Makefile | 25 ++++++++++++ tests/qom-test.c | 101 ++++++++++++++++++++++++++++++++++++++++++++++++ 15 files changed, 205 insertions(+), 41 deletions(-) create mode 100644 tests/qom-test.c
Signature · 1 line
1.8.1.4
PATCH 1/14 mips_mipssim: Silence BIOS loading warning for qtest
--- hw/mips/mips_mipssim.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
hw/mips/mips_mipssim.c +3 -1
@@ -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",
Signature · 1 line
1.8.1.4
PATCH 2/14 arm/boot: Turn arm_load_kernel() into no-op for qtest without -kernel
In reply to Andreas Färber--- hw/arm/boot.c | 4 ++++ 1 file changed, 4 insertions(+)
hw/arm/boot.c +4 -0
@@ -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 ); }
Signature · 1 line
1.8.1.4
PATCH 3/14 mainstone: Don't enforce use of -pflash for qtest
In reply to Andreas FärberSimply skip flash setup for now.
Also drop useless debug output.
--- hw/arm/mainstone.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
hw/arm/mainstone.c +4 -1
@@ -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 */
Signature · 1 line
1.8.1.4
PATCH 4/14 gumstix: Don't enforce use of -pflash for qtest
In reply to Andreas Färber--- hw/arm/gumstix.c | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-)
hw/arm/gumstix.c +19 -12
@@ -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 );
@@ -69,11 +70,14 @@ static void connex_init(QEMUMachineInitArgs *args)#else be =0 ;#endif -if (!pflash_cfi01_register (0x00000000 ,NULL ,"connext.rom" , connex_rom, - dinfo->bdrv, sector_len, connex_rom / sector_len, -2 ,0 ,0 ,0 ,0 , be)) { -fprintf (stderr,"qemu: Error registering flash memory.\n" ); -exit (1 ); +if (dinfo) { +if (!pflash_cfi01_register (0x00000000 ,NULL ,"connext.rom" , connex_rom, + dinfo->bdrv, sector_len, + connex_rom / sector_len, +2 ,0 ,0 ,0 ,0 , be)) { +fprintf (stderr,"qemu: Error registering flash memory.\n" ); +exit (1 ); + } }/* Interrupt line of NIC is connected to GPIO line 36 */
@@ -95,7 +99,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 );
@@ -106,11 +110,14 @@ static void verdex_init(QEMUMachineInitArgs *args)#else be =0 ;#endif -if (!pflash_cfi01_register (0x00000000 ,NULL ,"verdex.rom" , verdex_rom, - dinfo->bdrv, sector_len, verdex_rom / sector_len, -2 ,0 ,0 ,0 ,0 , be)) { -fprintf (stderr,"qemu: Error registering flash memory.\n" ); -exit (1 ); +if (dinfo) { +if (!pflash_cfi01_register (0x00000000 ,NULL ,"verdex.rom" , verdex_rom, + dinfo->bdrv, sector_len, + verdex_rom / sector_len, +2 ,0 ,0 ,0 ,0 , be)) { +fprintf (stderr,"qemu: Error registering flash memory.\n" ); +exit (1 ); + } }/* Interrupt line of NIC is connected to GPIO line 99 */
Signature · 1 line
1.8.1.4
Re: [Qemu-devel] [PATCH for-1.6? 04/14] gumstix: Don't enforce use of -pflash for qtest
Quoted 1 line · Andreas Färber
Signed-off-by Andreas Färber <[email protected]>
I'm not sure this is heading in the right direction.
What's the bigger picture here? Are we saying that all machines must be launchable without any special parameters? If so, can we document that somewhere?
Is that reasonable in practice or are there cases where we must specify parameters for a machine?
If the above is true, then I don't think there should be if (qtest_enabled())s guarding this stuff.
Regards,
Anthony Liguori
Quoted 76 lines
--- hw/arm/gumstix.c | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-)hw/arm/gumstix.c +19
-12@@ -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 );@@ -69,11 +70,14 @@ static void connex_init(QEMUMachineInitArgs *args)#else be =0 ;#endif -if (!pflash_cfi01_register (0x00000000 ,NULL ,"connext.rom" , connex_rom, - dinfo->bdrv, sector_len, connex_rom / sector_len, -2 ,0 ,0 ,0 ,0 , be)) { -fprintf (stderr,"qemu: Error registering flash memory.\n" ); -exit (1 ); +if (dinfo) { +if (!pflash_cfi01_register (0x00000000 ,NULL ,"connext.rom" , connex_rom, + dinfo->bdrv, sector_len, + connex_rom / sector_len, +2 ,0 ,0 ,0 ,0 , be)) { +fprintf (stderr,"qemu: Error registering flash memory.\n" ); +exit (1 ); + } }/* Interrupt line of NIC is connected to GPIO line 36 */ @@ -95,7 +99,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 );@@ -106,11 +110,14 @@ static void verdex_init(QEMUMachineInitArgs *args)#else be =0 ;#endif -if (!pflash_cfi01_register (0x00000000 ,NULL ,"verdex.rom" , verdex_rom, - dinfo->bdrv, sector_len, verdex_rom / sector_len, -2 ,0 ,0 ,0 ,0 , be)) { -fprintf (stderr,"qemu: Error registering flash memory.\n" ); -exit (1 ); +if (dinfo) { +if (!pflash_cfi01_register (0x00000000 ,NULL ,"verdex.rom" , verdex_rom, + dinfo->bdrv, sector_len, + verdex_rom / sector_len, +2 ,0 ,0 ,0 ,0 , be)) { +fprintf (stderr,"qemu: Error registering flash memory.\n" ); +exit (1 ); + } }/* Interrupt line of NIC is connected to GPIO line 99 */ Signature · 1 line
1.8.1.4
Re: [Qemu-devel] [PATCH for-1.6? 04/14] gumstix: Don't enforce use of -pflash for qtest
Quoted 6 lines · Anthony Liguori
What's the bigger picture here? Are we saying that all machines must be launchable without any special parameters? If so, can we document that somewhere?
Is that reasonable in practice or are there cases where we must specify parameters for a machine?
Well, it depends how friendly you're feeling. Typically if the user has specified neither a -kernel nor some kind of flash image or BIOS, then we could just choose to start executing at address zero. This will probably either tear through a bunch of random garbage or end up looping endlessly through an exception vector. That's exactly what the hardware would do in that case, but the usual user response is to accuse QEMU of "hanging".
-- PMM
Re: [Qemu-devel] [PATCH for-1.6? 04/14] gumstix: Don't enforce use of -pflash for qtest
In reply to Anthony LiguoriAm 30.07.2013 15:20, schrieb Anthony Liguori:
Quoted 9 lines
Quoted 1 line · Andreas Färber
Signed-off-by Andreas Färber <[email protected]>I'm not sure this is heading in the right direction.
What's the bigger picture here? Are we saying that all machines must be launchable without any special parameters? If so, can we document that somewhere?
Well, the picture I see is that many of these machines were contributed ages ago and the contributors are no longer actively maintaining them. But the machines don't seem fundamentally broken, at least not as far as QEMU modeling/API is concerned, so I see no need to rip them out.
These patches were tailored for 1.6, so tried to avoid invasive changes (originally I had even avoided the reindent but did it since checkpatch.pl complained about suspect indent).
The picture for qtest is that a machine doing random exit()s is untestable. But there is no need to actually specify -kernel for any machine with accel=qtest, since the loaded code will not get executed.
For -pflash it's slightly different (an additional device that is not tested if omitted) but it did not work with -pflash /dev/null or -pflash /dev/zero (I originally used -kernel /dev/null and cleaned this up with these patches).
When executing a machine without loaded image, the memory is hopefully zero-initialized, which may or may not correspond to a nop instruction; in that case TCG would sequentially execute, well, nothing until it hits memory beyond RAM MemoryRegions, resulting in execution outside of RAM or ROM error.
Another aspect is that all fprintf()s are being replaced with error_report() for consistency.
Also I noticed that if one uses qtest with a non-existing -machine, it will display the list of available machines and hang (Ctrl-C helps).
Replacing errors with warnings might work, but then we'd still want to suppress them from the qtest output.
Regards,
Andreas
Quoted 86 lines
Is that reasonable in practice or are there cases where we must specify parameters for a machine?
If the above is true, then I don't think there should be if (qtest_enabled())s guarding this stuff.
Regards,
Anthony Liguori
Quoted 76 lines
--- hw/arm/gumstix.c | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-)hw/arm/gumstix.c +19
-12@@ -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 );@@ -69,11 +70,14 @@ static void connex_init(QEMUMachineInitArgs *args)#else be =0 ;#endif -if (!pflash_cfi01_register (0x00000000 ,NULL ,"connext.rom" , connex_rom, - dinfo->bdrv, sector_len, connex_rom / sector_len, -2 ,0 ,0 ,0 ,0 , be)) { -fprintf (stderr,"qemu: Error registering flash memory.\n" ); -exit (1 ); +if (dinfo) { +if (!pflash_cfi01_register (0x00000000 ,NULL ,"connext.rom" , connex_rom, + dinfo->bdrv, sector_len, + connex_rom / sector_len, +2 ,0 ,0 ,0 ,0 , be)) { +fprintf (stderr,"qemu: Error registering flash memory.\n" ); +exit (1 ); + } }/* Interrupt line of NIC is connected to GPIO line 36 */ @@ -95,7 +99,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 );@@ -106,11 +110,14 @@ static void verdex_init(QEMUMachineInitArgs *args)#else be =0 ;#endif -if (!pflash_cfi01_register (0x00000000 ,NULL ,"verdex.rom" , verdex_rom, - dinfo->bdrv, sector_len, verdex_rom / sector_len, -2 ,0 ,0 ,0 ,0 , be)) { -fprintf (stderr,"qemu: Error registering flash memory.\n" ); -exit (1 ); +if (dinfo) { +if (!pflash_cfi01_register (0x00000000 ,NULL ,"verdex.rom" , verdex_rom, + dinfo->bdrv, sector_len, + verdex_rom / sector_len, +2 ,0 ,0 ,0 ,0 , be)) { +fprintf (stderr,"qemu: Error registering flash memory.\n" ); +exit (1 ); + } }/* Interrupt line of NIC is connected to GPIO line 99 */ Signature · 1 line
1.8.1.4
Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
PATCH 5/14 z2: Don't enforce use of -pflash for qtest
In reply to Andreas Färber--- hw/arm/z2.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-)
hw/arm/z2.c +11 -8
@@ -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,19 +324,21 @@ 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 ); } -if (!pflash_cfi01_register (Z2_FLASH_BASE , -NULL ,"z2.flash0" ,Z2_FLASH_SIZE , - dinfo->bdrv, sector_len, -Z2_FLASH_SIZE / sector_len,4 ,0 ,0 ,0 ,0 , - be)) { -fprintf (stderr,"qemu: Error registering flash memory.\n" ); -exit (1 ); +if (dinfo) { +if (!pflash_cfi01_register (Z2_FLASH_BASE , +NULL ,"z2.flash0" ,Z2_FLASH_SIZE , + dinfo->bdrv, sector_len, +Z2_FLASH_SIZE / sector_len,4 ,0 ,0 ,0 ,0 , + be)) { +fprintf (stderr,"qemu: Error registering flash memory.\n" ); +exit (1 ); + } }/* setup keypad */
Signature · 1 line
1.8.1.4
PATCH 6/14 palm: Don't enforce loading ROM or kernel for qtest
In reply to Andreas Färber--- hw/arm/palm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
hw/arm/palm.c +2 -1
@@ -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 ); }
Signature · 1 line
1.8.1.4
PATCH 7/14 omap_sx1: Don't enforce use of kernel or flash for qtest
In reply to Andreas Färber--- hw/arm/omap_sx1.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
hw/arm/omap_sx1.c +2 -1
@@ -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 ); }
Signature · 1 line
1.8.1.4
PATCH 8/14 exynos4_boards: Silence lack of -smp 2 warning for qtest
In reply to Andreas Färber--- hw/arm/exynos4_boards.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
hw/arm/exynos4_boards.c +2 -1
@@ -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,
Signature · 1 line
1.8.1.4
PATCH 9/14 armv7m: Don't enforce use of kernel for qtest
In reply to Andreas Färber--- hw/arm/armv7m.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-)
hw/arm/armv7m.c +14 -11
@@ -11,6 +11,7 @@#include "hw/arm/arm.h" #include "hw/loader.h" #include "elf.h" +#include "sysemu/qtest.h" /* Bitbanded IO. Each word corresponds to a single bit. */
@@ -227,21 +228,23 @@ 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 ) { +fprintf (stderr,"qemu: could not load kernel '%s'\n" , + kernel_filename); +exit (1 ); + } }/* Hack to map an additional page of ram at the top of the address
Signature · 1 line
1.8.1.4
PATCH 10/14 axis_dev88: Don't enforce use of kernel for qtest
In reply to Andreas Färber--- hw/cris/axis_dev88.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
hw/cris/axis_dev88.c +6 -5
@@ -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 = {
Signature · 1 line
1.8.1.4
PATCH 11/14 puv3: Don't assert kernel filename for qtest
In reply to Andreas FärberReplacing the assert() with more user-friendly error handling is left for another time.
--- hw/unicore32/puv3.c | 4 ++++ 1 file changed, 4 insertions(+)
hw/unicore32/puv3.c +4 -0
@@ -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 (qtest_enabled ()) { +return ; + }assert (kernel_filename !=NULL );/* only zImage format supported */
Signature · 1 line
1.8.1.4
PATCH 12/14 mcf5208: Don't enforce use of kernel for qtest
In reply to Andreas Färber--- hw/m68k/mcf5208.c | 4 ++++ 1 file changed, 4 insertions(+)
hw/m68k/mcf5208.c +4 -0
@@ -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 ); }
Signature · 1 line
1.8.1.4
PATCH 13/14 an5206: Don't enforce use of kernel for qtest
In reply to Andreas Färber--- hw/m68k/an5206.c | 4 ++++ 1 file changed, 4 insertions(+)
hw/m68k/an5206.c +4 -0
@@ -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 ); }
Signature · 1 line
1.8.1.4
PATCH 14/14 qtest: Add dummy machine tests
In reply to Andreas FärberInstantiate at least one machine per target so that they get a bit of test coverage at all. This has proven helpful during QOM refactorings.
--- tests/Makefile | 25 ++++++++++++++ tests/qom-test.c | 101 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 126 insertions(+) create mode 100644 tests/qom-test.c
tests/Makefile +25 -0
@@ -63,25 +63,49 @@ 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-unicore32-y += tests/qom-test$(EXESUF) +check-qtest-xtensa-y += tests/qom-test$(EXESUF) +check-qtest-xtensaeb-y = $(check-qtest-xtensa-y) GENERATED_HEADERS += tests/test-qapi-types.h tests/test-qapi-visit.h tests/test-qmp-commands.h
@@ -153,6 +177,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
tests/qom-test.c new file +101 -0
101 lines not on this page · raw message
Signature · 1 line
1.8.1.4