xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pvgrub: use printk() instead of grub_printf()
@ 2016-09-28  8:31 Juergen Gross
  2016-09-28 10:50 ` Wei Liu
  2016-09-28 10:59 ` Samuel Thibault
  0 siblings, 2 replies; 3+ messages in thread
From: Juergen Gross @ 2016-09-28  8:31 UTC (permalink / raw)
  To: xen-devel; +Cc: Juergen Gross, samuel.thibault, wei.liu2

grub_printf() is supporting only a very limited number of formats.
Especially some error messages suffer from that, e.g. %lx won't work.
Switch to use printk() for error messages instead.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
 stubdom/grub/kexec.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/stubdom/grub/kexec.c b/stubdom/grub/kexec.c
index 8fd9ff9..2ed4f6c 100644
--- a/stubdom/grub/kexec.c
+++ b/stubdom/grub/kexec.c
@@ -246,26 +246,26 @@ void kexec(void *kernel, long kernel_size, void *module, long module_size, char
     tpm_hash2pcr(dom, cmdline);
 
     if ( (rc = xc_dom_boot_xen_init(dom, xc_handle, domid)) != 0 ) {
-        grub_printf("xc_dom_boot_xen_init returned %d\n", rc);
+        printk("xc_dom_boot_xen_init returned %d\n", rc);
         errnum = ERR_BOOT_FAILURE;
         goto out;
     }
     if ( (rc = xc_dom_parse_image(dom)) != 0 ) {
-        grub_printf("xc_dom_parse_image returned %d\n", rc);
+        printk("xc_dom_parse_image returned %d\n", rc);
         errnum = ERR_BOOT_FAILURE;
         goto out;
     }
 
 #ifdef __i386__
     if (strcmp(dom->guest_type, "xen-3.0-x86_32p")) {
-        grub_printf("can only boot x86 32 PAE kernels, not %s\n", dom->guest_type);
+        printk("can only boot x86 32 PAE kernels, not %s\n", dom->guest_type);
         errnum = ERR_EXEC_FORMAT;
         goto out;
     }
 #endif
 #ifdef __x86_64__
     if (strcmp(dom->guest_type, "xen-3.0-x86_64")) {
-        grub_printf("can only boot x86 64 kernels, not %s\n", dom->guest_type);
+        printk("can only boot x86 64 kernels, not %s\n", dom->guest_type);
         errnum = ERR_EXEC_FORMAT;
         goto out;
     }
@@ -273,7 +273,7 @@ void kexec(void *kernel, long kernel_size, void *module, long module_size, char
 
     /* equivalent of xc_dom_mem_init */
     if (xc_dom_set_arch_hooks(dom)) {
-        grub_printf("xc_dom_set_arch_hooks failed\n");
+        printk("xc_dom_set_arch_hooks failed\n");
         errnum = ERR_EXEC_FORMAT;
         goto out;
     }
@@ -290,7 +290,7 @@ void kexec(void *kernel, long kernel_size, void *module, long module_size, char
         dom->p2m_host[i] = pfn_to_mfn(i);
 
     if ( (rc = xc_dom_build_image(dom)) != 0 ) {
-        grub_printf("xc_dom_build_image returned %d\n", rc);
+        printk("xc_dom_build_image returned %d\n", rc);
         errnum = ERR_BOOT_FAILURE;
         goto out;
     }
@@ -306,7 +306,7 @@ void kexec(void *kernel, long kernel_size, void *module, long module_size, char
     dom->shared_info_mfn = PHYS_PFN(start_info.shared_info);
 
     if (!xc_dom_compat_check(dom)) {
-        grub_printf("xc_dom_compat_check failed\n");
+        printk("xc_dom_compat_check failed\n");
         errnum = ERR_EXEC_FORMAT;
         goto out;
     }
@@ -324,14 +324,14 @@ void kexec(void *kernel, long kernel_size, void *module, long module_size, char
     /* Make sure the bootstrap page table does not RW-map any of our current
      * page table frames */
     if ( (rc = xc_dom_update_guest_p2m(dom))) {
-        grub_printf("xc_dom_update_guest_p2m returned %d\n", rc);
+        printk("xc_dom_update_guest_p2m returned %d\n", rc);
         errnum = ERR_BOOT_FAILURE;
         goto out;
     }
 
     if ( dom->arch_hooks->setup_pgtables )
         if ( (rc = dom->arch_hooks->setup_pgtables(dom))) {
-            grub_printf("setup_pgtables returned %d\n", rc);
+            printk("setup_pgtables returned %d\n", rc);
             errnum = ERR_BOOT_FAILURE;
             goto out;
         }
@@ -362,8 +362,8 @@ void kexec(void *kernel, long kernel_size, void *module, long module_size, char
 #endif
                 xc_dom_p2m(dom, dom->pgtables_seg.pfn),
                 dom->guest_domid)) != 0 ) {
-        grub_printf("pin_table(%lx) returned %d\n", xc_dom_p2m(dom,
-                    dom->pgtables_seg.pfn), rc);
+        printk("pin_table(%lx) returned %d\n", xc_dom_p2m(dom,
+               dom->pgtables_seg.pfn), rc);
         errnum = ERR_BOOT_FAILURE;
         goto out_remap;
     }
-- 
2.6.6


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-09-28 10:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-28  8:31 [PATCH] pvgrub: use printk() instead of grub_printf() Juergen Gross
2016-09-28 10:50 ` Wei Liu
2016-09-28 10:59 ` Samuel Thibault

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).