[Libosinfo] [PATCHv4 02/11] loader: Parse OsinfoInstallConfigParam::value-map from XML

Zeeshan Ali (Khattak) zeeshanak at gnome.org
Tue Dec 18 01:08:29 UTC 2012


On Mon, Dec 17, 2012 at 11:07 PM, Christophe Fergeau
<cfergeau at redhat.com> wrote:
> ---
>  data/schemas/libosinfo.rng           | 3 +++
>  osinfo/osinfo_install_config_param.h | 5 +++--
>  osinfo/osinfo_loader.c               | 7 +++++++
>  3 files changed, 13 insertions(+), 2 deletions(-)
>
> diff --git a/data/schemas/libosinfo.rng b/data/schemas/libosinfo.rng
> index 62be37d..90b0dfb 100644
> --- a/data/schemas/libosinfo.rng
> +++ b/data/schemas/libosinfo.rng
> @@ -557,6 +557,9 @@
>                  <attribute name="policy">
>                    <ref name='policies'/>
>                  </attribute>
> +                <optional>
> +                  <attribute name="value-map"/>
> +                </optional>
>                </element>
>              </oneOrMore>
>            </element>
> diff --git a/osinfo/osinfo_install_config_param.h b/osinfo/osinfo_install_config_param.h
> index ba5a77c..b0f2217 100644
> --- a/osinfo/osinfo_install_config_param.h
> +++ b/osinfo/osinfo_install_config_param.h
> @@ -37,8 +37,9 @@
>  #define OSINFO_IS_INSTALL_CONFIG_PARAM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), OSINFO_TYPE_INSTALL_CONFIG_PARAM))
>  #define OSINFO_INSTALL_CONFIG_PARAM_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), OSINFO_TYPE_INSTALL_CONFIG_PARAM, OsinfoInstallConfigParamClass))
>
> -#define OSINFO_INSTALL_CONFIG_PARAM_PROP_NAME   "name"
> -#define OSINFO_INSTALL_CONFIG_PARAM_PROP_POLICY "policy"
> +#define OSINFO_INSTALL_CONFIG_PARAM_PROP_DATAMAP "value-map"
> +#define OSINFO_INSTALL_CONFIG_PARAM_PROP_NAME    "name"
> +#define OSINFO_INSTALL_CONFIG_PARAM_PROP_POLICY  "policy"
>
>  typedef struct _OsinfoInstallConfigParam        OsinfoInstallConfigParam;
>  typedef struct _OsinfoInstallConfigParamClass   OsinfoInstallConfigParamClass;
> diff --git a/osinfo/osinfo_loader.c b/osinfo/osinfo_loader.c
> index a097039..efbbc97 100644
> --- a/osinfo/osinfo_loader.c
> +++ b/osinfo/osinfo_loader.c
> @@ -642,12 +642,19 @@ static void osinfo_loader_install_config_params(OsinfoLoader *loader,
>      for (i = 0 ; i < nnodes ; i++) {
>          gchar *name = (gchar *)xmlGetProp(nodes[i], BAD_CAST OSINFO_INSTALL_CONFIG_PARAM_PROP_NAME);
>          gchar *policy = (gchar *)xmlGetProp(nodes[i], BAD_CAST OSINFO_INSTALL_CONFIG_PARAM_PROP_POLICY);
> +        gchar *mapid = (gchar *)xmlGetProp(nodes[i], BAD_CAST OSINFO_INSTALL_CONFIG_PARAM_PROP_DATAMAP);
>          OsinfoInstallConfigParam *param = osinfo_install_config_param_new(name);
>          osinfo_entity_set_param(OSINFO_ENTITY(param),
>                                  OSINFO_INSTALL_CONFIG_PARAM_PROP_POLICY,
>                                  policy);
>          osinfo_install_script_add_config_param(OSINFO_INSTALL_SCRIPT(entity),
>                                                 param);
> +        if (mapid != NULL) {
> +            OsinfoDatamap *map;
> +            map = osinfo_loader_get_datamap(loader, mapid);

Its probably just me being blind but I can't find this
osinfo_loader_get_datamap() being defined in this or the only previous
patch in this series.


-- 
Regards,

Zeeshan Ali (Khattak)
FSF member#5124




More information about the Libosinfo mailing list