diff -u --recursive --new-file xen-4.1.2-vanilla/tools/libxl/xl_cmdimpl.c xen-4.1.2/tools/libxl/xl_cmdimpl.c --- xen-4.1.2-vanilla/tools/libxl/xl_cmdimpl.c 2011-10-20 12:05:43.000000000 -0500 +++ xen-4.1.2/tools/libxl/xl_cmdimpl.c 2012-05-30 23:37:51.261948881 -0500 @@ -1442,30 +1442,32 @@ &config_data, &config_len); if (ret) { fprintf(stderr, "Failed to read config file: %s: %s\n", config_file, strerror(errno)); return ERROR_FAIL; } - if (!restore_file && extra_config && strlen(extra_config)) { - if (config_len > INT_MAX - (strlen(extra_config) + 2 + 1)) { - fprintf(stderr, "Failed to attach extra configration\n"); - return ERROR_FAIL; - } - /* allocate space for the extra config plus two EOLs plus \0 */ - config_data = realloc(config_data, config_len - + strlen(extra_config) + 2 + 1); - if (!config_data) { - fprintf(stderr, "Failed to realloc config_data\n"); - return ERROR_FAIL; - } - config_len += sprintf(config_data + config_len, "\n%s\n", - extra_config); - } } else { - if (!config_data) { - fprintf(stderr, "Config file not specified and" + if (!config_data && !extra_config) { + fprintf(stderr, "Domain config file not specified," + " none on command line, and" " none in save file\n"); return ERROR_INVAL; } config_file = ""; } + if (!restore_file && extra_config && strlen(extra_config)) { + if (config_len > INT_MAX - (strlen(extra_config) + 2 + 1)) { + fprintf(stderr, "Failed to attach extra configration\n"); + return ERROR_FAIL; + } + /* allocate space for the extra config plus two EOLs plus \0 */ + config_data = realloc(config_data, config_len + + strlen(extra_config) + 2 + 1); + if (!config_data) { + fprintf(stderr, "Failed to realloc config_data\n"); + return ERROR_FAIL; + } + config_len += sprintf(config_data + config_len, "\n%s\n", + extra_config); + } + if (!dom_info->quiet) printf("Parsing config file %s\n", config_file);