mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 10:40:03 +01:00
tools: xl: handle unspecified extra= when dealing with root=
If the cfg file includes root= but not extra= (nor cmdline=, which supercedes both) then the command line will end up with an extra "(null)" on it (at least with glibc's implementation of asprintf). Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Cc: Chunyan Liu <cyliu@suse.com> Acked-by: Wei Liu <wei.liu2@citrix.com>
This commit is contained in:
1 parent
e1eb56fb6b
commit
49ab17a3a6
1 file changed
+3
-1
@@ -813,9 +813,11 @@ static char *parse_cmdline(XLU_Config *config)
|
||||
fprintf(stderr, "Warning: ignoring root= and extra= "
|
||||
"in favour of cmdline=\n");
|
||||
} else {
|
||||
if (root) {
|
||||
if (root && extra) {
|
||||
if (asprintf(&cmdline, "root=%s %s", root, extra) == -1)
|
||||
cmdline = NULL;
|
||||
} else if (root) {
|
||||
cmdline = strdup(root);
|
||||
} else if (extra) {
|
||||
cmdline = strdup(extra);
|
||||
}
|
||||
|
||||