From cde92647ea4f5c487059a3c89f2e3f1aec9a42d3 Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Thu, 12 Mar 2015 17:56:47 +0000 Subject: [PATCH] tools: xl: prepend root= to root field on command line with no extra This was broken in 49ab17a3a615 "tools: xl: handle unspecified extra= when dealing with root=". Reported-by: Sander Eikelenboom Signed-off-by: Ian Campbell Tested-by: Sander Eikelenboom Acked-by: Wei Liu --- tools/libxl/xl_cmdimpl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c index a27ac9e91a..04faf98426 100644 --- a/tools/libxl/xl_cmdimpl.c +++ b/tools/libxl/xl_cmdimpl.c @@ -817,7 +817,8 @@ static char *parse_cmdline(XLU_Config *config) if (asprintf(&cmdline, "root=%s %s", root, extra) == -1) cmdline = NULL; } else if (root) { - cmdline = strdup(root); + if (asprintf(&cmdline, "root=%s", root) == -1) + cmdline = NULL; } else if (extra) { cmdline = strdup(extra); } -- 2.39.5