From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 70F92C83F17 for ; Thu, 31 Jul 2025 09:45:54 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.1065301.1430741 (Exim 4.92) (envelope-from ) id 1uhPr7-0006uF-Oo; Thu, 31 Jul 2025 09:45:45 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 1065301.1430741; Thu, 31 Jul 2025 09:45:45 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uhPr7-0006u8-M4; Thu, 31 Jul 2025 09:45:45 +0000 Received: by outflank-mailman (input) for mailman id 1065301; Thu, 31 Jul 2025 09:45:44 +0000 Received: from mail.xenproject.org ([104.130.215.37]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uhPr6-0006u2-N8 for xen-devel@lists.xenproject.org; Thu, 31 Jul 2025 09:45:44 +0000 Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.96) (envelope-from ) id 1uhPr6-00An6k-0i; Thu, 31 Jul 2025 09:45:44 +0000 Received: from [2a01:cb15:80df:da00:94d0:641e:16e6:ca4b] (helo=l14) by xenbits.xenproject.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uhPr5-000JQ8-31; Thu, 31 Jul 2025 09:45:44 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xenproject.org; s=20200302mail; h=In-Reply-To:Content-Transfer-Encoding: Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=5Zcch4Gt3J8lnuFUxEUV425/BxBNpM/deqVfODPAOco=; b=ThsBEGlQZh/9p1J+p8ELLxMjA/ LdevacU/DfFd7NNsopFlCYCTxYZDLLpuwt94KKLhGgy0evAHEbdQFgQENxKe/LKAMFmSysMcrDFEO /dryEEYD3qKimP9h/4wYJkvBppmIPDYwGYlYG4VeIO6Nj+v+Fn+d+/nAB7c9CSg/GY6g=; Date: Thu, 31 Jul 2025 11:45:42 +0200 From: Anthony PERARD To: Roger Pau =?iso-8859-1?Q?Monn=E9?= Cc: Marek =?iso-8859-1?Q?Marczykowski-G=F3recki?= , xen-devel@lists.xenproject.org, Andrew Cooper , Anthony PERARD Subject: Re: [PATCH] tools/xl: don't crash on NULL command line Message-ID: References: <20250728102422.2245808-1-marmarek@invisiblethingslab.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Mon, Jul 28, 2025 at 02:11:16PM +0200, Roger Pau Monné wrote: > On Mon, Jul 28, 2025 at 12:24:03PM +0200, Marek Marczykowski-Górecki wrote: > > When running xl in a domU, it doesn't have access to the Xen command > > line. Before the non-truncating xc_xenver_cmdline(), it was always set > > with strdup, possibly of an empty string. Now it's NULL. Treat it the > > same as empty cmdline, as it was before. Autoballoon isn't relevant for > > xl devd in a domU anyway. > > > > Fixes: 75f91607621c ("tools: Introduce a non-truncating xc_xenver_cmdline()") > > Signed-off-by: Marek Marczykowski-Górecki > > --- > > tools/xl/xl.c | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/tools/xl/xl.c b/tools/xl/xl.c > > index ec72ca60c32a..e183d42b1d65 100644 > > --- a/tools/xl/xl.c > > +++ b/tools/xl/xl.c > > @@ -81,6 +81,8 @@ static int auto_autoballoon(void) > > info = libxl_get_version_info(ctx); > > if (!info) > > return 1; /* default to on */ > > + if (!info->commandline) > > + return 1; > > It's a nit, but could you join with the previous if condition, so that > the comment also applies? > > if (!info || !info->commandline) > return 1; /* default to on */ Acked-by: Anthony PERARD Thanks, -- Anthony PERARD