@@ -250,8 +250,10 @@ static void xen_console_write(const char *buf, size_t len)
hypercall_console_write(buf, len);
}
-void arch_setup(void)
+void arch_setup(int *version)
{
+ int xen_version;
+
if ( IS_DEFINED(CONFIG_HVM) && !pvh_start_info )
{
register_console_callback(qemu_console_write);
@@ -272,6 +274,10 @@ void arch_setup(void)
init_hypercalls();
+ xen_version = hypercall_xen_version(XENVER_version, NULL);
+ if ( version )
+ *version = xen_version;
+
if ( !is_initdomain() )
{
setup_pv_console();
@@ -19,9 +19,13 @@
*/
void __noreturn xtf_main(void)
{
- arch_setup();
+ int xen_version;
+
+ arch_setup(&xen_version);
printk("--- Xen Test Framework ---\n");
+ printk("Found Xen: %d.%d\n", XEN_MAJOR(xen_version),
+ XEN_MINOR(xen_version));
printk("Environment: %s\n", environment_description);
printk("%s\n", test_title);
@@ -2,7 +2,7 @@
#define XTF_FRAMEWORK_H
/* To be implemented by each arch */
-void arch_setup(void);
+void arch_setup(int *);
void test_setup(void);
/* Single line summary of execution environment. */
In arch_setup() detect Xen version by issuing xen_version hypercall and optionally pass the version to main_xtf(). Signed-off-by: Pawel Wieczorkiewicz <wipawel@amazon.de> --- Changed since v1: * Do not limit setup_pv_console() to HVM only. It does not crash. It merely panics because the callbacks array wasn't increased. arch/x86/setup.c | 8 +++++++- common/setup.c | 6 +++++- include/xtf/framework.h | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-)