On Wed, May 09, 2018 at 04:59:37PM +0200, Katerina Koukiou wrote:
> Signed-off-by: Katerina Koukiou <kkouk...@redhat.com>
> ---
>  data/org.libvirt.Secret.xml |  6 ++++++
>  src/secret.c                | 34 ++++++++++++++++++++++++++++++++++
>  2 files changed, 40 insertions(+)

[...]

> diff --git a/src/secret.c b/src/secret.c
> index 653dc5c..028a7b4 100644
> --- a/src/secret.c
> +++ b/src/secret.c
> @@ -149,6 +149,39 @@ virtDBusSecretGetXMLDesc(GVariant *inArgs,
>      *outArgs = g_variant_new("(s)", xml);
>  }
>  
> +static void
> +virtDBusSecretSetValue(GVariant *inArgs,
> +                       GUnixFDList *inFDs G_GNUC_UNUSED,
> +                       const gchar *objectPath,
> +                       gpointer userData,
> +                       GVariant **outArgs G_GNUC_UNUSED,
> +                       GUnixFDList **outFDs G_GNUC_UNUSED,
> +                       GError **error)
> +{
> +    virtDBusConnect *connect = userData;
> +    g_autoptr(virSecret) secret = NULL;
> +    g_autoptr(GVariantIter) iter = NULL;
> +    guint flags;
> +    g_autofree guchar *value = NULL;
> +    guchar *tmp;
> +    gsize size;
> +
> +    g_variant_get(inArgs, "(ayu)", &iter, &flags);
> +
> +    secret = virtDBusSecretGetVirSecret(connect, objectPath, error);
> +    if (!secret)
> +        return;
> +
> +    size = g_variant_iter_n_children(iter);
> +    value = g_new0(guchar, size);
> +    tmp = value;
> +    while (g_variant_iter_next(iter, "y", tmp))
> +        tmp++;

Swap these two block, parse the array before getting secret object.

Pavel

Attachment: signature.asc
Description: PGP signature

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Reply via email to