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

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


  • To: Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • From: dmukhin@xxxxxxxx
  • Date: Fri, 7 Aug 2026 19:38:28 -0700
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 205.220.161.53) 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=VVocyPjs5xADxPDxMphRRc5RXD7ku5EpzkZWOv5SIjQ=; b=jDrGTTkI/hEvCffUQ0Oi+g8KQSi31J9erkQ3ZFD/AEGeNsGW5tySuDThWpZdpbBkiUtUXmYSy8grFnk1H7b3GlwTbwLlWQkqjsMfj4vkEDmznoFgev0qd0gbdo9lCs9ShWG/QQCYLG2+QCh1u8hglf9WsInQK2ebDkQ2uF63gPOFF0mXqf/wiSDYzni+iPEBPIekqrQUwLvFgis4/HnYfVeGTfrOp2E7UxNcFNKojIQAhPuymcOILkfpiZntQ1/OYu3gmxjxtysxdcxQNlnEG8elK+oD1Xfm0YNBg61q6z7ZCxL4vyA3BHtDyfjdbPCFW0nQJ5qxegDls0a2+CsU9g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=o2hZhpHS6/VsLyAbbbfh1MyiVI90ia7LsJEwmFJ4hnacOaliaf1rT1uOKcHhxTfaSJXK19uV2adC0oyv34P4FN7U2rxGOY6ZWnyKNN/ninrBSWjySoVpv/csoeINC87mG0g86V4DJF+OdLBajtH/RBXIZGrEn6qPNeBeK+UimFx9H5zZlNf4F6NiTcH3Ii9Mu/11IUadXj8SLK+q3udWyV6t8npLqvEPraqbo1boilOjnUesMbdKyxhRy1byb93G6LbdXUoin9+qvSLpPCW0yeM1z2b/STKyEQ989+0rY3ZAWLw9P7CZOH0+DShrzp+7fYUxUBU8Ie0I5R+c0rnIPQ==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=ppford header.d=ford.com header.i="@ford.com" header.h="Cc: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-Type: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-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"
  • Cc: dmukhin@xxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx, andrew.cooper3@xxxxxxxxxx, anthony.perard@xxxxxxxxxx, jbeulich@xxxxxxxx, julien@xxxxxxx, michal.orzel@xxxxxxx, roger@xxxxxxxxxxxxxx
  • Delivery-date: Sat, 08 Aug 2026 02:38:59 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Pser-m365-app: SER-APP

On Fri, Aug 07, 2026 at 05:44:41PM -0700, Stefano Stabellini wrote:
> On Mon, 3 Aug 2026, dmukhin@xxxxxxxx wrote:
> > 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);
> 
> if CONFIG_CMDLINE_OVERRIDE is defined, saved_cmdline is empty. We could
> at least do this:
> 
> #ifdef CONFIG_CMDLINE_OVERRIDE
>     printk("Bootloader command line ignored (CONFIG_CMDLINE_OVERRIDE=y)\n");
> #else
>     printk("Command line: %s\n", saved_cmdline);
> #endif

Actually, CONFIG_CMDLINE can set the built-in command line which can be
non-empty.

Perhaps, something like this:

    printk("Command line (built-in): %s\n", opt_builtin_cmdline);
#ifndef CONFIG_CMDLINE_OVERRIDE
    printk("Command line: %s\n", saved_cmdline);
#endif

What do you think?

> 
> Other than that it is fine for me
> 
> 
> 
> > +}
> > +
> > +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®.