[kvm-unit-tests PATCH 1/8] lib/x86: report result through serial console when no test device

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

 



From: Nadav Amit <nadav.amit@xxxxxxxxx>

If there are no test devices, we might be running on bare-metal or other
environment, in which port 0xF4, which reports the test result, is not
monitored. In such environments, print also the result of the test to
the serial console.

For realmode: just give a simple indication whether the test passed or
failed in a similar fashion.

This can allow automation tools to figure out the test is done and its
result.

Signed-off-by: Nadav Amit <nadav.amit@xxxxxxxxx>
---
 lib/x86/io.c   | 3 +++
 x86/realmode.c | 5 +++++
 2 files changed, 8 insertions(+)

diff --git a/lib/x86/io.c b/lib/x86/io.c
index f4ffb44..c21dfb8 100644
--- a/lib/x86/io.c
+++ b/lib/x86/io.c
@@ -1,5 +1,6 @@
 #include "libcflat.h"
 #include "smp.h"
+#include "fwcfg.h"
 #include "asm/io.h"
 #include "asm/page.h"
 #include "vmalloc.h"
@@ -99,6 +100,8 @@ void exit(int code)
 #else
         asm volatile("out %0, %1" : : "a"(code), "d"((short)0xf4));
 #endif
+	if (no_test_device)
+		printf("--- DONE: %d ---\n", code);
 
 	/* Fallback */
 	while (1) {
diff --git a/x86/realmode.c b/x86/realmode.c
index c8a6ae0..b4fa603 100644
--- a/x86/realmode.c
+++ b/x86/realmode.c
@@ -125,6 +125,11 @@ static void exit(int code)
 {
 	outb(code, 0xf4);
 
+	if (code == 0)
+		print_serial("--- DONE: 0 ---\n");
+	else
+		print_serial("--- DONE: 1 ---\n");
+
 	while (1) {
 		asm volatile("hlt" ::: "memory");
 	}
-- 
2.25.1




[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