From: dmukhin@ford.com
To: xen-devel@lists.xenproject.org
Cc: andrew.cooper3@citrix.com, anthony.perard@vates.tech,
jbeulich@suse.com, julien@xen.org, michal.orzel@amd.com,
roger@xenproject.org, sstabellini@kernel.org, dmukhin@ford.com
Subject: [PATCH v3] xen/common: add keyhandler to show Xen command line
Date: Mon, 10 Aug 2026 16:04:01 -0700 [thread overview]
Message-ID: <20260810230359.671587-3-dmukhin@ford.com> (raw)
From: Denis Mukhin <dmukhin@ford.com>
Currently there's no way to print Xen command line on the emergency
console for debugging purposes when 'xl' is not unavailable.
Add new keyhander 'X' to do command line printout.
Signed-off-by: Denis Mukhin <dmukhin@ford.com>
---
Changes since v2:
- account for CONFIG_CMDLINE_OVERRIDE case
- use IS_ENABLED()
v2: https://lore.kernel.org/xen-devel/20260803070047.3097846-3-dmukhin@ford.com/
CI: https://gitlab.com/xen-project/people/dmukhin/xen/-/pipelines/2748655201
---
xen/common/kernel.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/xen/common/kernel.c b/xen/common/kernel.c
index d1bef9ac2b2b..54a7ee6f68e5 100644
--- a/xen/common/kernel.c
+++ b/xen/common/kernel.c
@@ -5,6 +5,7 @@
*/
#include <xen/init.h>
+#include <xen/keyhandler.h>
#include <xen/lib.h>
#include <xen/errno.h>
#include <xen/param.h>
@@ -505,6 +506,25 @@ static int __init cf_check param_init(void)
__initcall(param_init);
#endif
+static void cf_check show_hypervisor_info(unsigned char key)
+{
+ printk("'%c' pressed -> showing hypervisor information\n", key);
+
+ if ( IS_ENABLED(CONFIG_CMDLINE_OVERRIDE) )
+ printk("Bootloader command line ignored (CONFIG_CMDLINE_OVERRIDE=y)\n");
+ else
+ printk("Command line: %s\n", saved_cmdline);
+}
+
+static int __init cf_check misc_init(void)
+{
+ register_keyhandler('X', show_hypervisor_info,
+ "show hypervisor information", 0);
+
+ return 0;
+}
+__initcall(misc_init);
+
static long xenver_varbuf_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
{
struct xen_varbuf user_str;
--
2.54.0
next reply other threads:[~2026-08-10 23:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-10 23:04 dmukhin [this message]
2026-08-11 8:05 ` [PATCH v3] xen/common: add keyhandler to show Xen command line Roger Pau Monné
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=20260810230359.671587-3-dmukhin@ford.com \
--to=dmukhin@ford.com \
--cc=andrew.cooper3@citrix.com \
--cc=anthony.perard@vates.tech \
--cc=jbeulich@suse.com \
--cc=julien@xen.org \
--cc=michal.orzel@amd.com \
--cc=roger@xenproject.org \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xenproject.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.