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

[PATCH v2 2/2] xen/common: add keyhandler to show Xen command line


  • To: xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: dmukhin@xxxxxxxx
  • Date: Mon, 3 Aug 2026 00:00:47 -0700
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 148.163.138.245) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=ford.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=ford.com; dkim=pass (signature was verified) header.d=saarlouis.ford.com; dkim=pass (signature was verified) header.d=ford.com; arc=none (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=vzjSlYxWBpGdDqVv+pIg3kuEssbNQ05qwEZxS4CT5kE=; b=hfXziwWO6rJx8Vnujfghd8Fqqr3+XnPN2jd3F7RVlB0tQ1CkdeZYSe4ZMruHbCho3U5MDRxQWnSPzAu6hzdpXm5xTe8lJzljD0uctuG2xDLFLIyopXPGVDh+jNlGVjdWOOryYV1kDfMNTYRjwy2t/Yfi6F8+dEX3KzuTPgBVX+FxRccU/on4pG4HSwyg/sKkKZb4Y++GWjWE1arviU1UGgchnRPEn3seqdZyfDWrdbT8fQlBvapbG/fZI3lFckx3/Y3JPTicMw+uxIthcta7YB0tfzdPiCY65SAAYT4rKDhy9audRN5EJFNA6x9k/Ogi1Hqqrk7E/M7ca0ESNlrd6g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=GUIo7bdY1qQ6YbZCsZDxT97QMhOqYo1bj9krhD9KGh0I2AZ1F1PTqSAQwpAOQ/9F5lJTP1cDTQOhCdb2fA4xlnxdQLRSXhcfn3OJ0d4BIJkNvAXXAQ1CX/oO6awOL5nFMOB0X9UhxNAOpNCuTcO5SR5wFrsrSPxKevmdXfKpGavH71RilHBzCkVdwCuAREINfaJslyFGUaRic9xnsfqjqo5eMCHrcT8/DbjEL1Z8VfwbYi3vK+4kE+UA7xAKK0h60JWrlbJ0YZlG16s5JOTiZr/f0j+5WITiAd2khiItL7zuQQAqpBpfNDmXVYkFLS8aUs4Q2DK4BBQDO4vdTfuSFw==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=ppford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=selector2-azureford-onmicrosoft-com header.d=azureford.onmicrosoft.com header.i="@azureford.onmicrosoft.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"; dkim=pass header.s=ppserprodsaar header.d=saarlouis.ford.com header.i="@saarlouis.ford.com" header.h="Cc:Content-Transfer-Encoding:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=ppfserpocford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Transfer-Encoding:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"
  • Cc: andrew.cooper3@xxxxxxxxxx, anthony.perard@xxxxxxxxxx, jbeulich@xxxxxxxx, julien@xxxxxxx, michal.orzel@xxxxxxx, roger@xxxxxxxxxxxxxx, sstabellini@xxxxxxxxxx, dmukhin@xxxxxxxx
  • Delivery-date: Mon, 03 Aug 2026 07:01:15 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Pser-m365-app: SER-APP

From: Denis Mukhin <dmukhin@xxxxxxxx> 

Currently there's no way to print Xen command line on the emergency
console for debugging purposes (e.g. 'xl' is not available in dom0).

Add new keyhander 'X' to do command line printout.

Signed-off-by: Denis Mukhin <dmukhin@xxxxxxxx>
---
v1: https://lore.kernel.org/xen-devel/20260730061459.2702672-2-dmukhin@xxxxxxxx/

Changes since v1:
- moved implementation into kernel.c
---
 xen/common/kernel.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/xen/common/kernel.c b/xen/common/kernel.c
index d1bef9ac2b2b..9f334c92e3ab 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,21 @@ 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);
+    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




 


Rackspace

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