[libvirt] [dbus PATCH 2/6] Implement InterfaceAddresses method for Domain Interface

Pavel Hrdina phrdina at redhat.com
Fri Apr 27 14:28:14 UTC 2018


On Fri, Apr 27, 2018 at 11:00:51AM +0200, Katerina Koukiou wrote:
> VIR_DOMAIN_INTERFACE_ADDRESSES_SRC_ARP should be added
> later on.
> 
> Signed-off-by: Katerina Koukiou <kkoukiou at redhat.com>
> ---
>  data/org.libvirt.Domain.xml |  7 ++++
>  src/domain.c                | 87 +++++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 94 insertions(+)

[...]

> diff --git a/src/domain.c b/src/domain.c
> index 562e709..83ad053 100644
> --- a/src/domain.c
> +++ b/src/domain.c

[...]

> @@ -1684,6 +1709,67 @@ virtDBusDomainInjectNMI(GVariant *inArgs,
>          virtDBusUtilSetLastVirtError(error);
>  }
>  
> +static void
> +virtDBusDomainInterfaceAddresses(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(virDomain) domain = NULL;
> +    gint source;
> +    const gchar *sourceStr;
> +    g_auto(virtDBusDomainInterfaceList) ifaces = { 0 };
> +    guint flags;
> +    GVariantBuilder builder;
> +    GVariant *res;
> +
> +    g_variant_get(inArgs, "(&su)", &sourceStr, &flags);
> +
> +    domain = virtDBusDomainGetVirDomain(connect, objectPath, error);
> +    if (!domain)
> +        return;
> +
> +    source = virtDBusDomainInterfaceAddressesSourceTypeFromString(sourceStr);
> +    if (source < 0) {
> +        g_set_error(error, VIRT_DBUS_ERROR, VIRT_DBUS_ERROR_LIBVIRT,
> +                    "Can't get valid virDomainInterfaceAddressesSource from string '%s'.",
> +                    sourceStr);
> +        return;
> +    }
> +    ifaces.count = virDomainInterfaceAddresses(domain, &(ifaces.ifaces),
> +                                               source, flags);
> +    if (ifaces.count < 0)
> +        virtDBusUtilSetLastVirtError(error);

Missing return.

Reviewed-by: Pavel Hrdina <phrdina at redhat.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20180427/33644b24/attachment-0001.sig>


More information about the libvir-list mailing list