[libvirt] [dbus PATCH 05/15] Implement ListInterfaces method for Connect Interface
Pavel Hrdina
phrdina at redhat.com
Tue Jul 10 08:26:34 UTC 2018
On Fri, Jul 06, 2018 at 05:36:45PM -0400, Anya Harter wrote:
> Signed-off-by: Anya Harter <aharter at redhat.com>
> ---
> data/org.libvirt.Connect.xml | 6 ++++++
> src/connect.c | 38 ++++++++++++++++++++++++++++++++++++
> 2 files changed, 44 insertions(+)
[...]
> diff --git a/src/connect.c b/src/connect.c
> index b10533a..a3d002e 100644
> --- a/src/connect.c
> +++ b/src/connect.c
> @@ -772,6 +772,43 @@ virtDBusConnectListDomains(GVariant *inArgs,
> *outArgs = g_variant_new_tuple(&gdomains, 1);
> }
>
> +static void
> +virtDBusConnectListInterfaces(GVariant *inArgs,
> + GUnixFDList *inFDs G_GNUC_UNUSED,
> + const gchar *objectPath G_GNUC_UNUSED,
> + gpointer userData,
> + GVariant **outArgs,
> + GUnixFDList **outFDs G_GNUC_UNUSED,
> + GError **error)
> +{
> + virtDBusConnect *connect = userData;
> + g_autoptr(virInterfacePtr) interfaces = NULL;
> + guint flags;
> + GVariantBuilder builder;
> + GVariant *ginterfaces;
> +
> + g_variant_get(inArgs, "(u)", &flags);
> +
> + if (!virtDBusConnectOpen(connect, error))
> + return;
> +
> + if (virConnectListAllInterfaces(connect->connection, &interfaces, flags) < 0)
> + return virtDBusUtilSetLastVirtError(error);
> +
> + g_variant_builder_init(&builder, G_VARIANT_TYPE("ao"));
> +
> + for (gint i = 0; interfaces[i]; i++) {
> + g_autofree gchar *path = NULL;
> + path = virtDBusUtilBusPathForVirInterface(interfaces[i],
> + connect->interfacePath);
Indentation is off.
Pavel
-------------- 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/20180710/7fd51f44/attachment-0001.sig>
More information about the libvir-list
mailing list