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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
> ---
>  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@xxxxxxxxxx>

Attachment: signature.asc
Description: PGP signature

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

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux