version: Print build-id at bootup.
authorKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Tue, 6 Sep 2016 16:18:10 +0000 (12:18 -0400)
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Thu, 8 Sep 2016 01:10:41 +0000 (21:10 -0400)
Livepatch expected at some point to be able to print the
build-id during bootup, which it did not.  The reason is
that xen_build_init and livepatch_init are both __initcall
type routines. This meant that when livepatch_init called
xen_build_id, it would return -ENODATA as build_id_len was
not setup yet (b/c xen_build_init would be called later).

The original patch fixed this by calling xen_build_init in
livepatch_init which allows us to print the build-id of
the hypervisor.

However the x86 maintainers pointed out that build-id
is independent of Livepatch and in fact should print
regardless whether Livepatch is enabled or not.

Therefore this patch moves the logic of printing the build-id
to version.c.

Reviewed-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
xen/common/livepatch.c
xen/common/version.c

index c9dd51a6ea07cc6938c5b5f7be7f20c7960700f5..0c564c2cdb9dc8e7f757285f83b881c2d0282089 100644 (file)
@@ -1547,12 +1547,6 @@ static void livepatch_printall(unsigned char key)
 
 static int __init livepatch_init(void)
 {
-    const void *binary_id;
-    unsigned int len;
-
-    if ( !xen_build_id(&binary_id, &len) )
-        printk(XENLOG_INFO LIVEPATCH ": build-id: %*phN\n", len, binary_id);
-
     register_keyhandler('x', livepatch_printall, "print livepatch info", 1);
 
     arch_livepatch_init();
index 4375ea2bd730b8afdb66b14782e2f8ef1c409d04..0d31e38e9a52f72abfb83af53917351397c533f9 100644 (file)
@@ -186,6 +186,8 @@ static int __init xen_build_init(void)
         }
     }
 #endif
+    if ( !rc )
+        printk(XENLOG_INFO "build-id: %*phN\n", build_id_len, build_id_p);
 
     return rc;
 }