]> xenbits.xensource.com Git - people/gdunlap/xen.git/commitdiff
tools: xl: prepend root= to root field on command line with no extra
authorIan Campbell <ian.campbell@citrix.com>
Thu, 12 Mar 2015 17:56:47 +0000 (17:56 +0000)
committerIan Campbell <ian.campbell@citrix.com>
Fri, 13 Mar 2015 10:22:22 +0000 (10:22 +0000)
This was broken in 49ab17a3a615 "tools: xl: handle unspecified extra=
when dealing with root=".

Reported-by: Sander Eikelenboom <linux@eikelenboom.it>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Tested-by: Sander Eikelenboom <linux@eikelenboom.it>
Acked-by: Wei Liu <wei.liu2@citrix.com>
tools/libxl/xl_cmdimpl.c

index a27ac9e91ad1e4313d62faa1aa5081349c7520aa..04faf984268b846651b4a589a2990489e7aba6a8 100644 (file)
@@ -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);
         }