aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxl/libxlu_cfg.c
diff options
context:
space:
mode:
authorIan Campbell <ian.campbell@citrix.com>2012-03-01 12:26:14 +0000
committerIan Campbell <ian.campbell@citrix.com>2012-03-01 12:26:14 +0000
commit50cbda0d0b1bffa4a7af91b5ff8a65d88191fdbb (patch)
treefcc97d3b3fbf51bdccae615127ae6c94e4ff6a0c /tools/libxl/libxlu_cfg.c
parent966deb4db61ea44e2487c84daa0939f52416fa83 (diff)
downloadxen-50cbda0d0b1bffa4a7af91b5ff8a65d88191fdbb.tar.gz
xen-50cbda0d0b1bffa4a7af91b5ff8a65d88191fdbb.tar.bz2
xen-50cbda0d0b1bffa4a7af91b5ff8a65d88191fdbb.zip
libxl: add new "defbool" built in type.
This type is a but like a "boolean" but with a third state "default" (so really I suppose it's a tristate). Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Diffstat (limited to 'tools/libxl/libxlu_cfg.c')
-rw-r--r--tools/libxl/libxlu_cfg.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/libxl/libxlu_cfg.c b/tools/libxl/libxlu_cfg.c
index e3659c7654..c32cf046c1 100644
--- a/tools/libxl/libxlu_cfg.c
+++ b/tools/libxl/libxlu_cfg.c
@@ -237,6 +237,17 @@ int xlu_cfg_get_long(const XLU_Config *cfg, const char *n,
return 0;
}
+int xlu_cfg_get_defbool(const XLU_Config *cfg, const char *n, libxl_defbool *b,
+ int dont_warn)
+{
+ int ret;
+ long l;
+
+ ret = xlu_cfg_get_long(cfg, n, &l, dont_warn);
+ if (ret) return ret;
+ libxl_defbool_set(b, !!l);
+ return 0;
+}
int xlu_cfg_get_list(const XLU_Config *cfg, const char *n,
XLU_ConfigList **list_r, int *entries_r, int dont_warn) {