]> xenbits.xensource.com Git - xen.git/commit
libxlu: rework internal representation of setting
authorWei Liu <wei.liu2@citrix.com>
Mon, 16 Mar 2015 09:52:35 +0000 (09:52 +0000)
committerIan Campbell <ian.campbell@citrix.com>
Wed, 18 Mar 2015 12:04:56 +0000 (12:04 +0000)
commit1a09c5113a38dcf1fb6582d77285d727defeea6c
tree2246012e8497fdd774e617aaaee79171128216e4
parent711dec67298f146326b3c8ff78204c67c7b4bba6
libxlu: rework internal representation of setting

This patches does following things:

1. Properly define a XLU_ConfigList type. Originally it was defined to
   be XLU_ConfigSetting.
2. Define XLU_ConfigValue type, which can be either a string or a list
   of XLU_ConfigValue.
3. ConfigSetting now references XLU_ConfigValue. Originally it only
   worked with **string.
4. Properly construct list where necessary, see changes to .y file.

To achieve above changes:

1. xlu__cfg_set_mk and xlu__cfg_set_add are deleted, because they
   are no more needed in the new code.
2. Introduce xlu__cfg_string_mk to make a XLU_ConfigSetting that points
   to a XLU_ConfigValue that wraps a string.
3. Introduce xlu__cfg_list_mk to make a XLU_ConfigSetting that points
   to XLU_ConfigValue that is a list.
4. The parser now generates XLU_ConfigValue instead of XLU_ConfigSetting
   when construct values, which enables us to recursively generate list
   of lists.
5. XLU_ConfigSetting is generated in xlu__cfg_set_store.
6. Adapt other functions to use new types.

No change to public API. Xl compiles without problem and 'xl create -n
guest.cfg' is valgrind clean.

This patch is needed because we're going to implement nested list
support, which requires support for list of list.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/libxl/libxlu_cfg.c
tools/libxl/libxlu_cfg_i.h
tools/libxl/libxlu_cfg_y.c
tools/libxl/libxlu_cfg_y.h
tools/libxl/libxlu_cfg_y.y
tools/libxl/libxlu_internal.h