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

[PATCH v2] xen/console: print Xen version via keyhandler



From: Denis Mukhin <dmukhin@xxxxxxxx>

Add Xen version printout to 'h' keyhandler output.

That is useful for debugging systems that have been left intact for a long
time.

Signed-off-by: Denis Mukhin <dmukhin@xxxxxxxx>
---
Changes since v1:
- Moved version printout to 'h' keyhandler
- Kept the build-id reporting past Xen version printout during console
  initialization
---
 xen/common/keyhandler.c    |  5 +++++
 xen/common/version.c       | 20 ++++++++++++++++++--
 xen/drivers/char/console.c |  8 +++-----
 xen/include/xen/version.h  |  3 +++
 4 files changed, 29 insertions(+), 7 deletions(-)

diff --git a/xen/common/keyhandler.c b/xen/common/keyhandler.c
index 6ea54838d4..a82276c6dc 100644
--- a/xen/common/keyhandler.c
+++ b/xen/common/keyhandler.c
@@ -22,6 +22,7 @@
 #include <xen/mm.h>
 #include <xen/watchdog.h>
 #include <xen/init.h>
+#include <xen/version.h>
 #include <asm/div64.h>
 
 static unsigned char keypress_key;
@@ -129,6 +130,10 @@ static void cf_check show_handlers(unsigned char key)
     unsigned int i;
 
     printk("'%c' pressed -> showing installed handlers\n", key);
+
+    xen_print_version();
+    xen_print_build_id();
+
     for ( i = 0; i < ARRAY_SIZE(key_table); i++ )
         if ( key_table[i].fn )
             printk(" key '%c' (ascii '%02x') => %s\n",
diff --git a/xen/common/version.c b/xen/common/version.c
index bc3714b45f..76197a4ef7 100644
--- a/xen/common/version.c
+++ b/xen/common/version.c
@@ -210,9 +210,25 @@ void __init xen_build_init(void)
         }
     }
 #endif /* CONFIG_X86 */
-    if ( !rc )
-        printk(XENLOG_INFO "build-id: %*phN\n", build_id_len, build_id_p);
 }
+
+void xen_print_version(void)
+{
+    printk("Xen version %d.%d%s (%s@%s) (%s) %s %s\n",
+           xen_major_version(), xen_minor_version(), xen_extra_version(),
+           xen_compile_by(), xen_compile_domain(), xen_compiler(),
+           xen_build_info(), xen_compile_date());
+
+    printk("Latest ChangeSet: %s\n", xen_changeset());
+}
+
+void xen_print_build_id(void)
+{
+    BUG_ON(!build_id_p);
+    BUG_ON(!build_id_len);
+    printk(XENLOG_INFO "build-id: %*phN\n", build_id_len, build_id_p);
+}
+
 #endif /* BUILD_ID */
 /*
  * Local variables:
diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
index 73d24a7821..2c0b474d53 100644
--- a/xen/drivers/char/console.c
+++ b/xen/drivers/char/console.c
@@ -1024,14 +1024,12 @@ void __init console_init_preirq(void)
     nrspin_lock(&console_lock);
     __putstr(xen_banner());
     nrspin_unlock(&console_lock);
-    printk("Xen version %d.%d%s (%s@%s) (%s) %s %s\n",
-           xen_major_version(), xen_minor_version(), xen_extra_version(),
-           xen_compile_by(), xen_compile_domain(), xen_compiler(),
-           xen_build_info(), xen_compile_date());
-    printk("Latest ChangeSet: %s\n", xen_changeset());
+
+    xen_print_version();
 
     /* Locate and print the buildid, if applicable. */
     xen_build_init();
+    xen_print_build_id();
 
     if ( opt_sync_console )
     {
diff --git a/xen/include/xen/version.h b/xen/include/xen/version.h
index 4856ad1b44..4b96c6cc5c 100644
--- a/xen/include/xen/version.h
+++ b/xen/include/xen/version.h
@@ -29,4 +29,7 @@ int xen_build_id_check(const Elf_Note *n, unsigned int n_sz,
 static inline void xen_build_init(void) {};
 #endif
 
+void xen_print_version(void);
+void xen_print_build_id(void);
+
 #endif /* __XEN_VERSION_H__ */
-- 
2.34.1





 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.