[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen master] tools: xl: handle unspecified extra= when dealing with root=
commit 49ab17a3a615e1ab4ccc46d6942f925cf841df4b Author: Ian Campbell <ian.campbell@xxxxxxxxxx> AuthorDate: Mon Mar 9 12:48:56 2015 +0000 Commit: Ian Campbell <ian.campbell@xxxxxxxxxx> CommitDate: Wed Mar 11 12:58:49 2015 +0000 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@xxxxxxxxxx> Cc: Chunyan Liu <cyliu@xxxxxxxx> Acked-by: Wei Liu <wei.liu2@xxxxxxxxxx> --- tools/libxl/xl_cmdimpl.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c index 399b6b6..a27ac9e 100644 --- a/tools/libxl/xl_cmdimpl.c +++ b/tools/libxl/xl_cmdimpl.c @@ -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); } -- generated by git-patchbot for /home/xen/git/xen.git#master _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |