On Tue, Jun 16, 2015 at 17:44:11 +0200, Michal Privoznik wrote:
On 16.06.2015 00:42, Pavel Boldin wrote:
> Add multikey API:
>
> * virTypedParamsFilter that filters all the parameters with specified name.
> * virTypedParamsGetAllStrings that returns a list with all the values for
> specified name and string type.
>
> Signed-off-by: Pavel Boldin <pboldin(a)mirantis.com>
> Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
> ---
> include/libvirt/libvirt-host.h | 5 ++
> src/libvirt_public.syms | 5 ++
> src/util/virtypedparam.c | 102 +++++++++++++++++++++++++++++++++++++++++
> src/util/virtypedparam.h | 9 ++++
> tests/Makefile.am | 2 +-
> tests/virtypedparamtest.c | 100 ++++++++++++++++++++++++++++++++++++++++
> 6 files changed, 222 insertions(+), 1 deletion(-)
>
> diff --git a/include/libvirt/libvirt-host.h b/include/libvirt/libvirt-host.h
> index 070550b..8222cfb 100644
> --- a/include/libvirt/libvirt-host.h
> +++ b/include/libvirt/libvirt-host.h
> @@ -284,6 +284,11 @@ virTypedParamsGetString (virTypedParameterPtr params,
> const char *name,
> const char **value);
> int
> +virTypedParamsGetAllStrings(virTypedParameterPtr params,
Hmm, I apologize for not noticing it in my earlier comment, but since
the corresponding API for adding multiple strings is called
virTypedParamsAddStringList, we should call this
virTypedParamsGetStringList.
> + int nparams,
> + const char *name,
> + const char ***values);
Wrong indentation.
> +int
> virTypedParamsAddInt (virTypedParameterPtr *params,
> int *nparams,
> int *maxparams,
> diff --git a/src/libvirt_public.syms b/src/libvirt_public.syms
> index 716dd2f..0a1feea 100644
> --- a/src/libvirt_public.syms
> +++ b/src/libvirt_public.syms
> @@ -715,4 +715,9 @@ LIBVIRT_1.2.16 {
> virDomainSetUserPassword;
> } LIBVIRT_1.2.15;
>
> +LIBVIRT_1.3.0 {
> + global:
> + virTypedParamsGetAllStrings;
> +} LIBVIRT_1.2.16;
> +
I don't think this symbol needs to be exported.
Yeah, we have no API which would return multiple values for a single
parameter so there's no reason to export this now. We can export it
later when introducing such API.
Jirka