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

[xen stable-4.20] tools/xl: don't crash on NULL command line



commit 7cda6b65098f790e6573f555c5ef170d3f373c6e
Author:     Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>
AuthorDate: Mon Aug 4 15:22:13 2025 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Mon Aug 4 15:22:13 2025 +0200

    tools/xl: don't crash on NULL command line
    
    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 <marmarek@xxxxxxxxxxxxxxxxxxxxxx>
    Acked-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
    master commit: a4988c4177be81f225af1516e1bbb9ec14f76388
    master date: 2025-07-31 14:44:02 +0200
---
 tools/xl/xl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/xl/xl.c b/tools/xl/xl.c
index ec72ca60c3..b3abc91b60 100644
--- a/tools/xl/xl.c
+++ b/tools/xl/xl.c
@@ -79,7 +79,7 @@ static int auto_autoballoon(void)
     int ret;
 
     info = libxl_get_version_info(ctx);
-    if (!info)
+    if (!info || !info->commandline)
         return 1; /* default to on */
 
 #define SIZE_PATTERN "-?[0-9]+[bBkKmMgGtT]?"
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20



 


Rackspace

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