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(a)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(a)redhat.com>