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: 75f9160762 ("tools: Introduce a non-truncating xc_xenver_cmdline()")
Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Acked-by: Anthony PERARD <anthony.perard@vates.tech>
master commit: a4988c4177
master date: 2025-07-31 14:44:02 +0200
This commit is contained in:
Marek Marczykowski-Górecki authored and Jan Beulich committed 2025-08-04 15:22:13 +02:00
1 parent 4072b0b24c
commit 7cda6b6509
1 file changed
+1 -1
+1 -1
View File
@@ -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]?"
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.