int xlu_cfg_get_list(const XLU_Config *cfg, const char *n,
- XLU_ConfigList **list_r, int *entries_r) {
+ XLU_ConfigList **list_r, int *entries_r, int dont_warn) {
XLU_ConfigSetting *set;
set= find(cfg,n); if (!set) return ESRCH;
if (set->avalues==1) {
- fprintf(cfg->report,
- "%s:%d: warning: parameter `%s' is a single value"
- " but should be a list\n",
- cfg->filename, set->lineno, n);
+ if (!dont_warn) {
+ fprintf(cfg->report,
+ "%s:%d: warning: parameter `%s' is a single value"
+ " but should be a list\n",
+ cfg->filename, set->lineno, n);
+ }
return EINVAL;
}
if (list_r) *list_r= set;
int xlu_cfg_get_list(const XLU_Config*, const char *n,
XLU_ConfigList **list_r /* may be 0 */,
- int *entries_r /* may be 0 */);
+ int *entries_r /* may be 0 */,
+ int dont_warn);
/* there is no need to free *list_r; lifetime is that of the XLU_Config */
const char *xlu_cfg_get_listitem(const XLU_ConfigList*, int entry);
/* xlu_cfg_get_listitem cannot fail, except that if entry is
xlu_cfg_replace_string (config, "ramdisk", &b_info->u.pv.ramdisk.path);
}
- if (!xlu_cfg_get_list (config, "disk", &vbds, 0)) {
+ if (!xlu_cfg_get_list (config, "disk", &vbds, 0, 0)) {
d_config->num_disks = 0;
d_config->disks = NULL;
while ((buf = xlu_cfg_get_listitem (vbds, d_config->num_disks)) != NULL) {
}
}
- if (!xlu_cfg_get_list (config, "vif", &nics, 0)) {
+ if (!xlu_cfg_get_list (config, "vif", &nics, 0, 0)) {
d_config->num_vifs = 0;
d_config->vifs = NULL;
while ((buf = xlu_cfg_get_listitem (nics, d_config->num_vifs)) != NULL) {
}
}
- if (!xlu_cfg_get_list(config, "vif2", &net2s, 0)) {
+ if (!xlu_cfg_get_list(config, "vif2", &net2s, 0, 0)) {
d_config->num_vif2s = 0;
d_config->vif2s = NULL;
while ((buf = xlu_cfg_get_listitem(net2s, d_config->num_vif2s))) {
}
}
- if (!xlu_cfg_get_list (config, "vfb", &cvfbs, 0)) {
+ if (!xlu_cfg_get_list (config, "vfb", &cvfbs, 0, 0)) {
d_config->num_vfbs = 0;
d_config->num_vkbs = 0;
d_config->vfbs = NULL;
if (!xlu_cfg_get_long (config, "pci_power_mgmt", &l))
pci_power_mgmt = l;
- if (!xlu_cfg_get_list (config, "pci", &pcis, 0)) {
+ if (!xlu_cfg_get_list (config, "pci", &pcis, 0, 0)) {
int i;
d_config->num_pcidevs = 0;
d_config->pcidevs = NULL;