Re: [PATCH] x86: realmode: report failures

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Nadav Amit <namit@xxxxxxxxxxxxxxxxx> writes:

> The current realmode tests always report success when done, regardless to
> whether any of the tests failed.  Although the log includes the individual test
> results, this behavior complicates the life of the tester.

Please include kvm-unit-tests in the subject line for easier identifiability
where the patch belongs.

> Signed-off-by: Nadav Amit <namit@xxxxxxxxxxxxxxxxx>
> ---
>  x86/realmode.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/x86/realmode.c b/x86/realmode.c
> index 6e74883..dc4a1d3 100644
> --- a/x86/realmode.c
> +++ b/x86/realmode.c
> @@ -103,6 +103,8 @@ static void print_serial_u32(u32 value)
>  	print_serial(p);
>  }
>  
> +static int failed;
> +
>  static void exit(int code)
>  {
>  	outb(code, 0xf4);
> @@ -222,6 +224,8 @@ static void report(const char *name, u16 regs_ignore, _Bool ok)
>      print_serial(ok ? "PASS: " : "FAIL: ");
>      print_serial(name);
>      print_serial("\n");
> +    if (!ok)
> +	failed = 1;
>  }

I was confused at first since there is also a common "report" function
in lib/report.c We should probably rename this function to something else,
eg- realmode_report() if the common function can't be reused here.
  
>  #define MK_INSN(name, str)				\
> @@ -1715,7 +1719,7 @@ void realmode_start(void)
>  	test_perf_memory_store();
>  	test_perf_memory_rmw();
>  
> -	exit(0);
> +	exit(failed);
>  }
>  
>  unsigned long long r_gdt[] = { 0, 0x9b000000ffff, 0x93000000ffff };
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux