[virt-tools-list] [libosinfo] loader: Use symbolic names in osinfo_loader_install_config_params

Michal Privoznik mprivozn at redhat.com
Fri Dec 7 13:22:59 UTC 2012


On 07.12.2012 13:16, Christophe Fergeau wrote:
> osinfo_loader_install_config_params.h defines
> OSINFO_INSTALL_CONFIG_PARAMS_* constants, better to use these
> rather than string literals.
> ---
>  osinfo/osinfo_loader.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/osinfo/osinfo_loader.c b/osinfo/osinfo_loader.c
> index 5d92df4..4e66b1e 100644
> --- a/osinfo/osinfo_loader.c
> +++ b/osinfo/osinfo_loader.c
> @@ -588,8 +588,8 @@ static void osinfo_loader_install_config_params(OsinfoLoader *loader,
>          return;
>  
>      for (i = 0 ; i < nnodes ; i++) {
> -        gchar *name = (gchar *)xmlGetProp(nodes[i], BAD_CAST "name");
> -        gchar *policy = (gchar *)xmlGetProp(nodes[i], BAD_CAST "policy");
> +        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);
>          OsinfoInstallConfigParam *param = osinfo_install_config_param_new(name);
>          osinfo_entity_set_param(OSINFO_ENTITY(param),
>                                  OSINFO_INSTALL_CONFIG_PARAM_PROP_POLICY,
> 

ACK

Michal




More information about the virt-tools-list mailing list