From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xen.org
Cc: Juergen Gross <jgross@suse.com>,
samuel.thibault@ens-lyon.org, wei.liu2@citrix.com
Subject: [PATCH] pvgrub: use printk() instead of grub_printf()
Date: Wed, 28 Sep 2016 10:31:58 +0200 [thread overview]
Message-ID: <1475051518-3452-1-git-send-email-jgross@suse.com> (raw)
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
next reply other threads:[~2016-09-28 8:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-28 8:31 Juergen Gross [this message]
2016-09-28 10:50 ` [PATCH] pvgrub: use printk() instead of grub_printf() Wei Liu
2016-09-28 10:59 ` Samuel Thibault
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1475051518-3452-1-git-send-email-jgross@suse.com \
--to=jgross@suse.com \
--cc=samuel.thibault@ens-lyon.org \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).