diff options
author | Andre Przywara <andre.przywara@amd.com> | 2010-09-21 16:41:09 +0100 |
---|---|---|
committer | Andre Przywara <andre.przywara@amd.com> | 2010-09-21 16:41:09 +0100 |
commit | 88ac54776934daa7f57ec06f94c3d5306027220f (patch) | |
tree | 3971ee4a5e5cb3c6192a34e65c70be1ed2d90ba5 /tools/libxl/libxlu_cfg.c | |
parent | e1d00a45e0f526c7ba98eba7f400987645f18a86 (diff) | |
download | xen-88ac54776934daa7f57ec06f94c3d5306027220f.tar.gz xen-88ac54776934daa7f57ec06f94c3d5306027220f.tar.bz2 xen-88ac54776934daa7f57ec06f94c3d5306027220f.zip |
libxl: change xl_cfg_get_list to take a dont_warn parameter
xl_cfg_get_list can cope with the option not being a list, but
it always reports a warning in this case. Introduce a parameter
to omit this warning if needed. Future code can then decide what
to do with this information.
Signed-off-by: Andre Przywara <andre.przywara@amd.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Diffstat (limited to 'tools/libxl/libxlu_cfg.c')
-rw-r--r-- | tools/libxl/libxlu_cfg.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/tools/libxl/libxlu_cfg.c b/tools/libxl/libxlu_cfg.c index 07e65e1043..864a723009 100644 --- a/tools/libxl/libxlu_cfg.c +++ b/tools/libxl/libxlu_cfg.c @@ -194,14 +194,16 @@ int xlu_cfg_get_long(const XLU_Config *cfg, const char *n, 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; |