From: Keir Fraser Date: Wed, 19 May 2010 07:18:51 +0000 (+0100) Subject: xl: recognize the "extra" entry in the domain config file X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~12124 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=4d8af8596635a01186ed762aa6c47d81e5cd867e;p=xen.git xl: recognize the "extra" entry in the domain config file "extra" defines extra parameters to be added to the kernel command line, so append it accordingly. Signed-off-by: Jeremy Fitzhardinge --- diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c index 9c37d43e84..768547e4dd 100644 --- a/tools/libxl/xl_cmdimpl.c +++ b/tools/libxl/xl_cmdimpl.c @@ -507,14 +507,25 @@ static void parse_config_data(const char *configfile_filename_report, if (!xlu_cfg_get_long (config, "viridian", &l)) b_info->u.hvm.viridian = l; } else { - char *cmdline; - if (!xlu_cfg_get_string (config, "root", &buf)) { - if (asprintf(&cmdline, "root=%s", buf) < 0) { - fprintf(stderr, "Failed to allocate memory in asprintf\n"); - exit(1); - } - b_info->u.pv.cmdline = cmdline; + char *cmdline = NULL; + const char *root = NULL, *extra = ""; + + xlu_cfg_get_string (config, "root", &root); + xlu_cfg_get_string (config, "extra", &extra); + + if (root) { + if (asprintf(&cmdline, "root=%s %s", root, extra) == -1) + cmdline = NULL; + } else { + cmdline = strdup(extra); } + + if ((root || extra) && !cmdline) { + fprintf(stderr, "Failed to allocate memory for cmdline\n"); + exit(1); + } + + b_info->u.pv.cmdline = cmdline; if (!xlu_cfg_get_string (config, "ramdisk", &buf)) b_info->u.pv.ramdisk = strdup(buf); }