aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxl/xl.c
diff options
context:
space:
mode:
authorKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2013-05-13 15:29:12 -0400
committerIan Campbell <ian.campbell@citrix.com>2013-05-14 10:02:00 +0100
commit93b241e9d2c23b75f400a9ccda40838b9d13e27d (patch)
tree2dbefc5b94d337822d69830eb7da3c8c95a31a47 /tools/libxl/xl.c
parentbec8f17e48439ee5b8370f4e431ccd9a9514bee7 (diff)
downloadxen-93b241e9d2c23b75f400a9ccda40838b9d13e27d.tar.gz
xen-93b241e9d2c23b75f400a9ccda40838b9d13e27d.tar.bz2
xen-93b241e9d2c23b75f400a9ccda40838b9d13e27d.zip
libxl: Change claim_mode from bool to int.
During the review it was noticed that it would be better if internally the claim_mode was held as an 'int' instead of a 'bool'. The reason is that during the startup of xl, one has call the libxl_defbool_setdefault. otherwise any usage of claim_mode would result in assert break. The assert is due to the fact that using defbool without any set values (either true of false) will cause it hit an assertion. If we use an 'int' we don't have to worry about it and by default the value of zero will suffice for checks whether the claim is enabled or disabled. Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Acked-by: Ian Campbell <Ian.Campbell@citrix.com>
Diffstat (limited to 'tools/libxl/xl.c')
-rw-r--r--tools/libxl/xl.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/libxl/xl.c b/tools/libxl/xl.c
index 3c141bfdaa..1ce820c533 100644
--- a/tools/libxl/xl.c
+++ b/tools/libxl/xl.c
@@ -46,7 +46,7 @@ char *default_vifscript = NULL;
char *default_bridge = NULL;
char *default_gatewaydev = NULL;
enum output_format default_output_format = OUTPUT_FORMAT_JSON;
-libxl_defbool claim_mode;
+int claim_mode = 0;
static xentoollog_level minmsglevel = XTL_PROGRESS;
@@ -170,8 +170,8 @@ static void parse_global_config(const char *configfile,
if (!xlu_cfg_get_string (config, "blkdev_start", &buf, 0))
blkdev_start = strdup(buf);
- libxl_defbool_setdefault(&claim_mode, false);
- (void)xlu_cfg_get_defbool (config, "claim_mode", &claim_mode, 0);
+ if (!xlu_cfg_get_long (config, "claim_mode", &l, 0))
+ claim_mode = l;
xlu_cfg_destroy(config);
}